History log of /freebsd-11-stable/usr.sbin/pw/tests/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
359588 03-Apr-2020 bapt

MFC r359232:

pw: do not removed home directories if not owned

When deleting a user, if its home directory does not belong to it, it should
not be removed. This is the promise that the manpage makes, the tool should
ensure that it respects that promise.

Add a regression test about it

PR: 244967
Submitted by: Eric Hanneken <eric@erichanneken.com>

330694 09-Mar-2018 dab

MFC r330245:

Allow the "@" and "!" characters in passwd file GECOS fields.

Two PRs (152084 & 210187) request allowing the "@" and/or "!"
characters in the passwd file GECOS field. The man page for pw does
not mention that those characters are disallowed, Linux supports those
characters in this field, and the "@" character in particular would be
useful for storing email addresses in that field.

PR: 152084, 210187
Submitted by: jschauma@netmeister.org, Dave Cottlehuber <dch@freebsd.org>
Reported by: jschauma@netmeister.org, Dave Cottlehuber <dch@freebsd.org>
Sponsored by: Dell EMC

323009 30-Aug-2017 emaste

MFC r322581: remove debug files in delete-old* when WITHOUT_DEBUG_FILES

Sponsored by: The FreeBSD Foundation

322919 26-Aug-2017 emaste

MFC r322677: pw usermod: Properly deal with empty secondary group lists (-G '')

PR: 221417
Relnotes: Yes

321164 18-Jul-2017 ngie

MFC r319026:

pw: add some basic testcases for groupshow and usershow

- groupshow: test out -a/-g/-n .
- usershow: test out -a/-n/-u .

316389 02-Apr-2017 asomers

MFC r315041

Increase WARNS for pw tests

ATF tests have a default WARNS of 0, unlike other usermode programs.

Reviewed by: ngie, julian
MFC after: 3 weeks
Sponsored by: Spectra Logic Corporation
Differential Revision: https://reviews.freebsd.org/D9933

316347 01-Apr-2017 bapt

MFC: r315912 (by eugen@) and r315935

Properly initialise with content of pw.conf(5) that was mistakenly ignored.
Also, respect "defaultgroup" if specified there.

Add a regression test

PR: 217934
Reported by: Victor Sudakov <vas@mpeks.tomsk.su>

316256 30-Mar-2017 ngie

MFC r315776:

Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme

usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.

312931 28-Jan-2017 bapt

MFC r312644, r312650

r312644:
Readd a feature lost in pw(8) refactoring

pw usermod foo -m

It used to be able to (re)create the home directory if it didn't exists

PR: 216224
Reported by: ae
MFC after: 3 days

r312650:
Really restore the old behaviour for pw usermod -m

It again reinstall missing skel files without overwriting changed one
Add a regression test about it

Reported by: ae
MFC after: 3 days

305741 12-Sep-2016 asomers

MFC r302778

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.

303256 24-Jul-2016 bapt

iDo not try to delete the home of the user if is is not a directory for example
"/dev/null"

PR: 211195
Submitted by: rday <ryan@ryanday.net>
Reported by: eniorm <eniorm@gmail.com>
Approved by: re (kib)

302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
299094 04-May-2016 ngie

Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
namespacing is kept with FILES appropriately, and that this shouldn't need
to be repeated if the namespace changes -- only the definition of PACKAGE
needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
`tests`. In the event we get to the point where things can be split up
enough in the base system, it would make more sense to group the tests
with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division


298107 16-Apr-2016 gjb

Merge the projects/release-pkg branch to head.

This allows packaging the base system with pkg(8), including
but not limited to providing the ability to provide upstream
binary update possibilities for non-tier-1 architectures.

This merge is a requirement of the 11.0-RELEASE, and as such,
thank you to everyone that has tested the project branch.

Documentation in build(7) etc. is still somewhat sparse, but
updates to those parts will follow.

Sponsored by: The FreeBSD Foundation


296587 09-Mar-2016 bdrewery

DIRDEPS_BUILD: Connect MK_TESTS.

Sponsored by: EMC / Isilon Storage Division


291657 02-Dec-2015 bapt

Fix handling of numeric-only names with pw lock
Add a regression test about it

PR: 204968
MFC after: 1 week


289172 12-Oct-2015 ngie

Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison


286993 21-Aug-2015 bapt

Fix err pointer not initialized to NULL resulting

Reported by: "O. Hartmann" <ohartman@zedat.fu-berlin.de>


286991 21-Aug-2015 bapt

Fix typo in regression test


286986 21-Aug-2015 bapt

Fix /home symlink creation

Add regression test about it


286982 21-Aug-2015 bapt

Fix useradd regression:

Readd the function to create the parents home directory if it does not exists.
if it is only a directory at the top level of the hierarchy symlink it into /usr
as it used to be done before.

Reported by: kevlo, adrian


286775 14-Aug-2015 bapt

Regression: fix pw usermod -w xxx

Reported by: gjb


286341 05-Aug-2015 bapt

Add regression tests for a bug reported in stable/10

While pw(8) on head is not affected it is worth adding more regression tests
ensuring this bug will not happen unnoticed in the futur


286210 02-Aug-2015 bapt

Convert the year used for regression test fro 2043 to 2037

This makes the regression tests pass on systems where time_t is 32bits


286200 02-Aug-2015 bapt

Add regression tests about adding already existsing groups/users


286196 02-Aug-2015 bapt

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.


286173 02-Aug-2015 bapt

Remove netbsd tests on pw(8)

First they are redundant with the tests we currently have on pw(8)
Second they to modify the host database instead of being self contained withing
the test directory


285985 28-Jul-2015 bapt

Check uid/gid used when creating a user/group are not larger than UID_MAX/GID_MAX

PR: 173977
Reported by: nvass@gmx.com


285948 28-Jul-2015 bapt

when -n is passed to any pw subcommand it is always expected to be considered as
a name so do not try to convert it to an id if it is a numeric value

PR: 31933
Reported by: ted@impulse.net
Sponsored by: gandi.net


285442 13-Jul-2015 bapt

Add regression tests to ensure we keep allowing creating users with uid0


285434 12-Jul-2015 bapt

Ensure skeldir is abolute path (relatively to the rootdir)


285433 12-Jul-2015 bapt

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


285430 12-Jul-2015 bapt

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


285418 12-Jul-2015 bapt

Add minimum regression tests for pw -R


285411 11-Jul-2015 bapt

Rework groupmod modification:

Use gr_add(3) when possible to avoid code duplication.
Use a simpler logic to delete members of a group


285318 09-Jul-2015 bapt

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>


285256 07-Jul-2015 bapt

pw: fail if an invalid entry is found while parsing master.passwd and group

PR: 198554
Reported by: diaran <fbsd@centraltech.co.uk>
MFC after: 2 days


285157 05-Jul-2015 bapt

Also validate hours via strptime_l(3)

Simplify the code, by only using one parser, ensure the dates (hours and dates)
are valid


285156 05-Jul-2015 bapt

Validate expiration dates

Use strptime_l(3) to validate the dates provided in input


285133 04-Jul-2015 bapt

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


284137 07-Jun-2015 bapt

Fix setting uid/gid min/max via pw


284135 07-Jun-2015 bapt

Fix generating configuration file


284129 07-Jun-2015 bapt

In case of rename validate the length of the new name

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


284128 07-Jun-2015 bapt

Refactor input validation

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


279256 24-Feb-2015 brd

Fix a race condition by allowing up to 5 seconds of difference between the time stamps.

PR: 197861
Approved by: will


278902 17-Feb-2015 brd

Add tests for account and password expiration.

Approved by: will


278819 15-Feb-2015 brd

Really fix the pw_usernext tests.

PR: 197612
Approved by: will


278767 14-Feb-2015 brd

Remove an extra curly bracket that was causing intermittent failures.

PR: 197612
Submitted by: Robert O'Niel <oneil.rs@gmail.com>
Approved by: will


278475 09-Feb-2015 brd

Add tests for `pw usernext'.

PR: 197120
Submitted by: Robert O'Neil <oneil.rs@gmail.com>
Approved by: will


277764 26-Jan-2015 bapt

Revert r277652

uid and gid are never and should never be negative. The pw(8) manpage clearly
states the -u and -g arguments are for uids/gids, hence using negative values is
abusing a bug in former versions of pw(8)


277652 24-Jan-2015 bapt

Allow negative numbers in -u and -g options

PR: 196514
MFC after: 1 week


275829 16-Dec-2014 brd

Add tests for pw -N

PR: 150449
Submitted by: Robert O'Neil <oneil.rs@gmail.com>
Approved by: will


275658 09-Dec-2014 brd

Restructure to make it easier to extend in the future

Reviewed by: will
Suggested by: ngie


275657 09-Dec-2014 brd

Add some tests for user modification. [1]
Fix a missing test in the Makefile from my previous commit.

PR: 195834 [1]
Submitted by: Robert O'Neil <oneil.rs@gmail.com>
Approved by: will


275656 09-Dec-2014 brd

Break out the tests into a file per command and clean up some long lines

Approved by: will


275653 09-Dec-2014 brd

Add more tests for pw(8) useradd.

PR: 195832
Submitted by: Robert O'Neil <oneil.rs@gmail.com>
Approved by: will


274727 19-Nov-2014 brd

Replace the pw(1) calls with a variable, to make it easier to to change across all the tests as needed.

Reviewed by: will


274632 17-Nov-2014 brd

Clean up some language

Reviewed by: will


274542 15-Nov-2014 brd

Add a test for locking and unlocking user accounts

Submitted by: Robert O'Neil <oneil.rs@gmail.com>
Reviewed by: will


274453 12-Nov-2014 bapt

Fix wrong message when using pw -V with a non existent directory
Add a regression test about it

PR: 194971
Submitted by: Freddy DISSAUX <bugzilla@dsx.bsdsx.fr>


274022 03-Nov-2014 ngie

Require root when running the pw_delete and pw_modify test programs (pw(8)
requires it)


274011 03-Nov-2014 ngie

Integrate usr.sbin/useradd/t_useradd.sh from NetBSD into FreeBSD as pw_test

- Suffix useradd/userdel commands with pw
- Remove the atf_expect_fail for bin/39546

Phabric: D921
Reviewed by: brd
Sponsored by: EMC / Isilon Storage Division


273791 28-Oct-2014 bapt

Fix renaming a group via the gr_copy function

Add a regression test to pw(8) because the bug was discovered via using:
pw groupmod

PR: 187189
Reported by: mcdouga9@egr.msu.edu
Tested by: mcdouga9@egr.msu.edu
Patch by: Marc de la Gueronniere


273787 28-Oct-2014 bapt

Ensure pw userdel -u <invalid> do not try to remove root

Check the uid passed is actually a number as early as possible

MFC after: 1 week


273786 28-Oct-2014 bapt

Fix atf syntax


273782 28-Oct-2014 bapt

Do not delete the group wheel when bad argument is passed to pw groupdel -g

Check that the -g argument is actually a number, if not report an error.
This argument is converted without checking with atoi(3) later so without this
check it converts any alpha entries into 0 meaning it deletes the group wheel

Add a regression test about it

PR: 90114
Reported by: bkoenig@cs.tu-berlin.de
MFC after: 1 week


273779 28-Oct-2014 bapt

Fix a regression in pw usermod -G list

The user was perperly adding the to different groups from "list" but was not
removed from the other groups it could have belong to.
While here add a regression test about this bug

PR: 185666
Reported by: sub.mesa@gmail.com
MFC after: 1 week


273772 28-Oct-2014 bapt

When a group is renamed then the group has been invalidated for sure.
In that case get the group information using the new name.

Add a regression test about this bug

PR: 193704
Reported by: az


272578 06-Oct-2014 brd

- Add some tests for modifying groups

Reviewed by: will


272445 02-Oct-2014 brd

- Add a test for bug 191427 where pw(8) will go into an infinite loop

Reviewed by: will
MFC after: 1 month