Subject: Re: Hesiod thoughts
To: Thor Lancelot Simon <tls@cloud9.net>
From: Simon Burge <simonb@telstra.com.au>
List: current-users
Date: 10/23/1995 13:05:38
On Oct 22, 11:32pm, Thor Lancelot Simon wrote:

> I've been mulling over what it would take to add Hesiod support to NetBSD,
> and I am somewhat unhappy about some of the answers I've come up with.  I'd
> like to hear some suggestions, if anyone has them.

Luke Mewburn (lukem@telstra.com.au) did done some initial work on a
more general interface to all sorts of services a month or two ago.
Have a look in the mailing lists for the subject "nsswitch.conf".

[ snip, snip ]
> The unfeasibility of a getpwent() equivalent, however, raises some nasty issues.
> It would be pretty easy to add Hesiod support to getpwnam() and getpwuid(), I
> think, and that at least should be done.  But there are a lot of programs in
> the source tree that use getpwent -- csh being the most important -- and those
> simply _can't_ work with Hesiod unless rewritten to use getpwnam() or
> getpwuid(), which does at least seem feasible.
> 
> What I think I've come to is the realization that if we're going to add
> Hesiod support to NetBSD, we have to declare getpwent() deprecated, add a
> linker warning like for setreuid(), and excise it from our source tree.

There's the way (I think) that  Ultrix does it.  Basically,  "passwd-0"
is a CNAME for the first password entry, "passwd-1" for the next, and
so on.  getpwent() just cycles through, until you don't get an answer
for "passwd-N".  A little ugly, but it works ok.

> I am not at all convinced that this is bad, though it's a bit more work than
> I thought would be involved, initially.  I don't think it's reasonable to
> assume that all sources of user information will approximate flat files, and
> the fact that Hesiod is the only one currently in use which breaks getpwent()
> doesn't mean that getpwent() use should be in any way encouraged.
> 
> I would be interested to hear what other people think about this subject, and
> also of any legitimate use for getpwent() that can't be worked-around.

I've been playing a little bit with doing printcap support in hesiod,
and had an idea of a "catch-all" TXT record that simply contained the
names of all the other records.  I'm not sure that this would scale
well with limits on the size of TXT records, and sites with, say, a
very large passwd database.

> Thor

Simon.
--
Simon Burge						simonb@telstra.com.au
UNIX Support, CPR Project, Telstra.			+61 3 9634 3974
-------------------------------------------------------------------------------
I've got a can opener at home.  Sometimes it works, and other times it doesn't.
Sometimes it only goes half-way around, and then does a lap of honor - Jimeoin.