chiark / gitweb /
umask: change default umask to 0022 just to be sure, and set it explicitly in all...
[elogind.git] / src / machine-id-setup.c
index be51d0dec73c2ba3697803480cac37a83e129c17..519521fe6768f9de96fffb8bc44fc314a54991f7 100644 (file)
@@ -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));