summaryrefslogtreecommitdiffstats
path: root/pw/pw_conf.c
Commit message (Collapse)AuthorAgeFilesLines
* Recommit everything, add chpass, improve history (except for a few files ↵Cameron Katri2021-05-021-2/+2
| | | | that git-filter-repo dislikes for some reason [_secure_path.c and login_cap.h])
* pw(8): use openmemstream instead of sbuf(9)Baptiste Daroussin2021-04-271-40/+46
|
* pw: fix the checks in boolean_str() after r326738. Add related testYuri Pankov2018-10-211-5/+7
| | | | | | | | | cases for `pw useradd -D -w`. PR: 231649 Reviewed by: eugen Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D17299
* pw: (file == NULL) check is always false in read_userconfig(), removeYuri Pankov2018-10-161-3/+0
| | | | | | | | | | | it. Drop the now unused _PATH_PW_CONF definition. [1] While here, change the last remaining hardcoded "/etc" to _PATH_PWD. Noted by: glebius [1] Reviewed by: eugen Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17575
* pw: respect path specified using -V when writing pw.conf, and -C is notYuri Pankov2018-10-151-2/+6
| | | | | | | | | | | explicitly specified. -V path is already used to determine which file to read default values from, so it's only logical to write them to the same file. PR: 231653 Reviewed by: eugen, bapt Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17566
* pw(8): correct expiration period handling and command line overridesEugene Grosbein2017-12-091-4/+4
| | | | | | | | | | | | | to preconfigured values for -e, -p and -w flags. Use non-negative symbols instead of magic values in passwd_val/pw_password functions. PR: 223431 Submitted by: Yuri Pankov (in part, patch for the manual) Reported by: mav (mentor) MFC after: 3 days Relnotes: yes
* 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.
* pw should sanitize the argument of -w.Alan Somers2016-07-131-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise, it will silently disable the login for the selected account if the argument is unrecognizable. usr.sbin/pw/pw.h usr.sbin/pw/pw_conf.c usr.sbin/pw/pw_user.c Use separate rules to validate boolean parameters and passwd parameters. Error out if a password parameter cannot be parsed. usr.sbin/pw/tests/Makefile usr.sbin/pw/tests/crypt.c usr.sbin/pw/tests/pw_useradd.sh usr.sbin/pw/tests/pw_usermod.sh Add tests for the validation. Also, enhance existing password-related tests to actually validate that the correct hash is written to master.passwd. Reviewed by: bapt MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6840
* Simplify code for parsing extra groupsBaptiste Daroussin2015-12-291-1/+1
|
* Use intmax_t rather than long longBaptiste Daroussin2015-08-021-2/+2
|
* Fix build on 32bitsBaptiste Daroussin2015-08-021-2/+2
|
* Cleanup a bit includesBaptiste Daroussin2015-08-021-4/+4
|
* Rewrite parsing subcommands arguments of pw(8)Baptiste Daroussin2015-08-021-31/+30
| | | | | | | | | | | | | Now each subcommands checks its arguments in a dedicated functions. This helps improving input validation, code readability/maintainability While here: - Add a -y option to pw userdel/usermod so it can maintain NIS servers if nispasswd is not defined in pw.conf(5) - Allow pw -r <rootdir> to remove directory with userdel -r - Fix bug when renaming a user which was not renaming the user name it groups it is a member of. - Only parse pw.conf(5) when needed.
* Remove things that crept in after badly checked revertBaptiste Daroussin2015-08-011-2/+0
|
* Partial revert of r286152Baptiste Daroussin2015-08-011-0/+2
| | | | More work needed on the cli validation
* Fix buildBaptiste Daroussin2015-08-011-0/+1
|
* Fix formatting of new codeBaptiste Daroussin2015-08-011-20/+26
| | | | | | | Fix sorting or errstr Remove useless initialisation or errstr Reported by: bde
* Validate expiration days and password days from commmand line and pw.confBaptiste Daroussin2015-08-011-4/+12
|
* Validate the max_uid/max_gid boundaries and entry type in pw.confBaptiste Daroussin2015-08-011-7/+23
|
* Cast uid/git to uintmax_t when using printf-like functions so the size ofBaptiste Daroussin2015-08-011-4/+5
| | | | uid/gid size remains a implementation detail
* Replace custom string array with stringlist(3)Baptiste Daroussin2015-07-111-15/+8
|
* Remove useless cast in printf and printf-like functions:Baptiste Daroussin2015-05-311-4/+4
| | | | use %u for uid_t and gid_t
* Move cleanup functions to the right placeBaptiste Daroussin2015-05-311-2/+3
|
* Remove useless test before free()Baptiste Daroussin2015-05-311-2/+1
|
* Return early in case we cannot read the configuration fileBaptiste Daroussin2015-05-311-110/+111
| | | | This drops one level of indentation
* Use calloc(3) instead of malloc(3) + memset(3)Baptiste Daroussin2015-05-101-2/+4
| | | | While here check the return of calloc(3)
* The initial logic for allocating the new string was wrong, the conversionBaptiste Daroussin2015-05-101-5/+2
| | | | | to strndup(3) duplicated the same mistake, actually strdup(3) is good enough to allocate the new string.
* Use strndup(3) instead of malloc(3) + memcpy(3)Baptiste Daroussin2015-05-101-7/+11
| | | | Check the return of strndup
* Remove useless call to extendarrayBaptiste Daroussin2015-05-101-1/+0
|
* Remove now unused LNBUFSZ buffer sizeBaptiste Daroussin2015-05-091-3/+0
|
* Return from the function as early as possibleBaptiste Daroussin2015-05-091-117/+116
| | | | This reduces the depth of the if statements and improves clarity of the code
* Use sbuf(9) instead of homebrewed buffered stringBaptiste Daroussin2015-05-091-48/+46
|
* Simplify reading pw.conf(5) by using getline(3)Baptiste Daroussin2014-04-221-0/+503
|
* Create the altix project branch. The altix project will add supportMarcel Moolenaar2010-03-101-516/+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.
* Add home directory creation mode to pw.conf(5) and be a bitLukas Ertl2007-03-301-0/+15
| | | | more specific about the effect of the current umask on -M.
* Handle snprintf() returning < 0 (not just -1)Brian Somers2001-08-201-2/+2
| | | | MFC after: 2 weeks
* Handle snprintf() returning -1.Brian Somers2001-08-201-0/+4
| | | | MFC after: 2 weeks
* Make the comment generated in /etc/pw.conf match realityDoug Barton2000-12-181-1/+1
| | | | | PR: misc/23451 Submitted by: Ben Rosengart, ben@narcissus.net
* Catch up to the fact that we now have tcsh in the tree.David Nugent2000-07-161-1/+2
|
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
|
* Remove some more warnings.David Nugent1999-07-281-2/+3
|
* 1) Do not blindly ignore file update errors which may occur due to concurrentDavid Nugent1999-02-231-3/+2
| | | | | | 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-2/+5
|
* Unquote default group in pw.conf.David Nugent1997-09-011-1/+2
| | | | | PR: 4365 Submitted by: "Andrew L. Moore" <alm@mclink.com>
* 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.
* Adds optional NIS passwd file updating and optionally rebuildingDavid Nugent1997-01-051-1/+13
| | | | | | NIS maps. Suggested by: Peter Wemm
* 1) 200 users per group limitation removed and pwDavid Nugent1996-12-211-114/+142
| | | | | | | 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/+458
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>