'ls -n' opens password file for reading

Guy Harris guy at auspex.auspex.com
Tue May 16 04:37:09 AEST 1989


>I had never considered this before.  Inspection of inode.h (Xenix 2860
>shows that the inode contains uid & gid, not username and groupname.

Well, you should have looked at "stat.h", since "ls" looks at what it
gets back from "stat" - it doesn't look directly at the inode - but you
get the same answer, and will get it for any other version of UNIX as
well.

>Surely then 'ls -n' is the only version that should work if the files
>ARE missing?????

Yes, but so what?  He said, quite specifically:

	'ls -n' does not need to open any password or group file!

he didn't say anything about "ls" without the "-n" flag or with other
flags.  I presume he has a legitimate reason for wanting to do an "ls
-n" on a system with either "/etc/passwd" or "/etc/group" missing.... 



More information about the Comp.bugs.sys5 mailing list