summaryrefslogtreecommitdiff
path: root/src/machine-id-setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine-id-setup.c')
-rw-r--r--src/machine-id-setup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/machine-id-setup.c b/src/machine-id-setup.c
index be51d0dec7..519521fe67 100644
--- a/src/machine-id-setup.c
+++ b/src/machine-id-setup.c
@@ -167,7 +167,10 @@ int machine_id_setup(void) {
mkdir_p("/run/systemd", 0755);
+ m = umask(0022);
r = write_one_line_file("/run/systemd/machine-id", id);
+ umask(m);
+
if (r < 0) {
log_error("Cannot write /run/systemd/machine-id: %s", strerror(-r));