summaryrefslogtreecommitdiffstats
path: root/pw/grupd.c
Commit message (Collapse)AuthorAgeFilesLines
* Speed up pw operations that edit /etc/group or /etc/passwdAlan Somers2016-11-181-0/+1
| | | | | | | | | | | | | | r285050 fixed a bug in pw that could lead to /etc/passwd or /etc/group corruption on power loss. However, it fixed it by opening those files with O_SYNC, which is very slow, especially on ZFS. This change replaces O_SYNC with appropriately placed fsync()s instead, which is much faster. Using a ZFS tmpdir, the time to run pw's kyua tests drops from 245s to 35s. Reviewed by: allanjude, bapt, vangyzen, garga Tested on pfSense by: garga MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8319
* Close some file descriptor leaks in pwAlan Somers2016-10-211-0/+3
| | | | | | MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8245
* Cleanup a bit includesBaptiste Daroussin2015-08-021-3/+1
|
* Add a new global struct pwconf to store etcpath, rootdir and struct userconfBaptiste Daroussin2015-06-071-18/+4
| | | | | Do not add anymore -R and -V to arglist Add an error message if both -V and -R are set in arguments
* Remove uneeded intermediate variableBaptiste Daroussin2015-05-311-4/+1
|
* Remove some uneeded headersBaptiste Daroussin2015-05-091-4/+0
|
* Simplify string duplication: use strdup instead of malloc + strcpyEitan Adler2012-12-051-6/+5
| | | | | | Submitted by: db Approved by: cperciva MFC after: 2 weeks
* Teach pw(8) about how to use pw/gr API to reduce code duplicationBaptiste Daroussin2012-10-301-81/+39
| | | | MFC after: 2 months
* Unbreak group operations by reverting previous delta which removed theDima Dorfman2001-08-301-1/+1
| | | | | | | | assignment of `l' in `gr_update' to the return value of snprintf. It claimed to have fixed the case where snprintf returned -1--in fact, it broke the entire routine. Not setting `l' here causes fileupdate() to invariably fail with EINVAL because it does its own check to assert that the parameter isn't -1.
* Handle snprintf() returning -1.Brian Somers2001-08-201-1/+1
| | | | MFC after: 2 weeks
* Clean up error handling in fileupdate(), which now returns 0 on successDavid Nugent1999-10-261-2/+3
| | | | | | | | | | | | instead of a boolean. This replicated through he front-end sub-functions relating to add, delete, modify entries in passwd & group files Errno is now preserved so output of errc()/warnc() will be less obfuscated by subsequent errors when reporting the problem. Add more intelligent error handling when attempting to modify/delete NIS entries with no corresponding local database entry. [MFC to stable in a couple of weeks to keep both in sync]
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
|
* 1) Do not blindly ignore file update errors which may occur due to concurrentDavid Nugent1999-02-231-4/+43
| | | | | | updating 2) Add -V <etcdir>, which allows maintaining user/group database in alternate locations other than /etc.
* Use err(3) instead of local redefinition. Add rcsid string.Philippe Charnier1997-10-101-3/+5
|
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* 1) 200 users per group limitation removed and pwDavid Nugent1996-12-211-21/+45
| | | | | | | will handle lines of any length in /etc/group. 2) Fixed bug with usermod -d not updating user's home directory. 3) Minor formatting display changes/fixes with *show -P.
* Copyright update by the author, to be more in line with our sampleJoerg Wunsch1996-12-101-12/+6
| | | | | | copyright. Submitted by: David Nugent
* pw(8) -- a backend utility to manage the user and group databases.Joerg Wunsch1996-12-091-0/+111
sysinstall's new User&group menu will use it, hence it's a 2.2 candidate despite of providing new functionality. Submitted by: David L. Nugent, <davidn@blaze.net.au>