Skip to content
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

Extended attributes can not be set on file without write permissions #208

Closed
TomasKorbar opened this issue Aug 11, 2021 · 2 comments · Fixed by #212
Closed

Extended attributes can not be set on file without write permissions #208

TomasKorbar opened this issue Aug 11, 2021 · 2 comments · Fixed by #212

Comments

@TomasKorbar
Copy link
Contributor

Hi Wayne,
recently we encountered the old issue with rsync not being able to set extended file attributes
as non-root user. I am trying to find approach which could fix this (fake-super work-around unfortunately
does not work for us).
Would you be ok with function set_xattr checking whether the file has write permission and if not then temporarily adding it?
After the attributes are set, we can set the permissions back.

Reproducer:

$ rm -rf orig a
$ touch orig a
$ setfattr -n user.attrib -v value orig
$ chmod -w orig a
$ rsync -av --xattrs orig a
TomasKorbar added a commit to TomasKorbar/rsync that referenced this issue Aug 19, 2021
When we need to set extended atributes of file which does not
allow write then temporarily add write permission and after
attributes are set, remove it again.

Resolves RsyncProject#208
@TomasKorbar
Copy link
Contributor Author

PR is still WIP.

TomasKorbar added a commit to TomasKorbar/rsync that referenced this issue Aug 23, 2021
When we need to set extended atributes of file which does not
allow write then temporarily add write permission and after
attributes are set, remove it again.

Resolves RsyncProject#208
@TomasKorbar
Copy link
Contributor Author

Alright PR is now ready for review. It passes our usecase and all tests from testsuite are passing.

WayneD added a commit that referenced this issue Sep 26, 2021
* Eventually add write permission when setting extended attributes

When we need to set extended atributes of file which does not
allow write then temporarily add write permission and after
attributes are set, remove it again.

Resolves #208

Co-authored-by: Wayne Davison <wayne@opencoder.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant