sysusers: add fsync for passwd (#24324)
authorAvram Lubkin <avylove@rockhopper.net>
Tue, 16 Aug 2022 12:51:21 +0000 (08:51 -0400)
committerGitHub <noreply@github.com>
Tue, 16 Aug 2022 12:51:21 +0000 (21:51 +0900)
commit19193b489841a7bcccda7122ac0849cf6efe59fd
tree2b2f522c9e4f677bf8b88b951615542be8b3f9c5
parent73096907881fcdaba27c128d46a55e6b9ce3cc5e
sysusers: add fsync for passwd (#24324)

https://github.com/systemd/systemd/pull/6636 added `fsync()` when
temporary shadow, group, and gshadow files are created, but it was
not added for passwd. As far as I can tell, this seems to have been
an oversight. I'm seeing real world issues where a blank /etc/passwd
file is being created if a machine loses power early in the boot process.
src/sysusers/sysusers.c