develooper Front page | perl.perl5.porters | Postings from April 2008

RE: Change 32200: Leopard has more standard /etc/passwd files than previous

Thread Next
From:
Jan Dubois
Date:
April 4, 2008 18:06
Subject:
RE: Change 32200: Leopard has more standard /etc/passwd files than previous
Message ID:
016b01c896b9$394c3170$abe49450$@com
On Mon, 29 Oct 2007, Rafael Garcia-Suarez wrote:
> 
> Change 32200 by rgs@stcosmo on 2007/10/29 10:49:13
> 
> 	Leopard has more standard /etc/passwd files than previous
> 	versions of darwin. Thanks to David Morel for testing.

I did look at op/pwent.t today (I'm running a subset of 5.6.1 tests
against 5.8.9-tobe), and I noticed that at least the checkin message
above is somewhat misleading:

The /etc/passwd file always had the standard format on OS X, but
op/pwent.t was using /usr/bin/nidump to get at the "real" passwd
information (the /etc/passwd file is only used when you run in single-
user mode, and doesn't include all the local users you add via the
UI). Since nidump is no longer included in 10.5, the test is falling
back to reading /etc/passwd which is in the same format as it is on
other systems.

Since there are more than 25 entries in /etc/passwd on OS X 10.5, these
entries will match the information returned by the DirectoryService and
the test continues to pass. It is not really testing if getpwent() can
retrieve all the actual users on the system though.

I think a proper replacement for reading `nidump passwd .` would be to
parse the output of `dscl . -readall /users`. I won't have time to do
this, but I thought I would at least post the results of my
investigation.

Maybe I should file it as a bug report instead?

Cheers,
-Jan


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About