summaryrefslogtreecommitdiff
path: root/src/firstboot
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-24 18:43:56 +0200
committerLennart Poettering <lennart@poettering.net>2019-05-08 06:36:20 -0400
commite82e549fb2cd97966bd3a5d38dfab15e3d9cd7b6 (patch)
tree88197e8586bedd3d4f69eef35f3a9eaf555c141d /src/firstboot
parent22e596d6d5fa80fb33ab84451db8962e2facb17a (diff)
downloadsystemd-e82e549fb2cd97966bd3a5d38dfab15e3d9cd7b6.tar.gz
tree-wide: make use of the new WRITE_STRING_FILE_MKDIR_0755 flag
Diffstat (limited to 'src/firstboot')
-rw-r--r--src/firstboot/firstboot.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index d8d17cb5bd..ae2b1fd7fc 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -490,9 +490,8 @@ static int process_hostname(void) {
if (isempty(arg_hostname))
return 0;
- mkdir_parents(etc_hostname, 0755);
r = write_string_file(etc_hostname, arg_hostname,
- WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC);
+ WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC | WRITE_STRING_FILE_MKDIR_0755);
if (r < 0)
return log_error_errno(r, "Failed to write %s: %m", etc_hostname);
@@ -512,9 +511,8 @@ static int process_machine_id(void) {
if (sd_id128_is_null(arg_machine_id))
return 0;
- mkdir_parents(etc_machine_id, 0755);
r = write_string_file(etc_machine_id, sd_id128_to_string(arg_machine_id, id),
- WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC);
+ WRITE_STRING_FILE_CREATE | WRITE_STRING_FILE_SYNC | WRITE_STRING_FILE_MKDIR_0755);
if (r < 0)
return log_error_errno(r, "Failed to write machine id: %m");