Subject: CVS commit: basesrc/usr.sbin/user
To: None <source-changes@netbsd.org>
From: Alistair G. Crooks <agc@netbsd.org>
List: source-changes
Date: 05/03/2002 13:05:30
Module Name:	basesrc
Committed By:	agc
Date:		Fri May  3 10:05:29 UTC 2002

Modified Files:
	basesrc/usr.sbin/user: user.c

Log Message:
Fix from Brian Poole <raj@cerias.purdue.edu> for improper handling of
UID ranges. Previous behaviour is demonstrated below...

# useradd -D
group           users
base_dir        /home
skel_dir        /etc/skel
shell           /bin/csh
class
inactive        0
expire          Null (unset)
range           10200..10300
# useradd -D -r 10200..10300 -r 10400..10500
# useradd -D
group           users
base_dir        /home
skel_dir        /etc/skel
shell           /bin/csh
class
inactive        0
expire          Null (unset)
range           10400..10500

The second command should have put 2 ranges back into the config file,
but it really only put one because the first range on the command line
was marked as a duplicate (but when it got to writing the config file,
it only wrote command line ranges, so the 10200 got skipped).  Fix
this by initializing defrc to 0 and then only looking after defrc for
duplicate ranges.


To generate a diff of this commit:
cvs rdiff -r1.48 -r1.49 basesrc/usr.sbin/user/user.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.