/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
* Copyright (C) 1996
* David L. Nugent. All rights reserved.
*
#include <err.h>
#include <pwd.h>
#include <libutil.h>
+#include <unistd.h>
#include "pw.h"
}
if (pw_copy(pfd, tfd, pw, old_pw) == -1) {
pw_fini();
+ close(tfd);
err(1, "pw_copy()");
}
+ fsync(tfd);
+ close(tfd);
if (chmod(pw_tempname(), 0644) == -1)
err(1, "chmod()");
if (rename(pw_tempname(), path) == -1)