'ls -n' opens password file for reading

john.g.young jgy at cbnewsh.ATT.COM
Tue May 16 23:31:19 AEST 1989


Another problem with 'ls' is with nameless userids.  Try creating
a few files with userids which don't have entries in the password
file.  Use the same userid for each, if your password file is of
a reasonable length you will be treated to a considerable delay
between each line of output as ls parses the entire file for each
output line.

Two possible improvements:
	1) ls currently (svr3) remembers the last uid & gid
	searched for an SUCCESFULLY found in the /etc/(passwd|group)
	file.  This "buffer :)" should be enlarged and also include
	unfound ids.
	
	2) This would elliviate the need for a larger buffer;
	use some kind of database system to speed up access to
	the password file (I belive some BSD systems may do this)
	and/or keep it in a shared memory segment (locked in core).
	



More information about the Comp.bugs.sys5 mailing list