[OpenAFS] pts and nsswitch

Todd M. Lewis Todd_Lewis@unc.edu
Fri, 13 Sep 2002 14:34:57 -0400


Greetings,

I've often wished "ls -l" would list the pts names of files' owners
instead of their uids for people not in my password file.  So I wrote up
http://www.unc.edu/~utoddl/nss_pts_0.1.tgz which implements a simple
nsswitch module that does exactly that.  At least it does on Linux, and
it might on Solaris, though I don't have a Sun box I can hack on to
thrash out the details.

[FYI: nsswitch in a nutshell is a set of hooks into how the system looks
up things -- about users, groups, hosts, services, networks, whatever.
nss_pts adds a hook that makes getpwuid() know how to look in your
cell's ptserver if it can't find the uid in, for example, /etc/passwd
and NIS.]

In retrospect, I'm not so sure this was a good idea, but I'm putting the
code out there in case someone else wants to play with it and doesn't
want to start from scratch.  Go ahead; knock yourself out.

So why isn't this such a good idea?  Well, for one thing, if you're
looking at files in some other cell, it still does the lookups against
your ptserver.  Also, if a uid happens to map to one of your cell's
non-null instances, then you might get back a struct passwd with a
pw_name that's longer than 8 characters, which could cause some programs
to choke.  I've been running this thing several days and it hasn't
caused me any problems that I know of, but I wouldn't want to deploy a
production server based on that.

Think of it as a proof of concept -- maybe an ill-conceived one -- but
it sure adds some meaning to most of my ls snooping around my cell.  And
if someone gets it working under Solaris, I'd like to know what you did.

Happy computing,
-- 
   +----------------------------------------------------------------+
  / Todd_Lewis@unc.edu                  http://www.unc.edu/~utoddl /
 /(919) 962-5273  Linux - It's now safe to turn on your computer. /
+----------------------------------------------------------------+