summaryrefslogtreecommitdiff
path: root/usr.sbin/user
AgeCommit message (Collapse)Author
2012-09-20Be consistent with what the installer and useradd(8) do and put newlyAntoine Jacoutot
created users into their own primary group. This does not change existing installations that already have a usermgmt.conf(5). ok todd@ beck@
2012-09-18Add 2 new knobs to usermod(8):Antoine Jacoutot
-U to unlock an account -Z to lock an account Locking means adding a '*' prefix to the encrypted password and appending a '-' to the user's shell... and obviously the opposite for unlocking. some inputs from sthen@, otto@ and deraadt@ ok todd@
2012-01-29fix previous: grp is unused here just check the return valueAntoine Jacoutot
spotted by Jeremie Courreges-Anglas
2012-01-28Make it possible to remove a user from all secondary groups by using:Antoine Jacoutot
usermod -S '' username Original patch from jca at wxcvbn dot org. Added a comment to the man page. man tweaks and ok jmc@ ok miod@
2012-01-28When setting the groups (`-S'), make sure all provided groups exist inAntoine Jacoutot
the system otherwise we may end up removing all groups from a user. ok miod@
2012-01-12fgets(3) returns a pointer, so compare against NULL, not integer 0.Antoine Jacoutot
from Michael W. Bombardieri ok miod@
2011-12-31Remove the EXTENSIONS ifdef danse; it might have made sense in the pastAntoine Jacoutot
but user(8) behaviour has become OS specific in time so there's no sense keeping this. We are OpenBSD and we use BSD EXTENSIONS unconditionally. ok miod@ millert@ deraadt@
2011-12-30Fix a warning.Antoine Jacoutot
inputs from and ok miod@
2011-12-27Follow adduser(8) behaviour (as well as what the pkg tools and ourAntoine Jacoutot
installer do) and do not append the user to its primary group name in /etc/group. ok miod@
2011-12-24-p requires an argument; from Stefan PetterssonJason McIntyre
ok krw
2011-12-04Add a new '-S' option to _set_ the user's secondary group(s) (which alsoAntoine Jacoutot
permits to remove a user from a group). It uses the same syntax as `-G'. In practice this works like `-G' on Linux; it was decided not to modify our `-G' option because people rely on the existing behavior (which works like `-aG' on Linux, i.e. append to group). Reworked from scratch from a submission by Frank Brodbeck. man page bits reviewed by jmc@ ok miod@
2011-07-18Sync user(8) SYNOPSIS to useradd(8) and userinfo(8)Ingo Schwarze
as suggested by Glen Anderson <g dot s dot anderson at gmail dot com>; while here, add a few missing "[,group,...]", do not lump punctuation into .Ar, and drop useless .Li from "..". OK jmc@
2011-04-17improve line breaking in the SYNOPSIS section.Igor Sobrado
as noted by schwarze@, the semantics of the .Bk macro is slightly different now to conform with modern groff releases; using a command-line option (.Op) macro, instead of its multiline version, while preserving the .Bk/.Ek block makes our manual pages compatible with mandoc, new groff and even groff-1.15. ok jmc@, schwarze@
2011-04-16remove trailing whitespace, no binary change.Igor Sobrado
2011-04-16rephrase argument to -g for consistency not only with useradd(8)Igor Sobrado
and usermod(8) but also with the notational conventions used in other manual pages. ok jmc@
2011-04-08- avoid nasty line wrap in SYNOPSISJason McIntyre
- put -G in the right place
2011-04-06Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'Miod Vallat
for chars.
2010-09-19more wacky macro fixing;Jason McIntyre
2010-09-03add an EXIT STATUS section for /usr/sbin;Jason McIntyre
2010-07-26- use warnx instead of warn when skipping large lines, as errno isMiod Vallat
nonsensical in that case (and usually zero). - when altering the groups file, preserve a single "+" line instead of complaining it is incorrect and removing it. ok fgsch@ millert@ ray@
2009-02-08deal with potential empty string fgets can returnCharles Longeau
use strcspn to properly overwrite '\n' in fgets returned buffer ok ray@ jaredy@ looks ok gilles@ long time ago on a similar diff
2009-01-21paragraphs and sentences start with uppercase letters; synchronizeIgor Sobrado
the synopsis and usage of user(8) related commands; sort the options list in the DESCRIPTION section of the manual pages; spacing. ok jmc@
2009-01-19replace standardized text concerning the exit values of applicationsIgor Sobrado
with the right mdoc macros.
2008-12-20- various improvements from Ingo Schwarze;Jason McIntyre
- remove non-functional -v option from docs/usage() feedback/ok millert otto
2008-12-16strptime() never sets tm_isdst, so set it to -1 before passing thePhilip Guenthe
struct tm to mktime() so that the calculation will follow the local DST rules ok millert@ otto@
2008-10-09When adding a new user, do not move a potential yp line (+:*:::0:0::::) to theMiod Vallat
end of the file, for this would make logins coming after the yp line (such as nomadic or fallback accounts) to come back before the yp line and take precedence. Found the hard way installing packages needing a user to be created. ok deraadt@
2007-08-02catch a few truncation cases instead of silently ignoring them. one of theTheo de Raadt
fixes is from pr 5554. ok millert, ray
2007-05-31convert to new .Dd format;Jason McIntyre
2007-04-05remove some extra tests, from charles longeauTed Unangst
2007-03-02Check if group exists before checking if group is local.Ray Lai
OK millert@.
2007-03-02Replace regex(3) routines with simple string searching and comparisonRay Lai
routines. OK millert@.
2007-02-21put -L and -G in the right place;Jason McIntyre
2007-02-21put -G in the right place; from Igor SobradoJason McIntyre
2007-02-06fix some dodgy displays;Jason McIntyre
2007-02-06discuss consistently "the Epoch";Jason McIntyre
2007-01-12Compare against the username, so listing groups when given a numericOtto Moerbeek
user id to userinfo works. From Alf Schlichting; ok millert@
2006-12-20Fix potential buffer overread in function, even though the currentRay Lai
code cannot overflow. Add error checking to protect future code changes and to provide a better example for plagiarizers. OK millert@.
2005-12-31Make useradd -p slightly less dangerous by overwriting the encryptedTodd C. Miller
password in argv. This doesn't solve the problem; it just reduces the amount of time that encrypted password is available via ps. OK deraadt@ and krw@
2005-08-27change default user shell to ksh as well.Theo de Raadt
spotted by matthieu and miod sorry bill, but you stopped just hacking far too long ago..
2005-07-08Don't mistakenly match groups with partial name matches in "usermod -G".Todd C. Miller
Reported and fix confirmed by Maxim Bourmistrov
2005-04-15fix snprintf return value check. ok otto@ millert@Moritz Jodeit
2005-04-13very unlikely overflow. but sticking to the idiom is important: thereby,Theo de Raadt
example by example, we teach people how to actually use snprintf. because it is clear (especially judging by code coming from netbsd hint hint perhaps if i say it like this they will finally learn) that people are not paying attention, and replacing one security problem with another. in the early days we replaced buffer the typical ANSI-C standardized function buffer overflows (by which I mean strcpy, strcat, and sprintf) with non-overflowing ones -- range checking varients. We knew we were fixing a major problem. The damn overflows. But we did not have time in all cases to handle the next problem we were not handling: string truncation. Now we need to (I hope not slowly) start fixing the string truncations. Anyone going to help?
2004-09-30If the yp marker is in the file, add new users before it. PR 3727.Otto Moerbeek
ok deraadt@ millert@
2004-06-26should have updated all of these first - the same wordo in them all.Jason McIntyre
also, section order for usermgmt.conf.5 was wrong.
2004-06-26wordo;Jason McIntyre
2004-06-14Document where we diverge from other implementations (due to differentTodd C. Miller
fields in passwd(5)). OK otto@ a while ago.
2004-06-06clean some lists and displays;Jason McIntyre
2004-06-04Clear up some confusion: -e is account expiry flag, -f is passwordOtto Moerbeek
expiry flag. Resolves PR 3792, though not by changing code, but by changing docs, comments and an error message or two. ok jmc@ millert@
2004-05-10Check return value of fclose() calls after writing.Otto Moerbeek
ok deraadt@ tdeval@
2004-05-10when adding a new group to /etc/groups, place it just before the firstTheo de Raadt
+ entry. assistance from tdeval and otto. this is the first half of pr 3727, brendan@cs.uchicago.edu