Baruch Even wrote:
> If it is a process parent/child pair then you could listen on the signal
> SIGCHLD and when the child exits your process will be notified by the
> kernel.
Well, no.

The most obvious programs that will be run through privbind are daemons.
Those tend (I say "tend", but it's in the specs) to fork and exit parent
as a first thing. Privbind will not be the parent of the actual process
doing the binds.

What I intended to do, before I totally ran out of time to work on it,
was to implement a switch saying "answer X bind requests and then exit".
The assumption is that you know how many times daemon X uses privileged
bind throughout its lifetime.
>  You'll need to wait() on the child process in the signal handler
> to reap the zombie child process.
>   
Well, the idea is that a "recv" will terminate with no data and with
errno set to "EINTR" if a signal, such as SIGCHLD, arrives. This means
you can just call "recv", and if it fails, check the return code, and if
it's "EINTR" check whether the child has exited.
> Baruch
>   
Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting ltd.
Have you backed up today's work? http://www.lingnu.com/backup.html


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to