OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Unix domain socket for user lookups

From: Alexander Schrijver (alexander.schrijvergmail.com)
Date: Wed Jan 02 2008 - 11:40:20 CST


Hi everybody,

Last two weeks I have been looking into making a daemon which can
query an RDBMS system which stores the users information like uid/gid
homedir, shell etc . This daemon can be called from the libc functions
getpwnam, getpwuid etc. Basicly it is a proxy between getpw* (and in
the future getgr*) and an RDBMS system.

I stole the IMSG protocol from bgpd/bgctl, and modified it so it
supports getpw* requests. Also, I wrote some code to marshall the
struct passwd so it can be sent as data. It seems to work very well
at the moment.

The use is to be able to keep connections open to for example
postgresql or openldap using the daemon. And not make a new connection
on every getpw* call like it is done in nsswitch.

I have only been programming in c for about 6 months, that is why I
ask. Is, is there anything I might not have considered? or any other
reason why this is a stupid idea?

Regards,

Alexander Schrijver