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

Open
weiiwang01 opened this issue Feb 28, 2024 · 3 comments · May be fixed by #418
Open

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

weiiwang01 opened this issue Feb 28, 2024 · 3 comments · May be fixed by #418
Assignees
Labels
24.04 Planned for the 24.04 cycle 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.

@benhoyt benhoyt added 24.04 Planned for the 24.04 cycle Simple Nice for a quick look on a minute or two labels Mar 13, 2024
@IronCore864 IronCore864 linked a pull request May 27, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
24.04 Planned for the 24.04 cycle Simple Nice for a quick look on a minute or two
Projects
None yet
3 participants