Another showstopper in 2.2.5

jra at dp.samba.org jra at dp.samba.org
Tue Aug 20 11:28:01 GMT 2002


On Tue, Aug 20, 2002 at 10:06:30PM +0200, Fredrik Ohrn wrote:
> On Tue, 20 Aug 2002, Tom Jansen wrote:
> 
> > > > > Sooner or later the smbd dies on a SIGPIPE when trying to send a
> > > > > keepalive. The SIGPIPE isn't catched, thus it leaves stale sharemodes.
> > 
> > > After getting a hint on signalhandling I put a BlockSignals call into
> > > send_keepalive.
> > >
> > >
> > > --- lib/util_sock.c.org Tue Aug 20 12:31:58 2002
> > > +++ lib/util_sock.c     Tue Aug 20 12:33:15 2002
> > > @@ -401,6 +401,7 @@
> > >         buf[0] = 0x85;
> > >         buf[1] = buf[2] = buf[3] = 0;
> > >
> > > +       BlockSignals(True,SIGPIPE);
> > >         return(write_socket_data(client,(char *)buf,4) == 4);
> > >  }
> > 
> > What about unblocking ?
> > 
> 
> Well, since there's no signal handler for SIGPIPE you might just end up 
> with death by SIGPIPE somewhere else in the code instead.
> 
> I guess the proper thing to do is to globally block SIGPIPE at startup 
> and assume that all calls to read()/write() properly handles the case of 
> failure with EPIPE.

smbd should never get a SIGPIPE.

Look at this fragment of code from smbd/server.c :

        fault_setup((void (*)(void *))exit_server);
        CatchSignal(SIGTERM , SIGNAL_CAST sig_term);
        CatchSignal(SIGHUP,SIGNAL_CAST sig_hup);

        /* we are never interested in SIGPIPE */
        BlockSignals(True,SIGPIPE);


We ignore SIGPIPE at server startup, it was added about 10 years ago :-).

Can you give more details about getting SIGPIPE in smbd ? What platform,
etc.

Jremy.




More information about the samba-technical mailing list