summaryrefslogtreecommitdiffstats
path: root/pw/pwupd.c
Commit message (Collapse)AuthorAgeFilesLines
* Recommit everything, add chpass, improve history (except for a few files ↵Cameron Katri2021-05-021-1/+1
| | | | that git-filter-repo dislikes for some reason [_secure_path.c and login_cap.h])
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended.
* 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/+2
| | | | | | MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D8245
* Cleanup a bit includesBaptiste Daroussin2015-08-021-8/+6
|
* Add a new global struct pwconf to store etcpath, rootdir and struct userconfBaptiste Daroussin2015-06-071-20/+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
|
* The pwdb function is only used once to check the database rename itBaptiste Daroussin2015-05-101-10/+4
| | | | pwdb_check and simplify it accordingly
* if the check of the pw db fails return the failed valueBaptiste Daroussin2015-05-101-37/+35
|
* Some style(9) fixesBaptiste Daroussin2015-05-101-9/+16
|
* Fix changing the usernameBaptiste Daroussin2014-06-201-1/+1
| | | | | | PR: 189172 Submitted by: fullermd@over-yonder.net MFC after: 1 week
* Removed compatibility with pre FreeBSD 2.2 pw_mkdb commandBaptiste Daroussin2014-06-201-13/+2
| | | | | | | | Fix some broken indentattion PR: 189173 Submitted by: fullermd@over-yonder.net MFC after: 1 week
* In case of the deletion of a user those whole database has to be regenerated,Baptiste Daroussin2012-12-261-1/+5
| | | | | otherwise the user planned to be deleted remain in the pwd.db while removed from the plain text password file.
* Use strdup instead of malloc + strcpyEitan Adler2012-12-051-6/+4
| | | | | | 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-74/+40
| | | | MFC after: 2 months
* Make sure that each va_start has one and only one matching va_end,Kevin Lo2012-09-281-0/+214
| | | | especially in error cases.
* Create the altix project branch. The altix project will add supportMarcel Moolenaar2010-03-101-213/+0
| | | | | | | for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting is a two-module system, consisting of a base compute module and a CPU expansion module. SGI's NUMAFlex architecture can be an excellent platform to test CPU affinity and NUMA-aware features in FreeBSD.
* Before updating the password database, the pw(8) utility first performs aJohn Baldwin2008-07-171-1/+2
| | | | | | | | sanity check by invoking "pwd_mkdb -C". However, if this failed it silently returned success. Fix this so it fails the update operation instead. MFC after: 1 week
* Don't rely on NULL being a pointer, add a cast before passing it to a variadicStefan Farfeleder2004-10-031-2/+2
| | | | function.
* Do not expose password if it is empty and PWF_STANDARD format is requestedMax Khon2003-01-231-1/+2
| | | | MFC after: 1 week
* Use correct mode for temporary file.Jacques Vidrine2001-12-201-1/+1
| | | | Reported by: ryan beasley <ryanb@goddamnbastard.org>
* Handle snprintf() returning < 0 (not just -1)Brian Somers2001-08-201-1/+1
| | | | MFC after: 2 weeks
* Handle snprintf() returning -1.Brian Somers2001-08-201-0/+2
| | | | MFC after: 2 weeks
* Don't dereference NULL in the userdel case.David Nugent2000-06-261-1/+1
|
* Second and hopefully final fix to .db sync when renaming a user; we must runDavid Nugent2000-06-181-4/+12
| | | | | | | a full reindex in this case to remove the old record. #ifdef -u capability since this is available on FreeBSD only. PR: bin/16418 Problem pointed out by: Masachika ISHIZUKA <ishizuka@ish.org>
* Fix db syncronization when username is changed with -l under usermod.David Nugent2000-06-061-1/+1
| | | | | | | | pw(8) was calling pwd_mkdb -u oldusername instead of newusername, so the update appears to have failed until the next full pwd_mkdb syncronization. PR: bin/16418
* Missed statement in password update relating to the previous changeDavid Nugent1999-10-261-1/+1
| | | | to fileupdate() which prevented pwd_mkdb(1) from being run.
* Clean up error handling in fileupdate(), which now returns 0 on successDavid Nugent1999-10-261-7/+10
| | | | | | | | | | | | 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]
* Only do a full pwd_mkdb for deletions; other operations may use the -uSheldon Hearn1999-08-301-2/+6
| | | | | | | option as an optimization. PR: 13346 Submitted by: Neil Blakey-Milner <nbm@rucus.ru.ac.za>
* $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-7/+38
| | | | | | updating 2) Add -V <etcdir>, which allows maintaining user/group database in alternate locations other than /etc.
* pwd_mkdb option '-c' was renamed to -C some weeks ago.Wolfram Schneider1998-02-111-4/+4
| | | | | PR: bin/5715 Submitted by: dannyman <dannyman@arh0300.urh.uiuc.edu>
* Use err(3) instead of local redefinition. Add rcsid string.Philippe Charnier1997-10-101-2/+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.
* Remove duplicated #include.David Nugent1997-01-051-2/+1
|
* 1) 200 users per group limitation removed and pwDavid Nugent1996-12-211-2/+2
| | | | | | | 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
* Upgrade from the author, reflecting all my wishes resulting out of theJoerg Wunsch1996-12-091-0/+7
| | | | | | | | sysinstall use of this tool (plus some bug fixes). 2.2 candidate... Submitted by: David Nugent <davidn@nserver.usn.blaze.net.au>
* pw(8) -- a backend utility to manage the user and group databases.Joerg Wunsch1996-12-091-0/+160
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>