-
Notifications
You must be signed in to change notification settings - Fork 197
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
postprocess: Ensure toplevel dirs are 0755 regardless of umask #1902
Conversation
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.
I was chatting with @yuvalturg, and IIUC, the root directory itself is also affected to this. I.e. I think we also need:
diff --git a/src/app/rpmostree-compose-builtin-tree.c b/src/app/rpmostree-compose-builtin-tree.c
index 6bb48f39..89b70d3d 100644
--- a/src/app/rpmostree-compose-builtin-tree.c
+++ b/src/app/rpmostree-compose-builtin-tree.c
@@ -943,6 +943,9 @@ impl_install_tree (RpmOstreeTreeComposeContext *self,
return FALSE;
if (!glnx_ensure_dir (self->workdir_dfd, final_rootfs_name, 0755, error))
return FALSE;
+ /* make sure umask isn't affecting us */
+ if (fchmodat (dfd, toplevel_dirs[i], 0755, 0) == -1)
+ return glnx_throw_errno_prefix (error, "fchmodat");
{ glnx_autofd int target_rootfs_dfd = -1;
if (!glnx_opendirat (self->workdir_dfd, final_rootfs_name, TRUE,
&target_rootfs_dfd, error))
?
`umask` is one of those really evil Unix things...it's pretty crazy actually there's still no threadsafe way to "`mkdir` ignoring umask". This surfaced in someone using coreos-assembler with a working directory of mode `0750` and having that surface in the target rootfs. Ref: coreos/fedora-coreos-tracker#272
Right, the final ostree looks like this: d00750 0 0 0 / Thanks for all the assistance and the quick response @jlebon @cgwalters ! :) |
fff0ab7
to
5e6edd5
Compare
I did a different fix because there's similar code in the rojig path. I probably should have noted that I didn't try reproducing the failure, but I am doing so now. |
s/dfd, toplevel_dirs[i]/self->workdir_dfd, final_rootfs_name/ |
`umask` is one of those really evil Unix things...it's pretty crazy actually there's still no threadsafe way to "`mkdir` ignoring umask". This surfaced in someone using coreos-assembler with a working directory of mode `0750` and having that surface in the target rootfs. Ref: coreos/fedora-coreos-tracker#272 Closes: #1902 Approved by: jlebon
💔 Test failed - status-atomicjenkins |
@rh-atomic-bot retry |
☀️ Test successful - status-atomicjenkins |
umask
is one of those really evil Unix things...it's prettycrazy actually there's still no threadsafe way to "
mkdir
ignoring umask".This surfaced in someone using coreos-assembler with a working
directory of mode
0750
and having that surface in the targetrootfs.
Ref: coreos/fedora-coreos-tracker#272