summaryrefslogtreecommitdiffstats
path: root/pw/tests/pw_useradd.sh
Commit message (Collapse)AuthorAgeFilesLines
* pw should sanitize the argument of -w.Alan Somers2016-07-131-10/+47
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix err pointer not initialized to NULL resultingBaptiste Daroussin2015-08-211-0/+15
| | | | Reported by: "O. Hartmann" <ohartman@zedat.fu-berlin.de>
* Fix typo in regression testBaptiste Daroussin2015-08-211-1/+1
|
* Fix /home symlink creationBaptiste Daroussin2015-08-211-0/+13
| | | | Add regression test about it
* Fix useradd regression:Baptiste Daroussin2015-08-211-2/+1
| | | | | | | | 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
* Regression: fix pw usermod -w xxxBaptiste Daroussin2015-08-141-0/+14
| | | | Reported by: gjb
* Convert the year used for regression test fro 2043 to 2037Baptiste Daroussin2015-08-021-11/+11
| | | | This makes the regression tests pass on systems where time_t is 32bits
* Add regression tests about adding already existsing groups/usersBaptiste Daroussin2015-08-021-0/+11
|
* Rewrite parsing subcommands arguments of pw(8)Baptiste Daroussin2015-08-021-3/+12
| | | | | | | | | | | | | 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.
* Check uid/gid used when creating a user/group are not larger than ↵Baptiste Daroussin2015-07-281-0/+8
| | | | | | | UID_MAX/GID_MAX PR: 173977 Reported by: nvass@gmx.com
* Add regression tests to ensure we keep allowing creating users with uid0Baptiste Daroussin2015-07-131-0/+11
|
* Ensure skeldir is abolute path (relatively to the rootdir)Baptiste Daroussin2015-07-121-1/+1
|
* Rework the home directory creation and copy or the skel content to use *atBaptiste Daroussin2015-07-121-0/+25
| | | | | | | | | 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
* Add minimum regression tests for pw -RBaptiste Daroussin2015-07-121-0/+16
|
* Do not try to set password on group if the group is added as a consequence ofBaptiste Daroussin2015-07-091-0/+10
| | | | | | of creating a user (regression from r285136) Reported by: Fabian Keil <fk@fabiankeil.de>
* pw: fail if an invalid entry is found while parsing master.passwd and groupBaptiste Daroussin2015-07-071-0/+26
| | | | | | PR: 198554 Reported by: diaran <fbsd@centraltech.co.uk> MFC after: 2 days
* Also validate hours via strptime_l(3)Baptiste Daroussin2015-07-051-0/+6
| | | | | Simplify the code, by only using one parser, ensure the dates (hours and dates) are valid
* Validate expiration datesBaptiste Daroussin2015-07-051-0/+26
| | | | Use strptime_l(3) to validate the dates provided in input
* Refactor input validationBaptiste Daroussin2015-06-071-1/+9
| | | | | Mutualize code to validate inputs of both 'user' and 'group' command Test that the input name fits into MAXLOGNAME
* Fix a race condition by allowing up to 5 seconds of difference between the ↵Brad Davis2015-02-241-4/+8
| | | | | | | time stamps. PR: 197861 Approved by: will
* Add tests for account and password expiration.Brad Davis2015-02-171-0/+111
| | | | Approved by: will
* Add tests for pw -NBrad Davis2014-12-161-0/+33
| | | | | | PR: 150449 Submitted by: Robert O'Neil <oneil.rs@gmail.com> Approved by: will
* Break out the tests into a file per command and clean up some long linesBrad Davis2014-12-091-0/+40
Approved by: will