summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix bugs spotted by gccBaptiste Daroussin2015-08-031-3/+4
| | | | Reported by: adrian
* Actually set quiet to something.Adrian Chadd2015-08-031-1/+1
| | | | | /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c: In function 'pw_user_next': /usr/home/adrian/work/freebsd/head-embedded-2/src/usr.sbin/pw/pw_user.c:680: warning: statement with no effect
* Split some extra long linesBaptiste Daroussin2015-08-021-5/+10
|
* Cleanup a bit includesBaptiste Daroussin2015-08-021-10/+15
|
* Fix regression: report again if a username already exists when creating itBaptiste Daroussin2015-08-021-0/+3
|
* Rewrite parsing subcommands arguments of pw(8)Baptiste Daroussin2015-08-021-923/+1248
| | | | | | | | | | | | | 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.
* Partial revert of r286152Baptiste Daroussin2015-08-011-4/+4
| | | | More work needed on the cli validation
* Validate expiration days and password days from commmand line and pw.confBaptiste Daroussin2015-08-011-4/+4
|
* Cast uid/git to uintmax_t when using printf-like functions so the size ofBaptiste Daroussin2015-08-011-16/+18
| | | | uid/gid size remains a implementation detail
* Reject usermod and userdel if the user concerned is not on the user databaseBaptiste Daroussin2015-07-281-0/+19
| | | | | | | | | | | | | supposed to be manipulated This prevent pw usermod creating a new local user when requesting to usermod on a username is defined in LDAP. This issue only happens when modifying the local user database (not inpacting commands when -V or -R are used). PR: 187653 Submitted by: tmwalaszek@gmail.com
* Fix wrong warning printed after changing or updating NIS usersBaptiste Daroussin2015-07-281-2/+2
| | | | | PR: 37672 Submitted by: chris+freebsd@chrullrich.de
* Regression fix: allow to create users with uid0Baptiste Daroussin2015-07-131-1/+1
| | | | Reported by: Jan Mikkelsen <janm@transactionware.com>
* Ensure skeldir is abolute path (relatively to the rootdir)Baptiste Daroussin2015-07-121-4/+10
|
* pw -R <rootdir> userdel can now cleanup installationBaptiste Daroussin2015-07-121-56/+50
| | | | | | | 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
* Rework the home directory creation and copy or the skel content to use *atBaptiste Daroussin2015-07-121-9/+8
| | | | | | | | | 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
* Make getarg return NULL if args is NULLBaptiste Daroussin2015-07-121-4/+1
|
* Fix regression: ensure when try to create the group and the user with the sameBaptiste Daroussin2015-07-111-12/+4
| | | | id if possible and nothing in particular was specified
* Replace custom string array with stringlist(3)Baptiste Daroussin2015-07-111-10/+6
|
* Remove unused argument from pm_passwdBaptiste Daroussin2015-07-111-4/+4
|
* check the gecos format early: at the moment the -c option is parsedBaptiste Daroussin2015-07-111-4/+3
|
* Remove useless use of gotoBaptiste Daroussin2015-07-111-4/+3
|
* Isolate pw lock/unlock into a separate functionBaptiste Daroussin2015-07-111-44/+78
|
* homedir can only be populate during useraddBaptiste Daroussin2015-07-111-3/+3
|
* Make a separate groupdel/userdel from the main functionBaptiste Daroussin2015-07-111-17/+31
|
* Make separate functions to show users and groupsBaptiste Daroussin2015-07-111-17/+35
|
* Move the quiet flag into the configuration structureBaptiste Daroussin2015-07-111-1/+1
|
* Separate usernext/groupnext from the main functionsBaptiste Daroussin2015-07-111-17/+17
|
* Fix validation of crypted passwordBaptiste Daroussin2015-07-041-7/+6
| | | | Small cleanups
* Validate input of pw usermod -h and pwusermod -HBaptiste Daroussin2015-07-041-60/+63
| | | | | | | 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
* backout remove of -q option for pw [user|group] nextBaptiste Daroussin2015-06-081-3/+7
| | | | | | While the return code is broken, some corner case usage depends on the functionnality, so backout until we get better regression tests covering those corner case usage.
* Remove '-q' support for pw [user|group] nextBaptiste Daroussin2015-06-071-7/+3
| | | | | | the intent of -q in this command is to return as exit status the value of the next group/user id, which does not make sense given exit status are limited to values between 0 and 255.
* Fix generating configuration fileBaptiste Daroussin2015-06-071-4/+3
|
* Fix duplicate checkingBaptiste Daroussin2015-06-071-10/+9
|
* Remove uneeded code (already done by pw_make_v7)Baptiste Daroussin2015-06-071-3/+0
|
* In case of rename validate the length of the new nameBaptiste Daroussin2015-06-071-4/+4
| | | | Check early that the new name fits MAXLOGNAME and store it in pwconf
* Refactor input validationBaptiste Daroussin2015-06-071-58/+37
| | | | | Mutualize code to validate inputs of both 'user' and 'group' command Test that the input name fits into MAXLOGNAME
* Finish converting -7 to pwconfBaptiste Daroussin2015-06-071-4/+3
|
* Handle -7 via gloval pwconfBaptiste Daroussin2015-06-071-6/+5
|
* Handle pretty print (-P) via global pwconfBaptiste Daroussin2015-06-071-12/+6
|
* Handle dryrun (-N) via global pwconfBaptiste Daroussin2015-06-071-5/+3
|
* Add a new global struct pwconf to store etcpath, rootdir and struct userconfBaptiste Daroussin2015-06-071-14/+16
| | | | | Do not add anymore -R and -V to arglist Add an error message if both -V and -R are set in arguments
* Fix pw userdel -r not deleting homedirBaptiste Daroussin2015-06-071-1/+1
|
* Test explicitly the result of strcmp to be consistent with the rest of the codeBaptiste Daroussin2015-06-071-1/+1
|
* Improve readability by reducing indentations levelsBaptiste Daroussin2015-06-071-9/+11
|
* Remove one level of indentationBaptiste Daroussin2015-06-071-7/+6
|
* Move user deletion code into a separate function to improve readabilityBaptiste Daroussin2015-06-071-106/+115
|
* Instead of always casting the pw_checkname input to u_char * and casting it backBaptiste Daroussin2015-06-071-8/+9
| | | | to char *, change pw_checkname to directly take char * in input
* New pw -R rootdir optionBaptiste Daroussin2015-06-031-11/+33
| | | | | | | | This allows to set an alternate root directory in which the users/groups will be manipulated Requested by: gjb, ian Tested by: gjb
* Remove useless cast in printf and printf-like functions:Baptiste Daroussin2015-05-311-15/+15
| | | | use %u for uid_t and gid_t
* Cast -1 to uid_t and bump WARNING level to 3Baptiste Daroussin2015-05-311-2/+2
|