OpenBSD CVS

CVS log for src/usr.sbin/user/user.c


[BACK] Up to [local] / src / usr.sbin / user

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.131 / (download) - annotate - [select for diffs], Thu May 18 18:29:28 2023 UTC (12 months, 2 weeks ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.130: +101 -31 lines
Diff to previous 1.130 (colored)

user: handle paths with whitespace / metacharacters
Use execv(3) instead of system(3) to run external commands.
This avoids problems with whitespace and shell metacharacters
in path names.  OK op@

Revision 1.130 / (download) - annotate - [select for diffs], Tue May 16 21:28:46 2023 UTC (12 months, 2 weeks ago) by millert
Branch: MAIN
Changes since 1.129: +4 -4 lines
Diff to previous 1.129 (colored)

useradd: use "cp" instead of "pax" to copy dot files
There are some minor semantic differences but nothing that should
affect files in /etc/skel.  OK op@

Revision 1.129 / (download) - annotate - [select for diffs], Mon May 15 17:00:24 2023 UTC (12 months, 2 weeks ago) by millert
Branch: MAIN
Changes since 1.128: +41 -44 lines
Diff to previous 1.128 (colored)

user: simplify memsave() to strsave()
All callers of memsave() pass strlen(s) as the size argument.
We can eliminate the size argument and just use strdup(3) instead.
OK tb@

Revision 1.128 / (download) - annotate - [select for diffs], Thu Oct 17 21:54:29 2019 UTC (4 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.127: +5 -5 lines
Diff to previous 1.127 (colored)

Use -1 to indicate an invalid uid/gid, not UID_MAX and GID_MAX.
This is the userland portion.  OK deraadt@ sashan@

Revision 1.127 / (download) - annotate - [select for diffs], Wed Jul 3 03:24:03 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.126: +2 -2 lines
Diff to previous 1.126 (colored)

snprintf/vsnprintf return < 0 on error, rather than -1.

Revision 1.126 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:51 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.125: +20 -20 lines
Diff to previous 1.125 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Jun 28 05:35:35 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.124: +6 -6 lines
Diff to previous 1.124 (colored)

mkstemp() returns -1 on failure

Revision 1.124 / (download) - annotate - [select for diffs], Mon Dec 31 14:25:00 2018 UTC (5 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.123: +4 -3 lines
Diff to previous 1.123 (colored)

A bad uid range on the command line should be a fatal error.
Based on a diff from Stefan R. Filipek.

Revision 1.123 / (download) - annotate - [select for diffs], Mon Oct 15 18:27:27 2018 UTC (5 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.122: +48 -17 lines
Diff to previous 1.122 (colored)

Use user_from_uid(), uid_from_user(), group_from_gid() and
gid_from_group() when we are only checking whether an entry already
exists.  Fixes crashes caused by the getpw* pointer invalidation
changes.  OK bluhm@

Revision 1.122 / (download) - annotate - [select for diffs], Wed Sep 26 14:54:58 2018 UTC (5 years, 8 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.121: +4 -2 lines
Diff to previous 1.121 (colored)

Fix segfault in usermod -l by swapping one of the getpwnam(3) with
uid_from_user(3). This started happening a few days ago after the change to
the pwcache in libc.

OK millert@

Revision 1.121 / (download) - annotate - [select for diffs], Thu Sep 13 15:23:32 2018 UTC (5 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.120: +2 -2 lines
Diff to previous 1.120 (colored)

Fix warnings caused by user_from_uid() and group_from_gid() now
returning const char *.

Revision 1.120 / (download) - annotate - [select for diffs], Wed May 24 09:18:15 2017 UTC (7 years ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.119: +28 -5 lines
Diff to previous 1.119 (colored)

Remove 2 unused parameters from copydotfiles function
While here sort headers and add missing prototypes

OK tb@

Revision 1.119 / (download) - annotate - [select for diffs], Fri May 12 18:03:00 2017 UTC (7 years ago) by mestre
Branch: MAIN
Changes since 1.118: +4 -4 lines
Diff to previous 1.118 (colored)

Replace memset(3) with explicit_bzero(3) on user(8) on sensitive data
(passwords) as soon as they are not needed on memory anymore.

OK millert@

Revision 1.118 / (download) - annotate - [select for diffs], Wed Nov 30 23:58:07 2016 UTC (7 years, 6 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.117: +4 -4 lines
Diff to previous 1.117 (colored)

Since pwp->pw_gid is equal to pwp->pw_uid then use the former instead in
creategid() function and in the failure message since it makes more sense in
this chunck of code.

OK millert@

Revision 1.117 / (download) - annotate - [select for diffs], Wed Nov 30 22:44:19 2016 UTC (7 years, 6 months ago) by mestre
Branch: MAIN
Changes since 1.116: +6 -1 lines
Diff to previous 1.116 (colored)

Mitigate some fd leaks on user(8)

OK millert@

Revision 1.116 / (download) - annotate - [select for diffs], Wed Nov 30 10:42:38 2016 UTC (7 years, 6 months ago) by mestre
Branch: MAIN
Changes since 1.115: +12 -4 lines
Diff to previous 1.115 (colored)

According to usermod(8) manpage if -g =uid is used it should create a new group
with an unique UID, if it's not already created (not in the manpage), but this
wasn't implemented.
This implements that functionality similar to what NetBSD has, but with some
corrections by adding a fd closure in case of failure and on the failure
message itself which they got it wrong.

OK tb@

Revision 1.115 / (download) - annotate - [select for diffs], Tue Nov 29 16:11:44 2016 UTC (7 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.114: +158 -156 lines
Diff to previous 1.114 (colored)

remove all the (void) casts which are irrelevant.  The remaining ones
should be fixed to do error checks.
ok jsg

Revision 1.114 / (download) - annotate - [select for diffs], Tue Nov 29 09:42:38 2016 UTC (7 years, 6 months ago) by jsg
Branch: MAIN
Changes since 1.113: +3 -2 lines
Diff to previous 1.113 (colored)

Correct a bit test introduced in user.c rev 1.111 that made it impossible
to set a password hash with usermod if an additional flag was specified.

ok mestre@ tom@ jung@

Revision 1.113 / (download) - annotate - [select for diffs], Tue Nov 29 03:59:31 2016 UTC (7 years, 6 months ago) by jsg
Branch: MAIN
Changes since 1.112: +2 -5 lines
Diff to previous 1.112 (colored)

Alistair Crooks rescinded the advertising clause of his user(8)
license in 2005 in NetBSD.

https://mail-index.netbsd.org/source-changes/2005/11/25/0002.html

Revision 1.112 / (download) - annotate - [select for diffs], Wed Aug 10 20:30:34 2016 UTC (7 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.111: +5 -71 lines
Diff to previous 1.111 (colored)

Remove the encrypted password length check.  The admin should be
able to put whatever they like in the encrypted password field,
regardless of whether it can be matched or not.  Having this check
just makes it harder to add new encrypted password functions.
This also fixes "usermode -Z" which was the impetus for the change.
OK benno@

Revision 1.111 / (download) - annotate - [select for diffs], Tue May 3 21:05:14 2016 UTC (8 years, 1 month ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.110: +17 -7 lines
Diff to previous 1.110 (colored)

Fix regression on usermod/userdel by calling getpwnam_shadow(3) and saving
passwd hash early, instead of getpwnam(3), then close fds by calling
endpwent(3) and finally only call pledge(2) after it, otherwise on any
modification to the user it would destroy the passwd hash and therefore
forbidding him/her to login again to the machine.

Reported and tested by Edgar Pettijohn <edgar ! pettijohn-web at com>

According to deraadt@ "that looks better then"

Revision 1.110 / (download) - annotate - [select for diffs], Mon May 2 15:25:03 2016 UTC (8 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.109: +7 -7 lines
Diff to previous 1.109 (colored)

When writing master.password entries, use %lld for time_t and cast
to long long.  OK ajacoutot@

Revision 1.109 / (download) - annotate - [select for diffs], Tue Apr 26 13:30:12 2016 UTC (8 years, 1 month ago) by mestre
Branch: MAIN
Changes since 1.108: +36 -1 lines
Diff to previous 1.108 (colored)

Add pledge(2) promises independently on each user(8)'s functions as follows:

useradd:	stdio rpath wpath cpath fattr flock proc exec getpw id
usermod:	stdio rpath wpath cpath fattr flock proc exec getpw id
userdel:	stdio rpath wpath cpath fattr flock proc exec getpw id
userinfo:	stdio getpw
groupadd:	stdio rpath wpath cpath fattr flock getpw
groupmod:	stdio rpath wpath cpath fattr flock
groupdel:	stdio rpath wpath cpath fattr flock
groupinfo:	stdio getpw

This was extensively tested by me and tim@ who found some issues on my first
versions. deraadt@ prodded me to commit this now to check who uses it in order
to report back any fallbacks with the diff, if you find any please inform us.

Revision 1.108 / (download) - annotate - [select for diffs], Tue Mar 29 17:21:50 2016 UTC (8 years, 2 months ago) by mestre
Branch: MAIN
Changes since 1.107: +2 -3 lines
Diff to previous 1.107 (colored)

If program cannot reserve memory then the user doesn't need to know exactly how
many bytes it couldn't allocate

Suggested and OK from natano@ and millert@ also agrees

Revision 1.107 / (download) - annotate - [select for diffs], Tue Mar 29 13:32:54 2016 UTC (8 years, 2 months ago) by mestre
Branch: MAIN
Changes since 1.106: +14 -19 lines
Diff to previous 1.106 (colored)

-Remove function #defines from defs.h and use the actual code accordingly in
user.c
-Remove MIN and MAX #defines which are not being in use since the last 16 years
-Move last #define to user.c and remove file defs.h
-Remove lint comments

OK natano@ after his suggestions and also OK jung@ on an earlier version

Revision 1.106 / (download) - annotate - [select for diffs], Mon Mar 28 19:42:51 2016 UTC (8 years, 2 months ago) by mestre
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

Remove cast from free(3)

OK gsoares@

Revision 1.105 / (download) - annotate - [select for diffs], Mon Mar 28 19:09:08 2016 UTC (8 years, 2 months ago) by mestre
Branch: MAIN
Changes since 1.104: +6 -14 lines
Diff to previous 1.104 (colored)

Remove handrolled #define FREE and use free(3) directly without wrapping
if (ptr!=NULL) around them since they are not needed.

OK millert@ and jung@

Revision 1.104 / (download) - annotate - [select for diffs], Sun Nov 15 23:13:20 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.103: +5 -5 lines
Diff to previous 1.103 (colored)

Really silly to chmod "st_mode & 07777" when making a copy of the
group file, like entirely missing the point.
ok jca

Revision 1.103 / (download) - annotate - [select for diffs], Fri Apr 24 08:08:29 2015 UTC (9 years, 1 month ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.102: +2 -2 lines
Diff to previous 1.102 (colored)

read_defaults has the thing for strtonum to chew on in cp, not
optarg.

fixes a segfault introduced by the atoi to strtonum change and
reported by ajacatout@

Revision 1.102 / (download) - annotate - [select for diffs], Thu Apr 23 17:11:42 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.101: +61 -71 lines
Diff to previous 1.101 (colored)

Replace atoi() usage with strtonum().  OK deraadt@

Revision 1.101 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:22 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.100: +4 -3 lines
Diff to previous 1.100 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.99.4.1 / (download) - annotate - [select for diffs], Wed Nov 5 20:05:06 2014 UTC (9 years, 6 months ago) by tedu
Branch: OPENBSD_5_6
Changes since 1.99: +8 -5 lines
Diff to previous 1.99 (colored) next main 1.100 (colored)

backport 1.100: support for $2b$ hashes. ok deraadt

Revision 1.100 / (download) - annotate - [select for diffs], Wed Aug 27 06:51:35 2014 UTC (9 years, 9 months ago) by sebastia
Branch: MAIN
Changes since 1.99: +8 -5 lines
Diff to previous 1.99 (colored)

Add missing capability to handle new $2b version of blowfish password
encryption for usermod and friends.

OK millert@, seems reasonable for now tedu@

Revision 1.99 / (download) - annotate - [select for diffs], Sun Jul 20 01:38:40 2014 UTC (9 years, 10 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE
Branch point for: OPENBSD_5_6
Changes since 1.98: +63 -39 lines
Diff to previous 1.98 (colored)

Make sure the correct errno is reported by warn* or err* and not
the errno of an intervening cleanup operation like close/unlink/etc.

Diff from Doug Hogan (doug (at) acyclic.org)

Revision 1.98 / (download) - annotate - [select for diffs], Sat Nov 23 17:14:05 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.97: +16 -14 lines
Diff to previous 1.97 (colored)

unsigned char casts for ctype; ok jca

Revision 1.97 / (download) - annotate - [select for diffs], Tue Sep 10 20:53:09 2013 UTC (10 years, 8 months ago) by millert
Branch: MAIN
Changes since 1.96: +6 -3 lines
Diff to previous 1.96 (colored)

Move the chown and chmod out of copydotfiles() and add an explicit
check for skeldir set to the empty string.  Fixes a problem where
the owner/mode is not set on the user's homedir if the specified
skeldir does not exist.  OK ajacoutot@

Revision 1.96 / (download) - annotate - [select for diffs], Tue Aug 6 21:33:03 2013 UTC (10 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.95: +13 -13 lines
Diff to previous 1.95 (colored)

Write uids/gids as unsigned in the passwd file and error messages.
This matches what pw_scan() expects.  OK deraadt@

Revision 1.95 / (download) - annotate - [select for diffs], Tue Apr 2 05:04:47 2013 UTC (11 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored)

for parsing time values, fall back to atoll() for time_t
ok guenther

Revision 1.94 / (download) - annotate - [select for diffs], Mon Mar 4 07:24:52 2013 UTC (11 years, 3 months ago) by ajacoutot
Branch: MAIN
Changes since 1.93: +9 -4 lines
Diff to previous 1.93 (colored)

When locking/unlocking an account, never touch passwords that are "*"
or 13*. Also make sure to never endup with an empty password.

cluebat and ok miod@

Revision 1.93 / (download) - annotate - [select for diffs], Sat Feb 16 07:25:54 2013 UTC (11 years, 3 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.92: +6 -4 lines
Diff to previous 1.92 (colored)

Fix unlocking on 32bits arch where it would fuck up the shell...
Do not try to (un)lock system users; people wanting to do so (???) will
know what they do and use vipw(8).

unlocking issue reported by Andre Stobe on tech@
cluesticks and ok miod@, ok deraadt@

Revision 1.92 / (download) - annotate - [select for diffs], Thu Sep 20 11:32:06 2012 UTC (11 years, 8 months ago) by ajacoutot
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

Be consistent with what the installer and useradd(8) do and put newly
created users into their own primary group.
This does not change existing installations that already have a
usermgmt.conf(5).

ok todd@ beck@

Revision 1.91 / (download) - annotate - [select for diffs], Tue Sep 18 07:56:11 2012 UTC (11 years, 8 months ago) by ajacoutot
Branch: MAIN
Changes since 1.90: +93 -4 lines
Diff to previous 1.90 (colored)

Add 2 new knobs to usermod(8):
-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@

Revision 1.90 / (download) - annotate - [select for diffs], Sun Jan 29 08:38:54 2012 UTC (12 years, 4 months ago) by ajacoutot
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.89: +2 -2 lines
Diff to previous 1.89 (colored)

fix previous: grp is unused here just check the return value
spotted by Jeremie Courreges-Anglas

Revision 1.89 / (download) - annotate - [select for diffs], Sat Jan 28 14:25:45 2012 UTC (12 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.88: +13 -13 lines
Diff to previous 1.88 (colored)

Make it possible to remove a user from all secondary groups by using:
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@

Revision 1.88 / (download) - annotate - [select for diffs], Sat Jan 28 10:20:01 2012 UTC (12 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.87: +13 -3 lines
Diff to previous 1.87 (colored)

When setting the groups (`-S'), make sure all provided groups exist in
the system otherwise we may end up removing all groups from a user.

ok miod@

Revision 1.87 / (download) - annotate - [select for diffs], Thu Jan 12 18:35:07 2012 UTC (12 years, 4 months ago) by ajacoutot
Branch: MAIN
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored)

fgets(3) returns a pointer, so compare against NULL, not integer 0.

from Michael W. Bombardieri
ok miod@

Revision 1.86 / (download) - annotate - [select for diffs], Sat Dec 31 14:05:51 2011 UTC (12 years, 5 months ago) by ajacoutot
Branch: MAIN
Changes since 1.85: +7 -125 lines
Diff to previous 1.85 (colored)

Remove the EXTENSIONS ifdef danse; it might have made sense in the past
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@

Revision 1.85 / (download) - annotate - [select for diffs], Fri Dec 30 08:39:02 2011 UTC (12 years, 5 months ago) by ajacoutot
Branch: MAIN
Changes since 1.84: +2 -2 lines
Diff to previous 1.84 (colored)

Fix a warning.

inputs from and ok miod@

Revision 1.84 / (download) - annotate - [select for diffs], Tue Dec 27 08:29:38 2011 UTC (12 years, 5 months ago) by ajacoutot
Branch: MAIN
Changes since 1.83: +17 -2 lines
Diff to previous 1.83 (colored)

Follow adduser(8) behaviour (as well as what the pkg tools and our
installer do) and do not append the user to its primary group name in
/etc/group.

ok miod@

Revision 1.83 / (download) - annotate - [select for diffs], Sat Dec 24 07:17:04 2011 UTC (12 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.82: +3 -2 lines
Diff to previous 1.82 (colored)

-p requires an argument; from Stefan Pettersson
ok krw

Revision 1.82 / (download) - annotate - [select for diffs], Sun Dec 4 08:28:35 2011 UTC (12 years, 6 months ago) by ajacoutot
Branch: MAIN
Changes since 1.81: +30 -6 lines
Diff to previous 1.81 (colored)

Add a new '-S' option to _set_ the user's secondary group(s) (which also
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@

Revision 1.81 / (download) - annotate - [select for diffs], Sat Apr 16 07:41:08 2011 UTC (13 years, 1 month ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.80: +6 -6 lines
Diff to previous 1.80 (colored)

remove trailing whitespace, no binary change.

Revision 1.80 / (download) - annotate - [select for diffs], Fri Apr 8 18:13:53 2011 UTC (13 years, 1 month ago) by jmc
Branch: MAIN
Changes since 1.79: +4 -4 lines
Diff to previous 1.79 (colored)

- avoid nasty line wrap in SYNOPSIS
- put -G in the right place

Revision 1.79 / (download) - annotate - [select for diffs], Wed Apr 6 11:36:26 2011 UTC (13 years, 2 months ago) by miod
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'
for chars.

Revision 1.78 / (download) - annotate - [select for diffs], Mon Jul 26 10:55:17 2010 UTC (13 years, 10 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.77: +24 -16 lines
Diff to previous 1.77 (colored)

- use warnx instead of warn when skipping large lines, as errno is
  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@

Revision 1.77 / (download) - annotate - [select for diffs], Sun Feb 8 11:37:43 2009 UTC (15 years, 3 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.76: +7 -7 lines
Diff to previous 1.76 (colored)

deal with potential empty string fgets can return
use strcspn to properly overwrite '\n' in fgets returned buffer

ok ray@ jaredy@
looks ok gilles@ long time ago on a similar diff

Revision 1.76 / (download) - annotate - [select for diffs], Wed Jan 21 16:56:02 2009 UTC (15 years, 4 months ago) by sobrado
Branch: MAIN
Changes since 1.75: +26 -18 lines
Diff to previous 1.75 (colored)

paragraphs and sentences start with uppercase letters; synchronize
the synopsis and usage of user(8) related commands; sort the options
list in the DESCRIPTION section of the manual pages; spacing.

ok jmc@

Revision 1.75 / (download) - annotate - [select for diffs], Sat Dec 20 09:40:47 2008 UTC (15 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored)

- various improvements from Ingo Schwarze;
- remove non-functional -v option from docs/usage()

feedback/ok millert otto

Revision 1.74 / (download) - annotate - [select for diffs], Tue Dec 16 05:25:55 2008 UTC (15 years, 5 months ago) by guenther
Branch: MAIN
Changes since 1.73: +2 -1 lines
Diff to previous 1.73 (colored)

strptime() never sets tm_isdst, so set it to -1 before passing the
struct tm to mktime() so that the calculation will follow the local
DST rules

ok millert@ otto@

Revision 1.73 / (download) - annotate - [select for diffs], Thu Oct 9 21:10:08 2008 UTC (15 years, 7 months ago) by miod
Branch: MAIN
Changes since 1.72: +24 -2 lines
Diff to previous 1.72 (colored)

When adding a new user, do not move a potential yp line (+:*:::0:0::::) to the
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@

Revision 1.72 / (download) - annotate - [select for diffs], Thu Aug 2 16:18:05 2007 UTC (16 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.71: +18 -5 lines
Diff to previous 1.71 (colored)

catch a few truncation cases instead of silently ignoring them.  one of the
fixes is from pr 5554.  ok millert, ray

Revision 1.71 / (download) - annotate - [select for diffs], Thu Apr 5 01:34:57 2007 UTC (17 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.70: +11 -11 lines
Diff to previous 1.70 (colored)

remove some extra tests, from charles longeau

Revision 1.70 / (download) - annotate - [select for diffs], Fri Mar 2 04:27:11 2007 UTC (17 years, 3 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.69: +4 -4 lines
Diff to previous 1.69 (colored)

Check if group exists before checking if group is local.

OK millert@.

Revision 1.69 / (download) - annotate - [select for diffs], Fri Mar 2 04:23:35 2007 UTC (17 years, 3 months ago) by ray
Branch: MAIN
Changes since 1.68: +21 -25 lines
Diff to previous 1.68 (colored)

Replace regex(3) routines with simple string searching and comparison
routines.

OK millert@.

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jan 12 13:25:12 2007 UTC (17 years, 4 months ago) by otto
Branch: MAIN
Changes since 1.67: +3 -2 lines
Diff to previous 1.67 (colored)

Compare against the username, so listing groups when given a numeric
user id to userinfo works. From Alf Schlichting; ok millert@

Revision 1.67 / (download) - annotate - [select for diffs], Wed Dec 20 01:58:46 2006 UTC (17 years, 5 months ago) by ray
Branch: MAIN
Changes since 1.66: +6 -3 lines
Diff to previous 1.66 (colored)

Fix potential buffer overread in function, even though the current
code cannot overflow.  Add error checking to protect future code
changes and to provide a better example for plagiarizers.

OK millert@.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Dec 31 19:20:49 2005 UTC (18 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.65: +3 -1 lines
Diff to previous 1.65 (colored)

Make useradd -p slightly less dangerous by overwriting the encrypted
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@

Revision 1.65 / (download) - annotate - [select for diffs], Sat Aug 27 23:12:36 2005 UTC (18 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.64: +2 -2 lines
Diff to previous 1.64 (colored)

change default user shell to ksh as well.
spotted by matthieu and miod
sorry bill, but you stopped just hacking far too long ago..

Revision 1.64 / (download) - annotate - [select for diffs], Fri Jul 8 18:58:32 2005 UTC (18 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.63: +4 -2 lines
Diff to previous 1.63 (colored)

Don't mistakenly match groups with partial name matches in "usermod -G".
Reported and fix confirmed by Maxim Bourmistrov

Revision 1.63 / (download) - annotate - [select for diffs], Fri Apr 15 16:27:31 2005 UTC (19 years, 1 month ago) by moritz
Branch: MAIN
Changes since 1.62: +2 -2 lines
Diff to previous 1.62 (colored)

fix snprintf return value check. ok otto@ millert@

Revision 1.62 / (download) - annotate - [select for diffs], Wed Apr 13 03:46:28 2005 UTC (19 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.61: +6 -1 lines
Diff to previous 1.61 (colored)

very unlikely overflow.  but sticking to the idiom is important:  thereby,
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?

Revision 1.61 / (download) - annotate - [select for diffs], Thu Sep 30 15:07:41 2004 UTC (19 years, 8 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.60: +32 -5 lines
Diff to previous 1.60 (colored)

If the yp marker is in the file, add new users before it. PR 3727.
ok deraadt@ millert@

Revision 1.60 / (download) - annotate - [select for diffs], Fri Jun 4 18:04:21 2004 UTC (20 years ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.59: +6 -6 lines
Diff to previous 1.59 (colored)

Clear up some confusion: -e is account expiry flag, -f is password
expiry flag. Resolves PR 3792, though not by changing code, but by
changing docs, comments and an error message or two.
ok jmc@ millert@

Revision 1.59 / (download) - annotate - [select for diffs], Mon May 10 18:41:11 2004 UTC (20 years ago) by otto
Branch: MAIN
Changes since 1.58: +21 -5 lines
Diff to previous 1.58 (colored)

Check return value of fclose() calls after writing.
ok deraadt@ tdeval@

Revision 1.58 / (download) - annotate - [select for diffs], Mon May 10 09:44:45 2004 UTC (20 years ago) by deraadt
Branch: MAIN
Changes since 1.57: +21 -8 lines
Diff to previous 1.57 (colored)

when adding a new group to /etc/groups, place it just before the first
+ entry.  assistance from tdeval and otto.  this is the first half of
pr 3727, brendan@cs.uchicago.edu

Revision 1.57 / (download) - annotate - [select for diffs], Mon Apr 19 17:48:31 2004 UTC (20 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.56: +3 -2 lines
Diff to previous 1.56 (colored)

Don't complain when the /nonexistent homedir does not exist.
Based on a patch from Sam Smith.  henning@ OK

Revision 1.56 / (download) - annotate - [select for diffs], Thu Feb 26 21:18:18 2004 UTC (20 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.55: +41 -32 lines
Diff to previous 1.55 (colored)

Avoid using regexp when removing a user from /etc/group entries in
userdel since a username may contain regexp special chars.

Fix a memory leak on error and chmod before moving the new group
file is moved into place instead of after.

Saner error messages in rm_user_from_groups() (cut & pastos)

OK deraadt@, tdeval@ and otto@; error message fixes courtesy of otto@

Revision 1.55 / (download) - annotate - [select for diffs], Sat Jan 3 18:30:39 2004 UTC (20 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.54: +16 -13 lines
Diff to previous 1.54 (colored)

Replace bogus use of fgetln() (which doesn't NUL-terminate strings)
with fgets() (which does).  Using fgetln() doesn't make a huge amount
of sense since passwd entries are required to be short and mustn't contain
NULs.  This also fixes a bus error on sparc64 (caused by passing a pointer
to an int when a pointer to size_t was expected) found by pvalchev@.
Tested and OK pvalchev@

Revision 1.54 / (download) - annotate - [select for diffs], Thu Dec 25 10:23:57 2003 UTC (20 years, 5 months ago) by grange
Branch: MAIN
Changes since 1.53: +3 -3 lines
Diff to previous 1.53 (colored)

Fix multi-line string
ok otto@

Revision 1.53 / (download) - annotate - [select for diffs], Wed Dec 24 20:15:58 2003 UTC (20 years, 5 months ago) by otto
Branch: MAIN
Changes since 1.52: +23 -8 lines
Diff to previous 1.52 (colored)

Fix bound checks for gecos field, taking into account it may contain
multiple '&'s. Resolves PR 3616.

ok deraadt@

Revision 1.52 / (download) - annotate - [select for diffs], Sat Jun 14 22:12:53 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.51: +9 -7 lines
Diff to previous 1.51 (colored)

For moduser(), only do valid_class() check when F_CLASS is set in
up->u_flags.  Fixes a coredump when changing/deleting an existing
user introduced by my recent commit here.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Jun 10 21:00:37 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.50: +27 -1 lines
Diff to previous 1.50 (colored)

Check that login class exists before using it; based on a patch from
Peter Werner.  Closes PR 2699.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Jun 10 20:52:01 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.49: +42 -26 lines
Diff to previous 1.49 (colored)

o Check for fwrite() error with != 1, not <= 0 (mostly style)
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

Revision 1.49 / (download) - annotate - [select for diffs], Tue Jun 10 20:27:31 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.48: +102 -67 lines
Diff to previous 1.48 (colored)

Keep a table of password types, and their associated lengths, and
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)

Revision 1.48 / (download) - annotate - [select for diffs], Tue Jun 10 20:03:56 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.47: +32 -8 lines
Diff to previous 1.47 (colored)

Use syslog(3) to log new users and groups, deletions of users and groups,
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)

Revision 1.47 / (download) - annotate - [select for diffs], Tue Jun 10 19:51:22 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.46: +26 -2 lines
Diff to previous 1.46 (colored)

Catch illegal flags and reply with usage; from NetBSD (agc)

Revision 1.46 / (download) - annotate - [select for diffs], Tue Jun 10 19:45:56 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.45: +151 -33 lines
Diff to previous 1.45 (colored)

o rename login variable to login_name
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)

Revision 1.45 / (download) - annotate - [select for diffs], Sun Jun 8 23:04:36 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.44: +70 -24 lines
Diff to previous 1.44 (colored)

user -e and -f now accepts "month day year" (ala chpass(1)) and
seconds-since-epoch.  From NetBSD (grant).

Revision 1.44 / (download) - annotate - [select for diffs], Sun Jun 8 20:50:51 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.43: +7 -5 lines
Diff to previous 1.43 (colored)

Add check for group too long and made an invalid group a fatal error
instead of just a warning which is consistent with the way an invalid
user is treated.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jun 8 20:43:25 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

Use _PW_NAME_LEN not MAXLOGNAME since the latter does not include the NUL.

Revision 1.42 / (download) - annotate - [select for diffs], Tue May 13 01:12:31 2003 UTC (21 years ago) by millert
Branch: MAIN
Changes since 1.41: +5 -1 lines
Diff to previous 1.41 (colored)

Don't allow usernames to begin with a dash since pwd_mkdb(8)
will reject such a name; from Brian Poole

Revision 1.41 / (download) - annotate - [select for diffs], Thu Apr 3 16:03:06 2003 UTC (21 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

The check for whether or not a group is empty was busted.  Closes PR 3178.

Revision 1.40 / (download) - annotate - [select for diffs], Tue Dec 10 20:49:28 2002 UTC (21 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.39: +29 -26 lines
Diff to previous 1.39 (colored)

Add 2 missing pw_abort() calls when pw_mkdb() fails and remove the
void cast from pw_abort() since it is already void.
From NetBSD via Brian Poole.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Nov 7 22:05:43 2002 UTC (21 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.38: +5 -1 lines
Diff to previous 1.38 (colored)

Check for non-existent group in groupdel just like userdel; Sebastian Stark

Revision 1.38 / (download) - annotate - [select for diffs], Thu Nov 7 22:02:18 2002 UTC (21 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.37: +13 -12 lines
Diff to previous 1.37 (colored)

Change some err/warn -> errx/warnx.  Should maybe do the same for
the short write cases.

Revision 1.37 / (download) - annotate - [select for diffs], Thu Nov 7 21:49:31 2002 UTC (21 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.36: +4 -2 lines
Diff to previous 1.36 (colored)

Allow '$' in a username as long as it is the last character since
samba wants to create usernames that end in '$'.  From Paul Chakravarti

Revision 1.36 / (download) - annotate - [select for diffs], Thu Jul 25 15:41:39 2002 UTC (21 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.35: +32 -33 lines
Diff to previous 1.35 (colored)

Check snprintf() rval for < 0; OK deraadt@

Revision 1.35 / (download) - annotate - [select for diffs], Sun Jun 9 22:12:57 2002 UTC (21 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.34: +3 -1 lines
Diff to previous 1.34 (colored)

When checking for valid login names, check length against MaxUserNameLen.
Noticed by Brian Poole who supplied a different patch.

Revision 1.34 / (download) - annotate - [select for diffs], Fri May 17 04:07:50 2002 UTC (22 years ago) by millert
Branch: MAIN
Changes since 1.33: +7 -5 lines
Diff to previous 1.33 (colored)

When modifying a group w/ no members with groupmod(8) the trailing
newline was not added.  Reported by Rob Sessink, different fix by me.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Apr 4 18:39:32 2002 UTC (22 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.32: +5 -2 lines
Diff to previous 1.32 (colored)

From Brian Poole:
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.

Revision 1.32 / (download) - annotate - [select for diffs], Wed Apr 3 22:35:26 2002 UTC (22 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.31: +21 -5 lines
Diff to previous 1.31 (colored)

UID ranges specified on the command line were being overridden by
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.

Revision 1.31 / (download) - annotate - [select for diffs], Thu Mar 14 06:51:42 2002 UTC (22 years, 2 months ago) by mpech
Branch: MAIN
Changes since 1.30: +3 -3 lines
Diff to previous 1.30 (colored)

Remove \n from err/errx/warn/warnx().

millert@ ok

Revision 1.30 / (download) - annotate - [select for diffs], Tue Mar 5 17:30:15 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.29: +2 -1 lines
Diff to previous 1.29 (colored)

'user -D -k path' was not actually changing the default values unless another
option to change was specified.  Also fix man page formatting mistake.
From Brian Poole

Revision 1.29 / (download) - annotate - [select for diffs], Wed Dec 5 18:23:55 2001 UTC (22 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.28: +10 -8 lines
Diff to previous 1.28 (colored)

Minor sync with NetBSD
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

Revision 1.28 / (download) - annotate - [select for diffs], Wed Dec 5 18:20:57 2001 UTC (22 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.27: +47 -40 lines
Diff to previous 1.27 (colored)

o Use proper uid_t and gid_t types and fixup printf format strings to match
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...

Revision 1.27 / (download) - annotate - [select for diffs], Thu Nov 15 20:09:08 2001 UTC (22 years, 6 months ago) by danh
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

fix password length check; allows usermod -p to work again.

ok millert@

Revision 1.26 / (download) - annotate - [select for diffs], Thu Nov 8 23:26:45 2001 UTC (22 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.25: +21 -26 lines
Diff to previous 1.25 (colored)

Replace unreadable snprintf() and pointer arithmetic with simple strlcat().

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.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Sep 18 01:50:44 2001 UTC (22 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.24: +516 -356 lines
Diff to previous 1.24 (colored)

Sync with NetBSD plus the following changes:
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

Revision 1.24 / (download) - annotate - [select for diffs], Thu Aug 16 18:29:27 2001 UTC (22 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

extra arg to pw_mkdb

Revision 1.23 / (download) - annotate - [select for diffs], Sat Mar 24 19:27:18 2001 UTC (23 years, 2 months ago) by jakob
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

cleanup error message

Revision 1.22 / (download) - annotate - [select for diffs], Sat Mar 24 19:24:07 2001 UTC (23 years, 2 months ago) by jakob
Branch: MAIN
Changes since 1.21: +3 -1 lines
Diff to previous 1.21 (colored)

fix usage when called as invalid binary name; <raj@cerias.purdue.edu>

Revision 1.21 / (download) - annotate - [select for diffs], Sat Mar 24 19:21:33 2001 UTC (23 years, 2 months ago) by jakob
Branch: MAIN
Changes since 1.20: +3 -2 lines
Diff to previous 1.20 (colored)

fix multiple UID ranges; <raj@cerias.purdue.edu>

Revision 1.20 / (download) - annotate - [select for diffs], Sat Mar 24 19:20:51 2001 UTC (23 years, 2 months ago) by jakob
Branch: MAIN
Changes since 1.19: +3 -3 lines
Diff to previous 1.19 (colored)

fix strlcpy; <raj@cerias.purdue.edu>

Revision 1.19 / (download) - annotate - [select for diffs], Tue Feb 13 09:18:33 2001 UTC (23 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.18: +2 -3 lines
Diff to previous 1.18 (colored)

rely on constants; ianm@cit.uws.edu.au

Revision 1.13.2.3 / (download) - annotate - [select for diffs], Wed Nov 29 02:43:27 2000 UTC (23 years, 6 months ago) by jason
Branch: OPENBSD_2_7
Changes since 1.13.2.2: +9 -3 lines
Diff to previous 1.13.2.2 (colored) to branchpoint 1.13 (colored) next main 1.14 (colored)

Pull in change from current:
Fix (ho):
When modifying users and not specifying a new GID, don't arbitrarily
reset it to the default GID, keep the old one.
Further, when given a new home dir, actually use it.
Fixes PR #1318.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Nov 26 01:29:42 2000 UTC (23 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.17: +7 -3 lines
Diff to previous 1.17 (colored)

Update for pw_mkdb(3) interface change.  All but vipw and userdel can
specify a username (and thus avoid rebuilding the while database).

Revision 1.17 / (download) - annotate - [select for diffs], Sat Jul 15 08:31:54 2000 UTC (23 years, 10 months ago) by ho
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.16: +9 -3 lines
Diff to previous 1.16 (colored)

When modifying users and not specifying a new GID, don't arbitrarily
reset it to the default GID, keep the old one.
Further, when given a new home dir, actually use it.
Fixes PR #1318.

Revision 1.13.2.2 / (download) - annotate - [select for diffs], Wed Jul 12 13:55:23 2000 UTC (23 years, 10 months ago) by jason
Branch: OPENBSD_2_7
Changes since 1.13.2.1: +7 -7 lines
Diff to previous 1.13.2.1 (colored) to branchpoint 1.13 (colored)

Pull in patch from current:
Fix (ho):
Don't write password lines longer than 1023 chars.
Change two instances of err() to errx().

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jul 6 09:23:30 2000 UTC (23 years, 11 months ago) by ho
Branch: MAIN
Changes since 1.15: +7 -7 lines
Diff to previous 1.15 (colored)

Don't write password lines longer than 1023 chars.
Change two instances of err() to errx().

Revision 1.13.2.1 / (download) - annotate - [select for diffs], Sun Jun 18 03:40:12 2000 UTC (23 years, 11 months ago) by jason
Branch: OPENBSD_2_7
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Pull in patch from current:
Errata:
user mod -G www pete #blows away home dir in /etc/passwd
Fix (ho):
Fix PR 1279

Revision 1.15 / (download) - annotate - [select for diffs], Fri Jun 16 07:17:39 2000 UTC (23 years, 11 months ago) by ho
Branch: MAIN
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

Fix PR 1279.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jun 9 16:34:24 2000 UTC (23 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

chown has moved to /sbin

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 5 23:54:51 2000 UTC (24 years, 1 month ago) by ho
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE
Branch point for: OPENBSD_2_7
Changes since 1.12: +11 -10 lines
Diff to previous 1.12 (colored)

Forgot to update usage().

Revision 1.12 / (download) - annotate - [select for diffs], Fri May 5 23:22:39 2000 UTC (24 years, 1 month ago) by ho
Branch: MAIN
Changes since 1.11: +144 -5 lines
Diff to previous 1.11 (colored)

Make -G flag work for user{add,mod}.

Revision 1.11 / (download) - annotate - [select for diffs], Fri May 5 12:33:51 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.10: +18 -3 lines
Diff to previous 1.10 (colored)

limit size of a password file entry (including &-expansion)
replace a couple of strcpy with strlcpy

Revision 1.10 / (download) - annotate - [select for diffs], Thu May 4 22:56:52 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.9: +21 -19 lines
Diff to previous 1.9 (colored)

use _PASSWORD_LEN constant
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@.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Apr 26 06:27:57 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.8: +21 -21 lines
Diff to previous 1.8 (colored)

make usage readable on a console; eric jackson <shinobi@monkey.org>

Revision 1.8 / (download) - annotate - [select for diffs], Mon Apr 24 23:11:14 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

default to non-verbose (previously undefined)

Revision 1.7 / (download) - annotate - [select for diffs], Mon Apr 24 22:59:25 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.6: +1 -3 lines
Diff to previous 1.6 (colored)

include cleanup

Revision 1.6 / (download) - annotate - [select for diffs], Mon Apr 24 22:52:36 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.5: +25 -33 lines
Diff to previous 1.5 (colored)

use _PATH_MASTERPASSWD & _PATH_GROUP

Revision 1.5 / (download) - annotate - [select for diffs], Mon Apr 24 22:40:11 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.4: +7 -2 lines
Diff to previous 1.4 (colored)

fix usage when building with EXTENSIONS

Revision 1.4 / (download) - annotate - [select for diffs], Mon Apr 24 22:38:31 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.3: +1 -3 lines
Diff to previous 1.3 (colored)

is_number() is needed even without EXTENSIONS defined

Revision 1.3 / (download) - annotate - [select for diffs], Mon Apr 24 22:37:15 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.2: +2 -27 lines
Diff to previous 1.2 (colored)

remove lint stuff. remove unneeded strlcpy.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Apr 24 22:31:29 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN
Changes since 1.1: +1 -0 lines
Diff to previous 1.1 (colored)

id-tags

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Mon Apr 24 22:27:00 2000 UTC (24 years, 1 month ago) by jakob
Branch: NetBSD
CVS Tags: NetBSD-20000425
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

Initial import of user/group management tools from NetBSD.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Apr 24 22:27:00 2000 UTC (24 years, 1 month ago) by jakob
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.