freebsd-dev/lib
Renato Botelho d32a66b2a2 When passwd or group information is changed (by pw, vipw, chpass, ...)
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
2015-07-02 17:30:59 +00:00
..
atf Add META_MODE support. 2015-06-13 19:20:56 +00:00
clang new depends 2015-06-16 23:37:19 +00:00
csu Force the dynamic linker to resolve _end early so we pick up the correct 2015-07-02 15:02:59 +00:00
libalias Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libarchive Add META_MODE support. 2015-06-13 19:20:56 +00:00
libauditd Add META_MODE support. 2015-06-13 19:20:56 +00:00
libbegemot new depends 2015-06-16 23:37:19 +00:00
libblocksruntime Add META_MODE support. 2015-06-13 19:20:56 +00:00
libbluetooth Add META_MODE support. 2015-06-13 19:20:56 +00:00
libbsdstat
libbsm Add META_MODE support. 2015-06-13 19:20:56 +00:00
libbsnmp Add META_MODE support. 2015-06-13 19:20:56 +00:00
libbz2 Add META_MODE support. 2015-06-13 19:20:56 +00:00
libc Cleanup brk and sbrk to use the same code to find curbrk and minbrk when 2015-07-02 14:54:21 +00:00
libc_nonshared Add META_MODE support. 2015-06-13 19:20:56 +00:00
libc++ Add META_MODE support. 2015-06-13 19:20:56 +00:00
libcalendar Add META_MODE support. 2015-06-13 19:20:56 +00:00
libcam Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libcapsicum Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libcasper Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libclang_rt Upgrade our copy of clang and llvm to 3.6.1 release. 2015-05-25 13:43:03 +00:00
libcom_err new depends 2015-06-16 23:37:19 +00:00
libcompat Add META_MODE support. 2015-06-13 19:20:56 +00:00
libcompiler_rt Add META_MODE support. 2015-06-13 19:20:56 +00:00
libcrypt new depends 2015-06-16 23:37:19 +00:00
libcuse Add META_MODE support. 2015-06-13 19:20:56 +00:00
libcxxrt Add __cxa_deleted_virtual to libcxxrt's version map. 2015-06-23 17:54:24 +00:00
libdevctl Add a new device control utility for new-bus devices called devctl. This 2015-02-06 16:09:01 +00:00
libdevinfo Add META_MODE support. 2015-06-13 19:20:56 +00:00
libdevstat Add META_MODE support. 2015-06-13 19:20:56 +00:00
libdpv Add META_MODE support. 2015-06-13 19:20:56 +00:00
libdwarf new depends 2015-06-16 23:37:19 +00:00
libedit Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libefi
libelf Add META_MODE support. 2015-06-13 19:20:56 +00:00
libelftc Pay attention to MK_ELFTOOLCHAIN_TOOLS so we build the desired tools. 2015-06-15 20:11:15 +00:00
libevent Add META_MODE support. 2015-06-13 19:20:56 +00:00
libexecinfo Add META_MODE support. 2015-06-13 19:20:56 +00:00
libexpat Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libfetch new depends 2015-06-16 23:37:19 +00:00
libfigpar Add META_MODE support. 2015-06-13 19:20:56 +00:00
libgeom Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libgpib Add META_MODE support. 2015-06-13 19:20:56 +00:00
libgpio Bump .Dd for the example code update. 2015-07-01 16:50:01 +00:00
libgssapi Add META_MODE support. 2015-06-13 19:20:56 +00:00
libiconv_modules Add META_MODE support. 2015-06-13 19:20:56 +00:00
libipsec new depends 2015-06-16 23:37:19 +00:00
libjail Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libkiconv Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libkvm Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libldns new depends 2015-06-16 23:37:19 +00:00
liblzma new depends 2015-06-16 23:37:19 +00:00
libmagic new depends 2015-06-16 23:37:19 +00:00
libmd new depends 2015-06-16 23:37:19 +00:00
libmemstat Add META_MODE support. 2015-06-13 19:20:56 +00:00
libmilter Add META_MODE support. 2015-06-13 19:20:56 +00:00
libmp new depends 2015-06-16 23:37:19 +00:00
libmt Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libnandfs
libnetbsd Add META_MODE support. 2015-06-13 19:20:56 +00:00
libnetgraph Add META_MODE support. 2015-06-13 19:20:56 +00:00
libngatm Add META_MODE support. 2015-06-13 19:20:56 +00:00
libnv Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libohash Add META_MODE support. 2015-06-13 19:20:56 +00:00
libopie new depends 2015-06-16 23:37:19 +00:00
libpam new depends 2015-06-16 23:37:19 +00:00
libpcap Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libpjdlog Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libpmc Add META_MODE support. 2015-06-13 19:20:56 +00:00
libproc Make libproc compilable on AArch64. 2015-07-01 13:59:26 +00:00
libprocstat Add META_MODE support. 2015-06-13 19:20:56 +00:00
libradius new depends 2015-06-16 23:37:19 +00:00
librpcsec_gss Add META_MODE support. 2015-06-13 19:20:56 +00:00
librpcsvc Add META_MODE support. 2015-06-13 19:20:56 +00:00
librt Add META_MODE support. 2015-06-13 19:20:56 +00:00
librtld_db Add META_MODE support. 2015-06-13 19:20:56 +00:00
libsbuf new depends 2015-06-16 23:37:19 +00:00
libsdp Add META_MODE support. 2015-06-13 19:20:56 +00:00
libsm Add META_MODE support. 2015-06-13 19:20:56 +00:00
libsmb Add META_MODE support. 2015-06-13 19:20:56 +00:00
libsmdb Add META_MODE support. 2015-06-13 19:20:56 +00:00
libsmutil Add META_MODE support. 2015-06-13 19:20:56 +00:00
libsqlite3 Add META_MODE support. 2015-06-13 19:20:56 +00:00
libstand Add META_MODE support. 2015-06-13 19:20:56 +00:00
libstdbuf Add META_MODE support. 2015-06-13 19:20:56 +00:00
libstdthreads Add META_MODE support. 2015-06-13 19:20:56 +00:00
libtacplus Add META_MODE support. 2015-06-13 19:20:56 +00:00
libtelnet Add META_MODE support. 2015-06-13 19:20:56 +00:00
libthr new depends 2015-06-16 23:37:19 +00:00
libthread_db new depends 2015-06-16 23:37:19 +00:00
libucl Add META_MODE support. 2015-06-13 19:20:56 +00:00
libufs Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libugidfw Set some internal helpers as static and initialize few variables to silence 2015-06-24 01:48:44 +00:00
libulog Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
libunbound Add META_MODE support. 2015-06-13 19:20:56 +00:00
libusb Remove unused variables to silence CLANG warnings. 2015-06-24 01:34:35 +00:00
libusbhid Add META_MODE support. 2015-06-13 19:20:56 +00:00
libutil When passwd or group information is changed (by pw, vipw, chpass, ...) 2015-07-02 17:30:59 +00:00
libvgl Add META_MODE support. 2015-06-13 19:20:56 +00:00
libvmmapi Fix a regression in "movs" emulation after r284539. The regression was caused 2015-06-22 00:30:34 +00:00
libwrap Add META_MODE support. 2015-06-13 19:20:56 +00:00
libxo Revert r284417 it is not necessary anymore 2015-06-15 19:28:07 +00:00
liby Add META_MODE support. 2015-06-13 19:20:56 +00:00
libypclnt new depends 2015-06-16 23:37:19 +00:00
libz new depends 2015-06-16 23:37:19 +00:00
msun Fix compilation when the armv6 world is being compiled without hw floating 2015-06-24 18:29:34 +00:00
ncurses Install ncurses html documentation again after r284345 2015-06-22 05:41:13 +00:00
tests
Makefile First cut of DTrace for AArch64. 2015-07-01 15:51:11 +00:00
Makefile.inc