[kerberos-discuss] LDAP & Kerberos interaction & SIGPIPE

Tom Yu tlyu at MIT.EDU
Fri Sep 25 13:17:00 EDT 2009


Nicolas Williams <Nicolas.Williams at sun.com> writes:

> On Fri, Sep 25, 2009 at 08:59:31AM -0400, Peter Shoults wrote:
>> > Assuming we have the SIGPIPE handler specifically to output the syslog
>> > message, then I propose that we have in the handler a resetting of the
>> > signal disposition to sig_pipe.  I have also tested this fix and
>> > verified that this also resolves the problem and allows the user to
>> > enter kadmin commands after LDAP server restarts.  Here is my change:
>> >
>> > file modified is ovsec_kadmd.c
>> >
>> > void
>> > sig_pipe(int unused)
>> > {
>> > +        signal(SIGPIPE, sig_pipe);
>> >         krb5_klog_syslog(LOG_NOTICE, gettext("Warning: Received a SIGPIPE; "
>> >                 "probably a client aborted.  Continuing."));
>> > }
>
> That's not reliable.  Use reliable signals instead (i.e., use
> sigaction(2) and clear the SA_RESETHAND flag).

I was puzzled at why sigaction() was not being used to set up the
SIGPIPE handler, and it looks like the MIT code is using sigaction(),
but OpenSolaris is not, for some reason.



More information about the krbdev mailing list