Correctly set the password file mode after renaming in NIS mode

This commit is contained in:
Baptiste Daroussin 2012-11-20 10:59:41 +00:00
parent 2d2b6ad74d
commit 7a43850530
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243330

View File

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