]> git.cameronkatri.com Git - pw-darwin.git/blobdiff - pw/pwupd.c
Remove a death threat from the FreeBSD sources
[pw-darwin.git] / pw / pwupd.c
index ee23952e090f6f8f1d962e305fe39ad70522ce21..87c3c994bada86698e0fd233f964143866ca99a4 100644 (file)
@@ -111,8 +111,11 @@ pw_update(struct passwd * pwd, char const * user)
        }
        if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
                pw_fini();
+               close(tfd);
                err(1, "pw_copy()");
        }
+       fsync(tfd);
+       close(tfd);
        /*
         * in case of deletion of a user, the whole database
         * needs to be regenerated