Commit Graph

14 Commits

Author SHA1 Message Date
Renato Botelho
4cf57592f7 Bump .Dd due to changes made in r285050 and r285053
Spotted by:	loos
Approved by:	loos
2015-07-02 19:41:08 +00:00
Renato Botelho
6c5f7b239f Improve pw_lock.3 text changed in r285050
Suggested by:	wblock
Approved by:	gnn
2015-07-02 18:27:18 +00:00
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
Baptiste Daroussin
c24c3080ea revert r283969,283970 not needed anymore after r283981 2015-06-04 08:00:11 +00:00
Baptiste Daroussin
86fa42a24a Capitalize the list of accepted variables
Suggested by:	wblock
2015-06-03 22:01:13 +00:00
Baptiste Daroussin
972cf03ed9 Add a pw_mkdb2(3) function which does the same thing as pw_mkdb(3) except
it takes a new argument allowing to specify the endianness of the database
to generate

Differential Revision:	https://reviews.freebsd.org/D2730
Reviewed by:	ian
2015-06-03 20:48:28 +00:00
Baptiste Daroussin
e2835957c4 Fix typo 2015-06-03 19:22:16 +00:00
Baptiste Daroussin
2b7af31cf5 use .Mt to mark up email addresses consistently (part3)
PR:		191174
Submitted by:	Franco Fichtner  <franco at lastsummer.de>
2014-06-23 08:23:05 +00:00
Eitan Adler
1748334408 libutil/pw_util.3: Fix two prototypes.
Reported by:	marino
Obtained from:	DragonFlyBSD (e82b5d3dfa969bfcda5ffadceccc682b6bdcd077)
MFC After:	3 days
2014-02-13 05:13:22 +00:00
Baptiste Daroussin
46f8c63df6 Fix typo 2012-11-03 00:30:22 +00:00
Dag-Erling Smørgrav
192bc3edf4 Correct attribution. 2012-10-31 15:04:27 +00:00
Joel Dahl
2acb4741ca Minor mdoc and language fixes. 2012-10-30 22:30:30 +00:00
Baptiste Daroussin
f5a05b2ba4 Removed unnecessary bits in the header that shows where I stole the template 2012-10-30 22:26:19 +00:00
Baptiste Daroussin
42818163b4 Document the pw_util(3) functions
Reviewed by:	des, gjb
2012-10-30 22:18:08 +00:00