Correctly set the password file mode after renaming in NIS mode

This commit is contained in:
bapt 2012-11-20 10:59:41 +00:00
parent 9acb3e40c2
commit 7df2814837

View File

@ -68,6 +68,8 @@ pw_nisupdate(const char * path, struct passwd * pwd, char const * user)
} }
if (rename(pw_tempname(), path) == -1) if (rename(pw_tempname(), path) == -1)
err(1, "rename()"); err(1, "rename()");
if (chmod(path, 0644) == -1)
err(1, "chmod()");
free(pw); free(pw);
pw_fini(); pw_fini();