summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-07-23 14:24:38 +0200
committerLennart Poettering <lennart@poettering.net>2020-07-23 17:09:11 +0200
commitb226422cd76acb886017d1a84ded990efc192f85 (patch)
tree27afbd505b6909ac3105bf78a3d96103f71c5ea8
parent2a2e78e969d9549502066af90217104461d908e6 (diff)
downloadsystemd-b226422cd76acb886017d1a84ded990efc192f85.tar.gz
firstboot: don't create /etc/passwd with mode 000
It needs to be world readable (unlike /etc/shadow) when created anew. This fixes systems that boot with "systemd-nspawn --volatile=yes", i.e. come up with an entirely empty /etc/ and thus no existing /etc/passwd file when firstboot runs.
-rw-r--r--src/firstboot/firstboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index 82cd4040f9..807a4f5729 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -685,7 +685,7 @@ static int write_root_passwd(const char *passwd_path, const char *password, cons
if (errno != ENOENT)
return -errno;
- r = fchmod(fileno(passwd), 0000);
+ r = fchmod(fileno(passwd), 0644);
if (r < 0)
return -errno;