pam_unix doesn't fsync the tmp passwd file before overwriting /etc/passwd

Solar Designer solar at openwall.com
Wed Mar 18 00:40:09 UTC 2009


On Wed, Mar 18, 2009 at 01:43:58AM +0300, Solar Designer wrote:
> As to (not) introducing fsync() calls into pam_unix specifically, I
> don't have strong feelings for or against this, although it is OK to do
> in order to be extra-safe on some modern filesystems other than ext4.

Update: in a private e-mail, Ted has kindly pointed out to me that "XFS
does not have the workaround for rename(), so it would be a good thing
for pam_unix to add the fsync()."

I was not aware of this specific example.  I agree that this is a good
enough reason to add the fsync() calls in Linux-PAM.

Alexander




More information about the Pam-list mailing list