Subject: nsswitch implementation available for alpha testing
To: None <current-users@NetBSD.ORG>
From: Luke Mewburn <lukem@telstra.com.au>
List: current-users
Date: 12/19/1995 18:16:47
As some of you may be aware, I've been mentioning for quite some time
now that I've been working on an nsswitch implementation for NetBSD.

Well, I've got it to the stage where I'm happy to release it for alpha
testing (well, beta testing - I know the code works and my current
shared libc is running the code, with Hesiod for passwd & group
working fine.)

The code is available at:
	netbsd.rmit.edu.au:/pub/werj/nsswitch/*
as 4 context diff files, for applying against a NetBSD 1.1 source tree.
You should probably mkdir /usr/src/usr.sbin/{hesinfo,ns_mkdb} before
applying the usrsbin.difs patch.

To use, patch, compile, install. Create /etc/nsswitch.conf according
to the nsswitch.conf(5) man page. Run "ns_mkdb -v" to create the 
/etc/nsswitch.db database.

Please send back any comments or bugs to me ASAP - I'd like to get
this to "release" status sometime soon.

The following databases & sources are implemented:
	database		source
	--------		------
	passwd			files, dns, nis, compat (1)
	passwd_compat		dns, nis
	group			files, dns, nis, compat (1)
	group_compat		dns, nis
	hosts			files, dns, nis
	netgroup		files, nis
	shells			files, dns, nis (2)

(1) compat mode is where '+' in passwd/group is used. The appropriate
    "xxx_compat" database specifies where user names referred to after
    the '+' get looked up from. So, you *could* use the old syntax
    in /etc/passwd, and have "passwd_compat: dns" to use hesiod.

(2) getusershell from dns and nis was mainly an experiment to give
    an example on how to do iterative lookups from hesiod. I've
    tested "dns" but not "nis"

For everything except "hosts", "dns" uses HS (hesiod) class lookups.

There are still a few databases I'd like to see implemented , and you
can see a list of those in <nsswitch.h>

All of the new code is mine, except for stringlist.{c.h} which I
ripped out of gen/getnetgrent.c (written by Christos Zoulas), and
hesiod.{c,h} from Athena. I have attempted to fix hesiod.c to some
extent, but it really needs a total rewrite. (E.g, in the docco for
Hesiod it says to free the array returned by hes_resolve(), except
that their implementation returned a pointer to a static char * array.
I only picked this up when tcsh's internal "free" function complained
about free()'s that were out of range... *grr* to badly written Athena
code)

-- 
Luke Mewburn <luke.mewburn@itg.telstra.com.au>

                I'd rather be a UNIX wizard than a Web serf.