summaryrefslogtreecommitdiffstats
path: root/pw/pw.h
Commit message (Collapse)AuthorAgeFilesLines
* pw: (file == NULL) check is always false in read_userconfig(), removeYuri Pankov2018-10-161-1/+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-0/+1
| | | | | | | | | | | 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-0/+8
| | | | | | | | | | | | | 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.
* Remove usage of _WITH_GETLINE from usr.sbinBaptiste Daroussin2016-07-301-1/+0
|
* pw should sanitize the argument of -w.Alan Somers2016-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Cleanup a bit includesBaptiste Daroussin2015-08-021-13/+3
|
* Remove dead codeBaptiste Daroussin2015-08-021-11/+0
|
* Rewrite parsing subcommands arguments of pw(8)Baptiste Daroussin2015-08-021-4/+24
| | | | | | | | | | | | | 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.
* Improve strtounumBaptiste Daroussin2015-07-301-2/+2
| | | | | | | | | Fix many style bugs Better variable naming Use C99 'restrict' were apropriate Fix potential errno race Submitted by: bde
* Create a strtounum function using the same API as strtonumBaptiste Daroussin2015-07-291-0/+4
| | | | | This function returns uintmax_t Use this function to convert to gid_t/uid_t
* Separate usernext/groupnext from the main functionsBaptiste Daroussin2015-07-111-0/+2
|
* Refactor input validationBaptiste Daroussin2015-06-071-2/+2
| | | | | Mutualize code to validate inputs of both 'user' and 'group' command Test that the input name fits into MAXLOGNAME
* Add a new global struct pwconf to store etcpath, rootdir and struct userconfBaptiste Daroussin2015-06-071-26/+2
| | | | | Do not add anymore -R and -V to arglist Add an error message if both -V and -R are set in arguments
* Instead of always casting the pw_checkname input to u_char * and casting it backBaptiste Daroussin2015-06-071-1/+1
| | | | to char *, change pw_checkname to directly take char * in input
* Simplify reading pw.conf(5) by using getline(3)Baptiste Daroussin2014-04-221-0/+1
|
* Teach pw(8) about how to use pw/gr API to reduce code duplicationBaptiste Daroussin2012-10-301-0/+124
| | | | MFC after: 2 months
* Create the altix project branch. The altix project will add supportMarcel Moolenaar2010-03-101-132/+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/+1
| | | | more specific about the effect of the current umask on -M.
* The variable `arglist' has internal linkage in pw.c, don't declare it as externStefan Farfeleder2005-02-101-1/+1
| | | | here.
* Fix a harmless format string bogon and mark a function as __printflike().Kris Kennaway2001-07-051-1/+1
| | | | | | | There is still one instance of non-constant format string use inside that function, but it's hard to fix. MFC after: 1 week
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-2/+2
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-2/+2
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Add new functionality "lock" and "unlock" to provide a simple passwordDavid Nugent1999-10-261-0/+2
| | | | | | locking mechanism for users. This works by prepending the string "*LOCKED*" to the password field in master.passwd to prevent successful decoding.
* $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-1/+3
| | | | | | 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/+1
|
* 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/+6
| | | | | | NIS maps. Suggested by: Peter Wemm
* 1) 200 users per group limitation removed and pwDavid Nugent1996-12-211-3/+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.
* Allow 8-bit characters in the passwd gecos field, and adds a paragraphDavid Nugent1996-12-191-1/+2
| | | | | to the mangpage explaining the consequences (to be updated at a later date after login class conf support is added).
* 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-15/+2
| | | | | | | | 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/+142
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>