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

Chmod/Chown is not atomic #82

Open
ihucos opened this issue Aug 24, 2018 · 0 comments
Open

Chmod/Chown is not atomic #82

ihucos opened this issue Aug 24, 2018 · 0 comments

Comments

@ihucos
Copy link

ihucos commented Aug 24, 2018

I had the problem, that this line:

int res = lchown(p, uid, gid);

rightfully returns an error, but nevertheless apparently the file in a branch is created with the default owner/group, which effectively changes the file in the mounted filesystem.
Some debugging thoughts can be found here: #78
That may also happen in other places. It would also be interesting if there is a race condition.
One solution (that I think would require a bigger refactoring) is to first build the file for the write branch in a tmp directory and then rename it to the final destination instead of changing it "in place".

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

No branches or pull requests

1 participant