summaryrefslogtreecommitdiff
path: root/usr.sbin/user/user.c
AgeCommit message (Collapse)Author
2003-06-14For moduser(), only do valid_class() check when F_CLASS is set inTodd C. Miller
up->u_flags. Fixes a coredump when changing/deleting an existing user introduced by my recent commit here.
2003-06-10Check that login class exists before using it; based on a patch fromTodd C. Miller
Peter Werner. Closes PR 2699.
2003-06-10o Check for fwrite() error with != 1, not <= 0 (mostly style)Todd C. Miller
o Correct some error messages o More informative error when reading a line that is > LINE_MAX o When saving password, only alloc space for what is used
2003-06-10Keep a table of password types, and their associated lengths, andTodd C. Miller
check in useradd or usermod whether the given encrypted password has the correct length. Factor out time code into a function, scantime() Perform ctype(3) operations on unsigned chars. From NetBSD (agc)
2003-06-10Use syslog(3) to log new users and groups, deletions of users and groups,Todd C. Miller
and modification of user and group information. Syslog priority is LOG_INFO, facility is LOG_USER (there is no need to do this via LOG_AUTH, since the password and group files are world readable). From NetBSD (agc)
2003-06-10Catch illegal flags and reply with usage; from NetBSD (agc)Todd C. Miller
2003-06-10o rename login variable to login_nameTodd C. Miller
o remove user from supplementary groups when deleting a user and not preserving information. o add some const o check that user/group is local (not YP) before trying to change it. From NetBSD (agc)
2003-06-08user -e and -f now accepts "month day year" (ala chpass(1)) andTodd C. Miller
seconds-since-epoch. From NetBSD (grant).
2003-06-08Add check for group too long and made an invalid group a fatal errorTodd C. Miller
instead of just a warning which is consistent with the way an invalid user is treated.
2003-06-08Use _PW_NAME_LEN not MAXLOGNAME since the latter does not include the NUL.Todd C. Miller
2003-05-13Don't allow usernames to begin with a dash since pwd_mkdb(8)Todd C. Miller
will reject such a name; from Brian Poole
2003-04-03The check for whether or not a group is empty was busted. Closes PR 3178.Todd C. Miller
2002-12-10Add 2 missing pw_abort() calls when pw_mkdb() fails and remove theTodd C. Miller
void cast from pw_abort() since it is already void. From NetBSD via Brian Poole.
2002-11-07Check for non-existent group in groupdel just like userdel; Sebastian StarkTodd C. Miller
2002-11-07Change some err/warn -> errx/warnx. Should maybe do the same forTodd C. Miller
the short write cases.
2002-11-07Allow '$' in a username as long as it is the last character sinceTodd C. Miller
samba wants to create usernames that end in '$'. From Paul Chakravarti
2002-07-25Check snprintf() rval for < 0; OK deraadt@Todd C. Miller
2002-06-09When checking for valid login names, check length against MaxUserNameLen.Todd C. Miller
Noticed by Brian Poole who supplied a different patch.
2002-05-17When modifying a group w/ no members with groupmod(8) the trailingTodd C. Miller
newline was not added. Reported by Rob Sessink, different fix by me.
2002-04-04From Brian Poole:Todd C. Miller
o unlink /etc/group temp file if rename fails o when doing 'cd' in a system() separate with && not ';' so we don't do stuff in the wrong place. Much of this should just be done inline.
2002-04-03UID ranges specified on the command line were being overridden byTodd C. Miller
those found in the config file. Those on the command line should be used in preference to the config file ranges. Based on a patch from Brian Poole.
2002-03-14Remove \n from err/errx/warn/warnx().Mike Pechkin
millert@ ok
2002-03-05'user -D -k path' was not actually changing the default values unless anotherTodd C. Miller
option to change was specified. Also fix man page formatting mistake. From Brian Poole
2001-12-05Minor sync with NetBSDTodd C. Miller
o fix two err() calls that should be errx() o don't use the colonc variable in a non-obvious way o add missing or of F_SHELL when in preserve mode
2001-12-05o Use proper uid_t and gid_t types and fixup printf format strings to matchTodd C. Miller
o Change "unsigned" -> "unsigned int" o Correct a buffer size that should have been LINE_MAX o Simplify creation of group entry in groupmod() using strlcat() and catch errors. Theo and myself...
2001-11-15fix password length check; allows usermod -p to work again.Dan Harnett
ok millert@
2001-11-08Replace unreadable snprintf() and pointer arithmetic with simple strlcat().Todd C. Miller
If group file line would grow to be too long, leave it unmolested (previously it would get removed). Use fclose(fp) not close(fd) for a stream that was fdopen()ed. Otherwise we could leak memory. When calling fwrite() pass the buffer as a single element instead of using n one-byte elements.
2001-09-18Sync with NetBSD plus the following changes:Todd C. Miller
o use LINE_MAX for the max password entry length. This is also what pwd_mkdb does. o add more checks for lines that are too long o kill some useless (and incorrect) casts o check snprintf() return vals for sanity before use o sync usage() with man pages o slight KNF o eliminate some silly uses of snprintf
2001-08-16extra arg to pw_mkdbTodd C. Miller
2001-03-24cleanup error messageJakob Schlyter
2001-03-24fix usage when called as invalid binary name; <raj@cerias.purdue.edu>Jakob Schlyter
2001-03-24fix multiple UID ranges; <raj@cerias.purdue.edu>Jakob Schlyter
2001-03-24fix strlcpy; <raj@cerias.purdue.edu>Jakob Schlyter
2001-02-13rely on constants; ianm@cit.uws.edu.auTheo de Raadt
2000-11-26Update for pw_mkdb(3) interface change. All but vipw and userdel canTodd C. Miller
specify a username (and thus avoid rebuilding the while database).
2000-07-15When modifying users and not specifying a new GID, don't arbitrarilyHakan Olsson
reset it to the default GID, keep the old one. Further, when given a new home dir, actually use it. Fixes PR #1318.
2000-07-06Don't write password lines longer than 1023 chars.Hakan Olsson
Change two instances of err() to errx().
2000-06-16Fix PR 1279.Hakan Olsson
2000-06-09chown has moved to /sbinTodd C. Miller
2000-05-05Forgot to update usage().Hakan Olsson
2000-05-05Make -G flag work for user{add,mod}.Hakan Olsson
2000-05-05limit size of a password file entry (including &-expansion)Jakob Schlyter
replace a couple of strcpy with strlcpy
2000-05-04use _PASSWORD_LEN constantJakob Schlyter
adduser(); correct sync_uid_gid handling adduser(); initialize password correctly copydotfiles(); run chmod properly creategid(); cleanup groupmod(); add missing newline moduser(); do not overwrite shell with gecos moduser(); initialize password correctly read_defaults(); read default password from usermgmt.conf userdel(); initialize password correctly ok deraadt@.
2000-04-26make usage readable on a console; eric jackson <shinobi@monkey.org>Jakob Schlyter
2000-04-24default to non-verbose (previously undefined)Jakob Schlyter
2000-04-24include cleanupJakob Schlyter
2000-04-24use _PATH_MASTERPASSWD & _PATH_GROUPJakob Schlyter
2000-04-24fix usage when building with EXTENSIONSJakob Schlyter
2000-04-24is_number() is needed even without EXTENSIONS definedJakob Schlyter
2000-04-24remove lint stuff. remove unneeded strlcpy.Jakob Schlyter