Author: bapt
Date: Tue Nov 20 14:05:46 2012
New Revision: 243335
URL: http://svnweb.freebsd.org/changeset/base/243335

Log:
  In NIS mode first chmod(2) the temporary file  and is succeed then rename(2)

Modified:
  head/usr.sbin/pw/pw_nis.c

Modified: head/usr.sbin/pw/pw_nis.c
==============================================================================
--- head/usr.sbin/pw/pw_nis.c   Tue Nov 20 14:03:09 2012        (r243334)
+++ head/usr.sbin/pw/pw_nis.c   Tue Nov 20 14:05:46 2012        (r243335)
@@ -66,10 +66,10 @@ pw_nisupdate(const char * path, struct p
                pw_fini();
                err(1, "pw_copy()");
        }
+       if (chmod(pw_tempname(), 0644) == -1)
+               err(1, "chmod()");
        if (rename(pw_tempname(), path) == -1)
                err(1, "rename()");
-       if (chmod(path, 0644) == -1)
-               err(1, "chmod()");
 
        free(pw);
        pw_fini();
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to