chiark / gitweb /
core: Refuse mount on symlink
[elogind.git] / src / core / machine-id-setup.c
index e2e6d0226995f88b1714a32c4132629bced42dd8..712f60cb11c6ab0661a97a8f1ba8578dfde69567 100644 (file)
@@ -27,7 +27,7 @@
 #include <fcntl.h>
 #include <sys/mount.h>
 
-#include <systemd/sd-id128.h>
+#include "systemd/sd-id128.h"
 
 #include "machine-id-setup.h"
 #include "macro.h"
@@ -181,6 +181,7 @@ int machine_id_setup(const char *root) {
                  * will be owned by root it doesn't matter much, but maybe
                  * people look. */
 
+                mkdir_parents(etc_machine_id, 0755);
                 fd = open(etc_machine_id, O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY, 0444);
                 if (fd >= 0)
                         writable = true;