Commit Graph

225 Commits

Author SHA1 Message Date
wiz 3afef2ec6e Fix warning in userdel -r.
If the 'rm -rf' works, then the home directory does not exist any more,
and rmdir() on it will return an error (ENOENT). Catch and ignore it.

Avoids:

# useradd -m foo
# userdel -r foo
userdel: Unable to remove all files in `/home/foo': No such file or directory
2019-07-29 09:33:21 +00:00
zafer 061f0fcc8a Set default homeperm values before writing usermgmt.conf file and honor values in it instead of ignoring it.
Fixes PR bin/40324 by Guy Yur
2018-06-10 07:52:05 +00:00
wiz da22e8d742 Document file format better. From Travis Paul and Matthew Bauer.
Bump date.
Addresses PR 50787.
2016-02-09 14:14:02 +00:00
wiz 5d2c9e2250 Fix section name. 2014-09-19 16:04:29 +00:00
wiz 2a65137f55 Sort sections. From Henning Petersen in PR 49222. 2014-09-19 16:02:58 +00:00
blymn 9a57dec753 Fix error message when trying to add a group using -g =uid that
that already exists, the old version printed the wrong GID.
2012-11-28 11:31:27 +00:00
blymn 2da0bfd2ff Google Code In bug fix by Philip Hayes, fixes bin/41049 2012-11-28 11:20:58 +00:00
dholland 4cd06b238c Move path names to pathnames.h per conventions 2011-12-01 00:34:05 +00:00
dholland 5cea11a8b9 Handle return value from system() properly.
PR 45672 from River Tarnell.
2011-12-01 00:26:45 +00:00
dholland 334ade83c1 attribute format printf -> __printflike 2011-12-01 00:15:32 +00:00
plunky 9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
wiz e57ebdb6c5 Close masterfd after reading from it. Found by cppcheck. 2011-01-04 10:30:21 +00:00
wiz e68a42515b Bump date for gid_range. 2009-12-31 20:14:19 +00:00
mlelstv 6ee63fe8b0 Add new keyword gid_range to usermgmt.conf which specifies a default
GID range for groupadd(8).
2009-12-31 19:59:31 +00:00
hubertf 2058a998c8 Fix -p:
* rm_eo is the first character *after* the match, so no need for a +1
 * Blowfish hashes are only 53 chars long, not 54
2009-10-15 23:03:02 +00:00
lukem d877c4c3c0 Enable WARNS=4 by default, except for:
cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
2009-04-22 15:23:01 +00:00
mike c7f073e0ff Fix check for duplicate gid when '-g =uid' is specified to usermod.
Closes PR bin/40391
2009-03-20 02:53:47 +00:00
mike 0779b10efc Do not allow duplicate group id in groupmod unless -o is specified.
Closes PR bin/40393
2009-03-18 04:59:45 +00:00
dyoung 8bd55ddc61 Delete misplaced period and line ending. 2009-03-11 17:54:03 +00:00
christos 7022cb2a8d bin/40994: Michael van Elst: usermod -l change password so user is unable to
login. User getpwnam_r to avoid trashing result of previous call to getpwnam().
2009-03-11 14:18:03 +00:00
reed 26542189a9 Improve -G documentation. It may be repeated.
And value may be comman-delimited list of groups.
16 maximum groups.
2009-01-14 02:18:28 +00:00
apb f3f295c281 Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
2008-10-19 22:05:23 +00:00
lukem 9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
apb 4ce9a85c41 man page fixes from PR 39164. 2008-07-18 21:03:03 +00:00
reed a87ec1e425 Remove the -v verbose switch from userinfo. It was not used.
Also remove reference to usermgmt.conf from userinfo manpage.

Discussed on tech-userlevel.
2008-02-27 19:12:56 +00:00
hubertf f81f738d09 disclaim copyright 2008-02-04 01:28:20 +00:00
rillig a5acac5748 Added a reference to passwd(1), which is useful to later change a
password.
2006-12-06 21:49:17 +00:00
pavel e98941caa4 Change the default shell to /bin/sh. It has most of the usability
advantages of our ksh (emacs line editing). There were objections against
using ksh, because our (pd)ksh is not the real ksh. See also the
discussion on tech-userlevel.

Motivation for changing the default from csh is better interactive
usability and desire to use a standard shell, which is already used for
all the system shell scripts.

Approved by core.
2006-11-02 21:42:08 +00:00
christos f6a7372b60 use c99 initializers 2006-10-22 21:09:47 +00:00
wiz b7a8d82a23 Sort options in usage. 2006-10-13 20:43:31 +00:00
wiz 1bce9c8b5d Remove empty line. 2006-10-13 20:35:38 +00:00
elad 5e188d0b70 PR/30351: Hubert Feyrer: useradd(8) doesn't allow setting permissions of
new home [patch]

Adapted to current code and some nits from myself. Thanks for the patch!
2006-10-07 09:20:07 +00:00
pavel 338033d1c7 revert change of default shell, reguested by agc@. 2006-09-30 11:47:00 +00:00
pavel 4d8dbf3bf0 Change the default shell to /bin/ksh, which is our best interactive
shell at the moment. Proposed on tech-userlevel and approved by hubertf@.
2006-09-30 10:50:32 +00:00
pavel 3b850c18c8 in userinfo, initialize buf (the buffer which will hold group names)
to be a null-terminated string. Otherwise, if the user is not a member
of any secondary groups, buf is completely uninitialized and userinfo
adds garbage to the list of groups printed.
2006-09-30 10:44:55 +00:00
christos 5efc77fb1e use realloc instead of free+calloc 2006-06-27 12:39:23 +00:00
jnemeth b7899a65bc try again with the Coverity annotation 2006-06-02 21:44:37 +00:00
hubertf 5fdc69efae Xref a few more manpages: user(8), group(8), ... 2006-05-29 01:38:33 +00:00
jnemeth d9a7dcfba5 Coverity annotation -- although memsave free()s its first argument, it
will allocate memory and assign it to its first argument, so it is neutral
Coverity CID 3229:  memory leak -- failed to fclose() master in moduser()
Coverity CID 3228:  memory leak -- failed to free() newname in groupmod()
2006-05-27 03:41:48 +00:00
joerg 368cb1b951 Garbage collect cc in moduser, it is only set once, but never read as
noticed by lint.
2006-03-22 18:02:46 +00:00
joerg 5dc48904d3 Don't leak FILEs when flock fails. Found by Coverity (CID 1776, 1777 and
1778). Patch by Liam J. Foy, which handles one more case.
2006-03-22 18:01:11 +00:00
dmcmahill de309be996 put the array bounds check _before_ accessing the array.
Coverity  CID: 1479
2006-03-17 14:20:10 +00:00
dmcmahill ee00225705 put the array bounds check _before_ accessing the array.
Coverity  CID: 1480
2006-03-17 14:14:45 +00:00
christos aa3a9e822d By popular demand don't bail out if a user's shell is not in /etc/shells.
Issue a warning instead.
2006-02-23 22:45:25 +00:00
jmmv 1cd43a0b52 Add a missing space in the usage message. 2006-01-26 17:24:52 +00:00
wiz 771b656bd0 Add missing .El. From Nicolas Joly in PR 32546. 2006-01-20 21:50:54 +00:00
agc 9823410edb Use a CPP definition for "/sbin/nologin" - it's at the top of the
file.

Modify the logic in the previous but one commit - /sbin/nologin should
be considered a valid user shell, since otherwise, with the addition
of the checks for a valid user shell, useradd with a shell of
/sbin/nologin will fail.

Modify some of the code here to conform to the standards in the rest
of this file.
2006-01-14 22:00:52 +00:00
elad 87a445663d Add forgotten ')'. 2006-01-13 16:36:33 +00:00
christos efe8347be7 treat /sbin/nologin specially. 2006-01-13 13:43:23 +00:00
christos ca0029edd3 Add checks for valid shell. From Liam Foy. 2006-01-06 18:11:00 +00:00