long running kadm5 client




I have a daemon that opens a kadm5 connection while it's root and then
drops to nobody. The problem is if the connection dies, then I'm not
sure how to "refresh" the kadm5 connection.

The connection dies for two reasons. First, it will eventually time out
with this in kadmind.log:

(Error): check_rpcsec_auth: failed inquire_context, stat=786432
(Notice): Authentication attempt failed: 1.2.3.4, GSS-API error strings are:
(Notice): The referenced context has expired
(Notice): Unknown error
(Notice): GSS-API error strings complete.
(Error): Authentication attempt failed: 1.2.3.4, RPC authentication flavor 6

Or, if kadmind gets restarted but the daemon doesn't (after kadmind)
then the old connection is stale and fails.

In both of these cases, the apis start returning KADM5_RPC_ERROR,
"Communication failure with server".

My first inclination here is to read the keytab entry I need into a
MEMORY keytab, so it'll be around after I drop privileges, and then
occasionally ping kadmind at the top of the main wait loop to see if the
connection has died, and try to reconnect. The problem is, looking
through the kadm5 API, I wasn't sure what the best way to ping is
without making the server to a bunch of work (like get_principal). It
looks like kadm5_get_privs just does a round trip to get the 32 bit int
~0, which seems good, but is that a reliable way to do this? It "seems
to work" in my testing...

Or, is there a better way to do what I want to do? This daemon is a
server that creates ldap+krb5 accounts for a web signup system and it
needs to run "forever".

Thanks,
Chris

.



Relevant Pages

  • Re: Lightweight alternative MTA? [was: Re: Starting MTA:]
    ... listening daemon but nice to have queue daemon. ... exim works as both MTA and MDA depending on how it is used. ... rather fetchmail failed since there was no connection on port 25. ...
    (Debian-User)
  • Re: Fedora Core 5: How do I use tcpd and conrolling access to my server?
    ... there is an FTP connection but hardly any data flowing. ... You can have multiple lines listing a specific daemon, ... The more normal choice is to allow _some_ and deny all others. ...
    (comp.os.linux.networking)
  • Re: faster /etc/services
    ... EG> hash or btree file a la the aliases database. ... EG> socket and ask a daemon for the information. ... Connection to external daemon is additional overhead. ... is there need to optimize getservbyname()? ...
    (freebsd-net)
  • Re: F-16 broken for runlevel 5
    ... sending AddMatchmessage: The connection is closed ... CreateProfile: The connection is closed ... Connecting to daemon ... remove match rule ...
    (Fedora)
  • Python daemonisation with python-daemon
    ... I would like to turn my server script into a Linux/Unix daemon ... def init: ... connection establishing and such... ...
    (comp.lang.python)