History log of /freebsd-current/usr.sbin/pw/pwupd.h
Revision Date Author Comments
# d2f1f71e 29-May-2024 Mike Karels <karels@FreeBSD.org>

pw userdel: destroy home dataset if empty

When removing a user's home directory, if the directory is a ZFS
dataset, it cannot be removed. If the directory has been emptied,
use "zfs destroy" to destroy it. This complements the automatic
dataset creation in adduser. Note that datasets within the directory
and snapshots are not handled, as the complete path is not constructed.

While here, add waitpid() calls to rmat() and pw_user_del().

Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D45348


# 4d65a7c6 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.sbin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


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

Remove $FreeBSD$: two-line .h pattern

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


# 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


# 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.


# 9c242913 31-Jul-2016 Ed Schouten <ed@FreeBSD.org>

Fix up setgrent(3) to have a POSIX-compliant prototype.

Just like with freelocale(3), I haven't been able to find any piece of
code that actually makes use of this function's return value, both in
base and in ports. The reason for this is that FreeBSD seems to be the
only operating system to have such a prototype. This is why I'm deciding
to not use symbol versioning for this.

It does seem that the pw(8) utility depends on the function's typing and
already had a switch in place to toggle between the FreeBSD and POSIX
variant of this function. Clean this up by always expecting the POSIX
variant.

There is also a single port that has a couple of local declarations of
setgrent(3) that need to be patched up. This is in the process of being
fixed.

PR: 211394 (exp-run)


# 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.


# 7493058f 31-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Partial revert of r286152

More work needed on the cli validation


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

Validate expiration days and password days from commmand line and pw.conf


# ee8c5d14 12-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

pw -R <rootdir> userdel can now cleanup installation

Rewrite rm_r to use *at function, allowing to remove home directories along with
users. only crontabs and at(1) installation are not removed

Relnotes: yes


# 65730d93 12-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Rework the home directory creation and copy or the skel content to use *at
functions

This allows to simplify the code a bit for -R by not having to keep modifying
path and also prepare the code to improve support -R in userdel

While here, add regression tests for the functionality


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

Replace custom string array with stringlist(3)


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

check the gecos format early: at the moment the -c option is parsed


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

Make a separate groupdel/userdel from the main function


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

Make separate functions to show users and groups


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

Move the quiet flag into the configuration structure


# 0fc58d14 09-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Do not try to set password on group if the group is added as a consequence of
of creating a user (regression from r285136)

Reported by: Fabian Keil <fk@fabiankeil.de>


# 11621f96 04-Jul-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Validate input of pw usermod -h and pwusermod -H

Push the code that set the password into a separate function to improve
readability

Add regression tests about pw usermod -h and pw usermod -H


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

Fix generating configuration file


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

Fix duplicate checking


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

In case of rename validate the length of the new name

Check early that the new name fits MAXLOGNAME and store it in pwconf


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

Handle -7 via gloval pwconf


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

Handle pretty print (-P) via global pwconf


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

Handle dryrun (-N) via global pwconf


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

Sort headers


# 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


# ac72be28 03-Jun-2015 Baptiste Daroussin <bapt@FreeBSD.org>

New pw -R rootdir option

This allows to set an alternate root directory in which the users/groups will be
manipulated

Requested by: gjb, ian
Tested by: gjb


# 6b6b47d0 29-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove dead declaration

PR: 195928
MFC after: 2 days


# 234626f7 10-May-2015 Baptiste Daroussin <bapt@FreeBSD.org>

Remove extendline definition
Remove now unused PWBUFSZ define


# 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


# 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.


# 379e7b73 11-Jul-2002 Alfred Perlstein <alfred@FreeBSD.org>

de-__P()


# 923dc0b2 14-Jan-2000 David Nugent <davidn@FreeBSD.org>

Portability fixes for other bsd4.4 derivatives.


# 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.


# 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.


# 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.


# 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


# 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>