Skip to content

Commit cc99b4e

Browse files
Johan-Liebert1cgwalters
authored andcommitted
composefs/usroverlay: Get mode from underlying /usr
We'd want to do this as the permissions for /usr might be different on different distros Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent ebe7f63 commit cc99b4e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/lib/src/bootc_composefs/state.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,11 @@ pub(crate) fn composefs_usr_overlay() -> Result<()> {
246246
return Ok(());
247247
}
248248

249-
overlay_transient(usr, Some(0o755.into()))?;
249+
// Get the mode from the underlying /usr directory
250+
let usr_metadata = usr.metadata(".").context("Getting /usr metadata")?;
251+
let usr_mode = Mode::from_raw_mode(usr_metadata.permissions().mode());
252+
253+
overlay_transient(usr, Some(usr_mode))?;
250254

251255
println!("A writeable overlayfs is now mounted on /usr");
252256
println!("All changes there will be discarded on reboot.");

0 commit comments

Comments
 (0)