IPC nsswitch implementation

Michael Bushkov bushman at stinger.cc.rsu.ru
Fri Mar 5 00:43:54 PST 2004


Hello!
Some time ago there was a discussion concerning in-process vs. IPC
nsswitch implementation. We agreed that we should develop an example of
IPC implementation and ask for a discussion. We are glad to present you
sample implementation of the IPC nsswitch model.

http://rsu.ru/~bushman/lookupd-0.1.1.tar.gz

It currently has many limitations but should be suitable for demonstration
of our approach.

There is a daemon and client part in this project. After executing make
in "daemon" folder you'll get:
1) lookupd daemon - it should be run by root. And (!) you should be in the
lookupd folder - daemon will search for it's modules in ./modules.
2) nsswrapper/nss_lookupd.so - a plug-in for current nsswitch
implementation. It should be placed as nss_lookupd.so.1 in /usr/local/lib.

lookupd.conf is the daemon configuration file. It has the same syntax as
nsswitch.conf. It should be placed in /etc. Examples of
lookupd.conf and nsswitch.conf (needed to use lookupd) are in the archive.

Daemon uses shared modules (dns, files and so on). Currently following
function can use lookupd:
- passwd functions - files module
- group function - files module
- gethostby* functions - files and dns module. We took the code for dns
modules from current libc. So it's not thread safe and can be buggy,
because daemon is multi-threaded. It was made just to show
module-structure capabilities. Later, we'll make normal reentrant
resolver.

When daemon is running, it sends a lot of info to stdout. It's the way to
make you able to know, that it works. There is currently no caching
functions in daemon. But it's quite easy to add them - and it will be done
in the nearest future.

We want you to look at this lookupd. It would be great for us to know if
you like or not the way we made it. And we also want to know if this
project can be added to FreeBSD project.

Please keep CC line of the message, so that all of our developers could
read your replies.

Michael Bushkov
Software Engineer,
Rostov State University



More information about the freebsd-hackers mailing list