From: Lennart Poettering Date: Thu, 23 Jul 2020 12:24:38 +0000 (+0200) Subject: firstboot: don't create /etc/passwd with mode 000 X-Git-Tag: v246-rc2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b226422cd76acb886017d1a84ded990efc192f85;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 82cd4040f9c..807a4f57291 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;