PATCH: radius: bad_hook program caught signal 15

Russ Allbery rra at stanford.edu
Sat Mar 6 05:19:45 UTC 2004


Russ Allbery <rra at stanford.edu> writes:
> Russ Allbery <rra at stanford.edu> writes:

>> Yeah, I'd like to see the results of that too.  It really does seem
>> like something is killing it when it uses the message library and not
>> otherwise, and I don't know how that could happen.

> I've managed to duplicate this behavior and am trying to figure out
> what's going on now.

nnrpd is killing the authenticator.  The if statement in this code is
triggering:

    if (FD_ISSET(prog->errfd, &tfds)) {
        got = HandleProgInput(prog->errfd, errbuf, sizeof(errbuf),
                              HandleErrorLine);
        if (got <= 0) {
            close(prog->errfd);
            FD_CLR(prog->errfd, &tfds);
            kill(prog->pid, SIGTERM);
        }
    }

The reason why the fprintf worked and the calls to warn and die didn't is
because the latter print out the program name first, and then a colon and
the error message.  This is done as separate commands, and therefore the
data is picked up by separate reads from nnrpd.  That triggers the
following bit in HandleProgInput:

    /* delete all the lines we've read from the buffer. */
    /* 'start' points to the end of the last unterminated string */
    nl = start;
    start = buf;
    if (nl == start) {
        return(0);
    }

This code is all of rather dubious construction, honestly.  We need to
find a better way of distinguishing between reading an end of file and
reading an unterminated line which we therefore can't scan for the data
we're looking for yet.

I'm looking at finding a good way of rewriting this now.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list