summaryrefslogtreecommitdiff
path: root/src/machine-id-setup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-08-01 20:52:18 +0200
committerLennart Poettering <lennart@poettering.net>2011-08-01 20:52:18 +0200
commit4c12626c8e3491570b395d68380543e10c98ad33 (patch)
tree6cc39f5ee23aa41accc1baffb7db5a7444859fce /src/machine-id-setup.c
parent07f8a4aa49a84ec61513788d5ddf521f3de5a0ba (diff)
umask: change default umask to 0022 just to be sure, and set it explicitly in all binaries, in order to make sure it is set when started from the terminal
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));