-
Notifications
You must be signed in to change notification settings - Fork 222
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
Fixed xattr reading and writing #2762
base: main
Are you sure you want to change the base?
Conversation
42641d5
to
7b9a1b4
Compare
7b9a1b4
to
7f65186
Compare
7f65186
to
c1897d7
Compare
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.
This is good, but it comes within a catch. This changes the metadata name, and somebody could have come to rely upon that. Two things need to happen to allow this through
- When reading, let's check for both.
- When writing, let's check that the "oldschool" version doesn't exist; if it does, delete it and replace it with the new attribute.
Seems like the requested changes are way above my knowledge of the Go. So, feel free to create a new PR or push to this one. By the way, wouldn't it be better to use this module https://github.com/pkg/xattr which covers support/error handling for some specific OSs like FreeBSD, NetBSD and MacOS? |
Sounds like I'll be picking this up if I get some spare time. |
Fixes #2761
Based on https://stackoverflow.com/questions/60893372/why-must-a-user-be-prepended-to-the-name-when-setting-a-files-xattr-with-os and https://go.googlesource.com/sys.git/+/master/unix/xattr_bsd.go#31 looks like "user" prefix is needed when saving/reading xattr to/from the file.
I don't know the Go language, so feel free to add new changes to my branch or create a new one.