freebsd-nq/usr.sbin/pw/tests
Ed Maste 8d2dbd281f pw useradd: Validate the user name before creating the entry
Previouly it was possible to create users with spaces in the name with:
pw useradd -u 1234 -g 1234 -n 'test user'

The "-g 1234" is relevant, without it the name was already rejected
as expected:

[fk@test ~]$ sudo pw useradd -u 1234 -n 'test user'
pw: invalid character ` ' at position 4 in userid/group name

Bug unintentionally found with a salt config without explicit name entry:

test user:
  user.present:
    - uid: 1234
    - gid: 1234
    - fullname: Test user
    - shell: /usr/local/bin/bash
    - home: /home/test
    - groups:
      - wheel
      - salt

"Luckily" salt modules rarely bother with input validation either ...

PR:		221416
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
MFC after:	1 week
2017-08-19 00:32:26 +00:00
..
crypt.c pw should sanitize the argument of -w. 2016-07-13 17:09:20 +00:00
group
helper_functions.shin Add minimum regression tests for pw -R 2015-07-12 09:42:10 +00:00
Makefile pw: add some basic testcases for groupshow and usershow 2017-05-28 02:15:57 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2016-08-31 19:30:46 +00:00
master.passwd
pw_config_test.sh Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 2017-03-23 03:28:24 +00:00
pw_etcdir_test.sh Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 2017-03-23 03:28:24 +00:00
pw_groupadd_test.sh Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 2017-03-23 03:28:24 +00:00
pw_groupdel_test.sh Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 2017-03-23 03:28:24 +00:00
pw_groupmod_test.sh Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 2017-03-23 03:28:24 +00:00
pw_groupshow_test.sh pw: add some basic testcases for groupshow and usershow 2017-05-28 02:15:57 +00:00
pw_lock_test.sh Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 2017-03-23 03:28:24 +00:00
pw_useradd_test.sh pw useradd: Validate the user name before creating the entry 2017-08-19 00:32:26 +00:00
pw_userdel_test.sh Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 2017-03-23 03:28:24 +00:00
pw_usermod_test.sh pw usermod: Properly deal with empty secondary group lists (-G '') 2017-08-19 00:19:23 +00:00
pw_usernext_test.sh Rename tests from <foo> to <foo>_test to match the FreeBSD test suite 2017-03-23 03:28:24 +00:00
pw_usershow_test.sh pw: add some basic testcases for groupshow and usershow 2017-05-28 02:15:57 +00:00
pw-modified.conf Fix setting uid/gid min/max via pw 2015-06-07 20:59:59 +00:00
pw.conf Fix generating configuration file 2015-06-07 20:44:06 +00:00