-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check ENOTDIR for readlink #1597
Conversation
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
remaining apiWebdavProperties1/copyFile.feature tests require returning a new error type that we can use to map the |
@ishank011 I also removed the failing test from eos because I don't expect it to be an issue for eos ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
You could maybe consider adding a unit test to the Describe("Child", ...
block in node_test.go
for it, e.g.
It("handles (broken) links including file segments by returning an non-existant node", func() {
child, err := parent.Child(env.Ctx, "file1/broken")
Expect(err).ToNot(HaveOccurred())
Expect(child).ToNot(BeNil())
Expect(child.Exists).To(BeFalse())
})
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
readlink returns ENOTDIR when a path segment is a file and not a directory.
os.IsNotExist
won't cover this case: golang/go#18974part of owncloud/ocis#1239
Links: https://www.man7.org/linux/man-pages/man2/readlink.2.html