Subject: Re: nsswitch implementation questions...
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Greg Hudson <ghudson@mit.edu>
List: current-users
Date: 01/17/1996 10:27:37
> - "nsswitch.conf has been read" state kept as a
> struct timeval *.
> - Call to getpwent()->nsswitch goo...is pointer NULL? Yes,
> allocate storage for timestamp, stat file, read file.
> - next call to getpwent()->nsswitch goo...is pointer NULL? No,
> stat file. updated time? Yes, update timestamp, read file.
> - etc, etc, etc.
Before adopting complicated schemes like this, I strongly suggest that
people consider whether /etc/nsswitch.conf is any different from other
configuration files used by libc (such as /etc/resolv.conf) and whether
all these extra considerations (do programs need to be restarted to pick
up changes, are we concerned about programs losing while the file is
being updated by an editor, do we need to compile the configuration file
into a database file to speed up lookups) are necessary.
I believe the conclusion you'll come to is that libc should parse the
nsswitch.conf file at startup time and not make use of a db file.