-
Notifications
You must be signed in to change notification settings - Fork 255
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
Xattrs support in reverse mode #878
base: master
Are you sure you want to change the base?
Conversation
Nice! Can you enable the test in https://github.com/rfjakob/gocryptfs/blob/master/tests/reverse/xattr_test.go ? |
411b4f9
to
f2de17e
Compare
Done. I'm not sure if a notification is sent to the email when updating the sources. |
// Caller passes size zero to find out how large their buffer should be | ||
if len(dest) == 0 { | ||
return uint32(len(data)), 0 | ||
} |
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.
Why remove this?
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.
The behavior of the function is described in:
https://github.com/hanwen/go-fuse/blob/756578b6a0b03511fde147b2f23c5b97217ede27/fs/api.go#L312
It doesn't make sense, since the following condition will give the same result:
https://github.com/hanwen/go-fuse/blob/756578b6a0b03511fde147b2f23c5b97217ede27/fuse/opcode.go#L285
@@ -50,13 +47,13 @@ func (n *Node) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, | |||
var errno syscall.Errno | |||
data, errno = n.getXAttr(attr) | |||
if errno != 0 { | |||
return minus1, errno |
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.
Why not -1 like https://man7.org/linux/man-pages/man2/getxattr.2.html#RETURN_VALUE says?
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.
The behavior of the function is described in:
https://github.com/hanwen/go-fuse/blob/756578b6a0b03511fde147b2f23c5b97217ede27/fs/api.go#L312
Returning -1 does not make sense, since it is ignored on errors:
https://github.com/hanwen/go-fuse/blob/756578b6a0b03511fde147b2f23c5b97217ede27/fuse/opcode.go#L294
Fixes #827