Skip to content

Commit 532724d

Browse files
committed
grubconfig: set /boot/grub2/grub.cfg file mode to 0600
Copy Colin's comment: ``` One overall issue on this is because we don't have a mechanism to update the static configs, existing systems will stay as is. ``` See #952 & https://redhat-internal.slack.com/archives/C01BSEK9PM1/p1750152540290679
1 parent 766bb80 commit 532724d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/grubconfigs.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const DROPINDIR: &str = "configs.d";
1717
const GRUBENV: &str = "grubenv";
1818
pub(crate) const GRUBCONFIG: &str = "grub.cfg";
1919
pub(crate) const GRUBCONFIG_BACKUP: &str = "grub.cfg.backup";
20+
// File mode for /boot/grub2/grub.config
21+
// https://github.com/coreos/bootupd/issues/952
22+
const GRUBCONFIG_FILE_MODE: u32 = 0o600;
2023

2124
/// Install the static GRUB config files.
2225
#[context("Installing static GRUB configs")]
@@ -67,7 +70,7 @@ pub(crate) fn install(
6770

6871
let grub2dir = bootdir.sub_dir(GRUB2DIR)?;
6972
grub2dir
70-
.write_file_contents("grub.cfg", 0o644, config.as_bytes())
73+
.write_file_contents("grub.cfg", GRUBCONFIG_FILE_MODE, config.as_bytes())
7174
.context("Copying grub-static.cfg")?;
7275
println!("Installed: grub.cfg");
7376

0 commit comments

Comments
 (0)