summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
Commit message (Collapse)AuthorAgeFilesLines
* pw_checkname since the beginning if too strict on GECOS field,Baptiste Daroussin2015-12-021-1/+2
| | | | | | | | | | | relax it a bit so gecos can be used to store multibytes data. This was unseen before FreeBSD 10.2 as this validation function was motly unused since FreeBSD 10.2 the usage of this function has been generalized to improve validation. Reported by: des MFC after: 1 week
* Fix handling of numeric-only names with pw lockBaptiste Daroussin2015-12-021-9/+12
| | | | | | | Add a regression test about it PR: 204968 MFC after: 1 week
* In pw_userlock, set 'name' to NULL when we encounter an all number stringXin LI2015-10-301-2/+3
| | | | | | | | because it is also used as an indicator of whether a name or an UID is being used and we may have undefined results as 'name' may contain uninitialized stack contents. MFC after: 2 weeks
* Fix unlikely memory leak.Bryan Drewery2015-10-291-1/+3
| | | | | | | It is unlikely since the first check in the function is that dir[0] is '/', but later code changes may make it real. Coverity CID: 1332104
* Regression: fix usershow -7Baptiste Daroussin2015-09-141-1/+1
| | | | | Submitted by: Dan McGregor (via IRC) MFC after: 2 days
* Regression: fix pw usermod -dBaptiste Daroussin2015-09-121-0/+1
| | | | | | | | | Mark the user has having been edited if -d option is passed to usermod and so the request change of home directory actually happen PR: 203052 Reported by: lenzi.sergio@gmail.com MFC after: 2 days
* Fix /home symlink creationBaptiste Daroussin2015-08-211-1/+1
| | | | Add regression test about it
* Fix useradd regression:Baptiste Daroussin2015-08-211-0/+66
| | | | | | | | 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/+2
| | | | Reported by: gjb
* Avoid calling strlen() where we can use the strspn() return value.Ed Schouten2015-08-031-5/+5
|
* 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
|