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

pebble make-dirs permission is masked by pebble daemon's umask #372

Closed
weiiwang01 opened this issue Feb 28, 2024 · 4 comments · Fixed by #418 or #423
Closed

pebble make-dirs permission is masked by pebble daemon's umask #372

weiiwang01 opened this issue Feb 28, 2024 · 4 comments · Fixed by #418 or #423
Assignees
Labels
Simple Nice for a quick look on a minute or two

Comments

@weiiwang01
Copy link

When running the Pebble make-dirs command, the resulting directory permissions may not match the requested settings, as they are affected by the umask of the pebble daemon.

To reproduce:

( umask 077; ./pebble run )

./pebble mkdir -m=777 /tmp/test-mkdir
ls -lah /tmp/test-mkdir/.
total 8.0K
drwx------  2 weii-wang weii-wang 4.0K Feb 28 05:02 . # it should be 777 instead of 700
drwxrwxrwt 16 root      root      4.0K Feb 28 05:02 ..
@weiiwang01
Copy link
Author

Well the simplest way to fix this issue is to just call syscall.Umask(0) when starting the daemon or fix the issue in internals/osutil/mkdirallchown.go, which seems not trivial. I wonder which approach would be better.

@weiiwang01
Copy link
Author

Oh, I forgot that the umask is inherited by child processes, so it's probably not a good idea to change the umask of Pebble itself.

@benhoyt
Copy link
Contributor

benhoyt commented Feb 28, 2024

It looks like this might be a duplicate of #80 -- however, when that issue was fixed (here: a2161d4) it looks like it was only fixed for write-file and not make-dirs, so keeping this open to track that.

@IronCore864
Copy link
Contributor

IronCore864 commented Jun 6, 2024

This issue was accidentally closed by #405.

Reopen now. A refactor has been done in #418 , and this issue will be closed by #423.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple Nice for a quick look on a minute or two
Projects
None yet
3 participants