Skip to content

Conversation

@Johan-Liebert1
Copy link
Collaborator

The upper,work directories being created for /usr transient mount always had the mode 0o700 hence only being accessible to root

Update bootc_initramfs_setup::ensure_dir to accept an optional mode argument

Fixes: #1833

@bootc-bot bootc-bot bot requested a review from ckyrouac December 8, 2025 09:16
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses the issue of incorrect directory permissions for /usr transient mounts by introducing an optional mode argument to ensure_dir and propagating it up to overlay_transient. The fix in composefs_usr_overlay to use 0o755 permissions is appropriate.

The changes are well-implemented. However, the signature change to the public function bootc_initramfs_setup::overlay_transient is a breaking API change. While all internal call sites have been updated, this could impact external consumers of the crate. It would be good to acknowledge this in the PR description or consider if a non-breaking alternative is feasible (e.g., adding a new function with the new signature).

I've also added a few suggestions to replace magic numbers with named constants to improve code readability and maintainability.

Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as is, but two followups possible

}

overlay_transient(usr)?;
overlay_transient(usr, Some(0o755))?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not hardcode the mode here - while it's unlikely to change, if someone wants to make it (or more likely all of /usr including subdirs) group writable (775), or alternatively not user writable (555) that'd be up to the distro/OS.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if someone wants to make it (or more likely all of /usr including subdirs) group writable (775), or alternatively not user writable (555)

How would we want to do this? Would we take mode as an optional cli opt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah I was unclear. I'm just saying we should inherit the mode of the underlying directory - seems that simple to me

@cgwalters cgwalters enabled auto-merge (rebase) December 8, 2025 13:50
The upper,work directories being created for `/usr` transient mount
always had the mode `0o700` hence only being accessible to root

Update `bootc_initramfs_setup::ensure_dir` to accept an optional
`mode` argument

Fixes: bootc-dev#1833

Signed-off-by: Pragyan Poudyal <[email protected]>
@cgwalters cgwalters merged commit f846a95 into bootc-dev:main Dec 9, 2025
61 of 65 checks passed
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 this pull request may close these issues.

bootc usr-overlay mounts with improper permissions on composefs backend

2 participants