History log of /freebsd-current/usr.sbin/pw/pw.h
Revision Date Author Comments
# c8611932 06-May-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

pw: Don't silently ignore unparsed command line arguments.

MFC after: 3 days
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D45097


# a9ea647c 06-May-2024 Dag-Erling Smørgrav <des@FreeBSD.org>

pw: Rename some enums.

Rename `M_PRINT` and `M_UPDATE` to `M_SHOW` and `M_MODIFY` to match the
names of the commands they represent. No functional change intended.

MFC after: 3 days
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D45096


# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 17839f45 19-Jul-2023 Naman Sood <mail@nsood.in>

pw: Ensure group membership is not duplicated

Fix the following problem:

1. A nonexistent user, someuser, is added to somegroup in /etc/group.
2. someuser is then created with membership in somegroup.

The entry for somegroup in /etc/group will then contain

somegroup:*:12345:someuser,someuser

With this fix, the entry will be

somegroup:*:12345:someuser

PR: 238995
Reviewed by: bapt, jrm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41076


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# 4835c3b1 16-Oct-2018 Yuri Pankov <yuripv@FreeBSD.org>

pw: (file == NULL) check is always false in read_userconfig(), remove
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


# 03da20c5 15-Oct-2018 Yuri Pankov <yuripv@FreeBSD.org>

pw: respect path specified using -V when writing pw.conf, and -C is not
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


# d30f122f 09-Dec-2017 Eugene Grosbein <eugen@FreeBSD.org>

pw(8): correct expiration period handling and command line overrides
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


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

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.


# 7556d9b0 29-Jul-2016 Baptiste Daroussin <bapt@FreeBSD.org>

Remove usage of _WITH_GETLINE from usr.sbin


# 7c46e6ef 13-Jul-2016 Alan Somers <asomers@FreeBSD.org>

pw should sanitize the argument of -w.

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


# bcbdb01e 02-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Cleanup a bit includes


# db533440 01-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove dead code


# d2d022b9 01-Aug-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Rewrite parsing subcommands arguments of pw(8)

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.


# a86e343d 30-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Improve strtounum

Fix many style bugs
Better variable naming
Use C99 'restrict' were apropriate
Fix potential errno race

Submitted by: bde


# 8411215a 29-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Create a strtounum function using the same API as strtonum

This function returns uintmax_t
Use this function to convert to gid_t/uid_t


# f936ccb5 11-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Separate usernext/groupnext from the main functions


# a9237189 07-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Refactor input validation

Mutualize code to validate inputs of both 'user' and 'group' command
Test that the input name fits into MAXLOGNAME


# 2cc63cd1 07-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Add a new global struct pwconf to store etcpath, rootdir and struct userconf

Do not add anymore -R and -V to arglist
Add an error message if both -V and -R are set in arguments


# 1238a919 07-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Instead of always casting the pw_checkname input to u_char * and casting it back
to char *, change pw_checkname to directly take char * in input


# c145c34c 22-Apr-2014 Baptiste Daroussin <bapt@FreeBSD.org>

Simplify reading pw.conf(5) by using getline(3)


# fb2db031 30-Oct-2012 Baptiste Daroussin <bapt@FreeBSD.org>

Teach pw(8) about how to use pw/gr API to reduce code duplication

MFC after: 2 months


# 644af48d 08-Mar-2011 Jung-uk Kim <jkim@FreeBSD.org>

Stop hard-coding default directory mode as 0777.


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
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.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 85204142 30-Mar-2007 Lukas Ertl <le@FreeBSD.org>

Add home directory creation mode to pw.conf(5) and be a bit
more specific about the effect of the current umask on -M.


# 3ce1d6bb 10-Feb-2005 Stefan Farfeleder <stefanf@FreeBSD.org>

The variable `arglist' has internal linkage in pw.c, don't declare it as extern
here.


# cab0fb4e 05-Jul-2001 Kris Kennaway <kris@FreeBSD.org>

Fix a harmless format string bogon and mark a function as __printflike().
There is still one instance of non-constant format string use inside that
function, but it's hard to fix.

MFC after: 1 week


# e3975643 25-May-2000 Jake Burkholder <jake@FreeBSD.org>

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


# 740a1973 23-May-2000 Jake Burkholder <jake@FreeBSD.org>

Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by: phk
Reviewed by: phk
Approved by: mdodd


# 2399cd14 26-Oct-1999 David Nugent <davidn@FreeBSD.org>

Add new functionality "lock" and "unlock" to provide a simple password
locking mechanism for users. This works by prepending the string
"*LOCKED*" to the password field in master.passwd to prevent successful
decoding.


# 97d92980 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 5f12594a 23-Feb-1999 David Nugent <davidn@FreeBSD.org>

1) Do not blindly ignore file update errors which may occur due to concurrent
updating
2) Add -V <etcdir>, which allows maintaining user/group database in alternate
locations other than /etc.


# 1dcc6ec7 10-Oct-1997 Philippe Charnier <charnier@FreeBSD.org>

Use err(3) instead of local redefinition. Add rcsid string.


# 476602a9 22-Feb-1997 Peter Wemm <peter@FreeBSD.org>

Revert $FreeBSD$ to $Id$


# 1130b656 14-Jan-1997 Jordan K. Hubbard <jkh@FreeBSD.org>

Make the long-awaited change from $Id$ to $FreeBSD$

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.


# f1d684fa 05-Jan-1997 David Nugent <davidn@FreeBSD.org>

Adds optional NIS passwd file updating and optionally rebuilding
NIS maps.

Suggested by: Peter Wemm


# 0970881f 21-Dec-1996 David Nugent <davidn@FreeBSD.org>

1) 200 users per group limitation removed and pw
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.


# d9b711b7 19-Dec-1996 David Nugent <davidn@FreeBSD.org>

Allow 8-bit characters in the passwd gecos field, and adds a paragraph
to the mangpage explaining the consequences (to be updated at a later
date after login class conf support is added).


# ad7cf975 10-Dec-1996 Joerg Wunsch <joerg@FreeBSD.org>

Copyright update by the author, to be more in line with our sample
copyright.

Submitted by: David Nugent


# 48aee7f3 09-Dec-1996 Joerg Wunsch <joerg@FreeBSD.org>

Upgrade from the author, reflecting all my wishes resulting out of the
sysinstall use of this tool (plus some bug fixes).

2.2 candidate...

Submitted by: David Nugent <davidn@nserver.usn.blaze.net.au>


# d6f907dc 09-Dec-1996 Joerg Wunsch <joerg@FreeBSD.org>

pw(8) -- a backend utility to manage the user and group databases.

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>