[comp.unix.admin] alternative /etc/passwd formats

cameron@usage.csd.oz (Cameron Simpson,Uhmmm..???? Who knows) (09/16/90)

From article <3151@ucsfcca.ucsf.edu>, by dick@cca.ucsf.edu (Dick Karpinski):
| On a different tack, have many people started using some other
| form of storing the data to speed up all access to password 
| information?  Is there some freely available set of software 
| or updates good for one or the other of VAXen running BSD or
| RISC/6000s running AIX?

Well, when I started Uni in '84 we had a couple of PDP11/70s and
a couple of VAXen running a heavily hacked V7 UNIX. /etc/passwd
was an autolocking binary file, and libc had been modified to
know about it... Worked like a charm. Fast. Of course you
couldn't grep /etc/passwd for stuff, but there were a few
extra commands around to get at the info in a nice text
format for scripts or just plain looking around. The PDPs and
one of the VAXen are gone now, but karri still runs it... 
Pete says he wrote the /etc/passwd stuff in '77 or '78.

We currently have about 180 Apollos with 3122 accounts listed.
The Apollos use a loosely coupled database for account information
and /etc/passwd is a special file supported by a subsystem which
generates a standard looking file when you open it for read.
Naturally you can't create account by editting /etc/passwd, but
it's possible to create tools to access the database. They come
with one (edrgy) which gives you access, but it's terribly
interactive (terminally so). I ended up writing a wrapper around
it to provide a subroutine interface to it and then duplicating the
tools we use on karri (above) for account manipulation.

Apollo's approach is the way to go I think. I just wish they'd
document their rgy_$... calls so I could turf my open-pipes-to-
and-from-edrgy approach...

Using a text file when you have more than, say, 50 or 60 users
is a joke.
	- Cameron Simpson
	  cameron@spectrum.cs.unsw.oz.au

guy@auspex.auspex.com (Guy Harris) (09/18/90)

>Well, when I started Uni in '84 we had a couple of PDP11/70s and
>a couple of VAXen running a heavily hacked V7 UNIX. /etc/passwd
>was an autolocking binary file, and libc had been modified to
>know about it... Worked like a charm. Fast. Of course you
>couldn't grep /etc/passwd for stuff,

4.3BSD and later have a similar approach; the difference is that
"/etc/passwd" is *still* a text file, that you can *still* grep, but the
password file that "getpwnam()" and "getpwuid()" get entries from is an
"ndbm" database file.  "vipw" (a misnamed program, it doesn't shove "vi"
down your throat) will rebuild the "dbm" database if you change the
password file with it.

>We currently have about 180 Apollos with 3122 accounts listed.
>The Apollos use a loosely coupled database for account information
>and /etc/passwd is a special file supported by a subsystem which
>generates a standard looking file when you open it for read.

So did they modify "getpwnam()" and "getpwuid()" to talk directly to the
registry, or do they still grovel through said special file?

A similar approach is provided by Sun's NIS and Project Athena's Hesiod,
with a server (an NIS, formerly YP, server in the former case, and an
Internet Domain Name Server such as BIND in the latter case) to which
you send queries.  Both of those make direct queries for "getpwnam()"
and "getpwuid()", rather than fetching every entry from the server and
checking each one.

cameron@usage.csd.oz (Cameron Simpson,Uhmmm..???? Who knows) (09/18/90)

I wrote:
| >Well, when I started Uni in '84 we had a couple of PDP11/70s and
| >a couple of VAXen running a heavily hacked V7 UNIX. /etc/passwd
| >was an autolocking binary file [...] Of course you
| >couldn't grep /etc/passwd for stuff,

From article <4073@auspex.auspex.com>, by guy@auspex.auspex.com (Guy Harris):
|  4.3BSD and later have a similar approach; the difference is that
|  "/etc/passwd" is *still* a text file, that you can *still* grep, but the
|  password file that "getpwnam()" and "getpwuid()" get entries from is an
|  "ndbm" database file.  "vipw" (a misnamed program, it doesn't shove "vi"
|  down your throat) will rebuild the "dbm" database if you change the
|  password file with it.

I don't think dbm existed then :-) This was (is) just a binary file
with indices for uid and login at the front, strings down the back
- we just compact it once a week.

| >We currently have about 180 Apollos with 3122 accounts listed.
| >The Apollos use a loosely coupled database for account information
| >and /etc/passwd is a special file supported by a subsystem which
| >generates a standard looking file when you open it for read.
|  
|  So did they modify "getpwnam()" and "getpwuid()" to talk directly to the
|  registry, or do they still grovel through said special file?

No, they talk directly to the server. And there's some local caching for
when things are bad (infrequent - there are four replicas on our network,
rarely are all four down).
	- Cameron Simpson