Bug 13344

Summary: [PATCH] Reduce pwd_mkdb verbosity for id's > USHRT_MAX
Product: Base System Reporter: Sheldon Hearn <sheldonh>
Component: binAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Sheldon Hearn 1999-08-24 09:20:00 UTC
	The pwd_mkdb(8) program issues one warning for every UID greater
	than USHRT_MAX and one warning for every GID greater than
	USHRT_MAX. Since these messages only warn about the potential
	for legacy software to choke on these ID's, it seems appropriate
	that only one such message be produced for each of the UID and
	GID cases.

Fix: Although I'm tempted to use a simple error message something
	like "one or more uid's are greater than the legacy maximum", I
	think it's best we keep the format of the original message
	intact for the sake of those who have scripts that watch the
	output of pwd_mkdb.

	Therefore, I propose the following change, which I'll commit
	soon unless I receive objections.
How-To-Repeat:  
	Add the following lines with vipw, save and quit:

pwtest97:*:2147483645:31::0:0:Test Account97:/tmp:/sbin/nologin
pwtest98:*:2147483646:31::0:0:Test Account98:/tmp:/sbin/nologin
pwtest99:*:2147483647:31::0:0:Test Account99:/tmp:/sbin/nologin

	The following messages are printed:

pwd_mkdb: 2147483645 > legacy max uid value (65535)
pwd_mkdb: 2147483646 > legacy max uid value (65535)
pwd_mkdb: 2147483647 > legacy max uid value (65535)

	This is annoying with a passwd file containing many thousands of
	entries.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 1999-08-24 09:24:00 UTC
Responsible Changed
From-To: freebsd-ports->sheldonh

Mine. :-) 
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 1999-08-30 12:13:14 UTC
State Changed
From-To: open->closed

Committed and merged to stable with jkh's permission. 
Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 1999-10-01 13:25:15 UTC
State Changed
From-To: closed->open

Changes were backed out on bde's request. I'll tackle this one agagin 
when my POSIX books arrive. :-) 
Comment 4 Sheldon Hearn freebsd_committer freebsd_triage 1999-12-02 16:59:12 UTC
State Changed
From-To: open->suspended

An environment variable test has been added to pw_scan() for the 
existance of PW_SCAN_BIG_IDS.  This envar turns off the warnings 
generated for large IDs by chpass and pwd_mkdb (and therefore 
vipw as well). 

Left in the suspended state for later MFC, which would involve: 

src/usr.sbin/pwd_mkdb/pw_scan.c rev 1.11 and 1.13 
src/usr.sbin/pwd_mkdb/pw_scan.h rev 1.2 
src/usr.sbin/pwd_mkdb/pwd_mkdb.8 rev 1.13 and 1.14 
src/usr.sbin/vipw/vipw.8 rev 1.6 
src/usr.bin/chpass/chpass.1 rev 1.20 

Note that an MFC would not require changes to pwd_mkdb.c . 
Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-27 11:08:12 UTC
State Changed
From-To: suspended->closed

Merged onto the RELENG_3 branch.  Herendethelesson.