Subject: Re: BIND/Hesiod
To: Ted Lemon <mellon@fugue.com>
From: Luke Mewburn <lukem@telstra.com.au>
List: current-users
Date: 09/01/1995 09:47:20
Ted Lemon writes:
> I think the best thing to do is something like what you described -
> have an /etc/svc.conf file that determines what database is used - yp,
> bind or file, and then grab the hesiod sources from
> athena-dist.mit.edu and merge them into libc, with a switch that
> determines which database(s) to use and in what order.

Funny you should mention this.

These last 3 days I've been working on a generic nsswitch implementation.
The code uses /var/run/nsswitch.db, which is built by ns_mkdb from
/etc/nsswitch.conf.

Currently, I've provided for 5 sources: FILES, NIS, NISPLUS, DNS,
COMPAT (theoretical maximum of 255) , and 4 actions: SUCCESS, NOTFOUND,
TRYAGAIN, UNAVAIL (theoretical maximum of 24 - it's a bitmask)

The number of database is "unlimited", in that nothing is hardcoded per
se (except that only the first 255 chars are significant.)
You can define your own database type and setup the searce order in
/etc/nsswitch.conf, and then you just setup your dispatch routines
to lookup for that database. (e.g, "printcap", "passwd", "mudlogins",
etc.)

Miscellaneous comments/features to those who may have detractions:
- if the database is corrupt or non-existant, it defaults to "files"
- for those who think that '+' in /etc/passwd is a good idea, the
  "compat" source is provided. If you just use "nis files" (or some
  order like that", then '+' is not a special character.
  ("compat" should only really used by "passwd" and "group")
- the parser is a bit more generous than Solaris 2.x implementation
  (from reading the latter's man page, and deciding that some of the
  limitations sucked big time)
- if a process is running, and the nsswitch.db file is updated,
  changes take effect immediately (a la Ultrix), unlike Solaris 2.x
  which requires you to restart the process...

More info in a few days.

[ I wasn't going to announce an alpha of the backend for another few days
  but your comments forced my hand in revealing it ;-]

-- 
Luke Mewburn <luke.mewburn@itg.telstra.com.au>
(Janov) Pelorat said, "It seems to me, Golan, that the advance of civilization
is nothing but an exercise in the limiting of privacy."
                                             -- `Foundations Edge', Isaac Asimov