43727d164b
temporary file is created and then a rename() call move it to official file. This operation didn't have any check to make sure data was written to disk and if a power cycle happens system could end up with a 0 length passwd or group database. There is a pfSense bug with more infor about it: https://redmine.pfsense.org/issues/4523 The following changes were made to protect passwd and group operations: * lib/libutil/gr_util.c: - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file - After rename(), fsync() call on directory for faster result * lib/libutil/pw_util.c - Replace mkstemp() by mkostemp() with O_SYNC flag to create temp file * usr.sbin/pwd_mkdb/pwd_mkdb.c - Added O_SYNC flag on dbopen() calls - After rename(), fsync() call on directory for faster result * lib/libutil/pw_util.3 - pw_lock() returns a file descriptor to master password file on success Differential Revision: https://reviews.freebsd.org/D2978 Approved by: bapt Sponsored by: Netgate |
||
---|---|---|
.. | ||
tests | ||
_secure_path.3 | ||
_secure_path.c | ||
auth.c | ||
expand_number.3 | ||
expand_number.c | ||
flopen.3 | ||
flopen.c | ||
fparseln.3 | ||
fparseln.c | ||
gr_util.c | ||
hexdump.3 | ||
hexdump.c | ||
humanize_number.3 | ||
humanize_number.c | ||
kinfo_getallproc.3 | ||
kinfo_getallproc.c | ||
kinfo_getfile.3 | ||
kinfo_getfile.c | ||
kinfo_getproc.3 | ||
kinfo_getproc.c | ||
kinfo_getvmmap.3 | ||
kinfo_getvmmap.c | ||
kinfo_getvmobject.3 | ||
kinfo_getvmobject.c | ||
kld.3 | ||
kld.c | ||
libutil.h | ||
login_auth.3 | ||
login_auth.c | ||
login_cap.3 | ||
login_cap.c | ||
login_cap.h | ||
login_class.3 | ||
login_class.c | ||
login_crypt.c | ||
login_ok.3 | ||
login_ok.c | ||
login_times.3 | ||
login_times.c | ||
login_tty.3 | ||
login_tty.c | ||
login.conf.5 | ||
Makefile | ||
Makefile.depend | ||
pidfile.3 | ||
pidfile.c | ||
property.3 | ||
property.c | ||
pty.3 | ||
pty.c | ||
pw_util.3 | ||
pw_util.c | ||
quotafile.3 | ||
quotafile.c | ||
realhostname_sa.3 | ||
realhostname.3 | ||
realhostname.c | ||
stub.c | ||
trimdomain.3 | ||
trimdomain.c | ||
uucplock.3 | ||
uucplock.c |