mirror of
https://github.com/samba-team/samba.git
synced 2025-02-08 05:57:51 +03:00
we are never interested in SIGPIPE so just ignore (block) it
always. Don't even install a handler. (This used to be commit 72c383f4b7bcce5374632dc972df16ab0e2542b9)
This commit is contained in:
parent
054a7bcd3a
commit
148691b1c5
@ -3390,15 +3390,6 @@ void *Realloc(void *p,int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
Signal handler for SIGPIPE (write on a disconnected socket)
|
|
||||||
****************************************************************************/
|
|
||||||
void Abort(void )
|
|
||||||
{
|
|
||||||
DEBUG(0,("Probably got SIGPIPE\nExiting\n"));
|
|
||||||
exit(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
get my own name and IP
|
get my own name and IP
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -103,17 +103,6 @@ static void sig_hup(int sig)
|
|||||||
|
|
||||||
} /* sig_hup */
|
} /* sig_hup */
|
||||||
|
|
||||||
/**************************************************************************** **
|
|
||||||
catch a sigpipe
|
|
||||||
**************************************************************************** */
|
|
||||||
static void sig_pipe(int sig)
|
|
||||||
{
|
|
||||||
BlockSignals( True, SIGPIPE );
|
|
||||||
|
|
||||||
DEBUG( 0, ("Got SIGPIPE\n") );
|
|
||||||
|
|
||||||
BlockSignals( False, SIGPIPE );
|
|
||||||
} /* sig_pipe */
|
|
||||||
|
|
||||||
#if DUMP_CORE
|
#if DUMP_CORE
|
||||||
/**************************************************************************** **
|
/**************************************************************************** **
|
||||||
@ -432,7 +421,8 @@ static BOOL open_sockets(BOOL isdaemon, int port)
|
|||||||
if ( ClientNMB == -1 )
|
if ( ClientNMB == -1 )
|
||||||
return( False );
|
return( False );
|
||||||
|
|
||||||
CatchSignal( SIGPIPE, SIGNAL_CAST sig_pipe );
|
/* we are never interested in SIGPIPE */
|
||||||
|
BlockSignals(True,SIGPIPE);
|
||||||
|
|
||||||
set_socket_options( ClientNMB, "SO_BROADCAST" );
|
set_socket_options( ClientNMB, "SO_BROADCAST" );
|
||||||
set_socket_options( ClientDGRAM, "SO_BROADCAST" );
|
set_socket_options( ClientDGRAM, "SO_BROADCAST" );
|
||||||
|
@ -67,25 +67,6 @@ void killkids(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
this is called when the client exits abruptly
|
|
||||||
**************************************************************************/
|
|
||||||
static void sig_pipe(int sig)
|
|
||||||
{
|
|
||||||
struct cli_state *cli;
|
|
||||||
BlockSignals(True,SIGPIPE);
|
|
||||||
|
|
||||||
if ((cli = server_client()) && cli->initialised) {
|
|
||||||
DEBUG(3,("lost connection to password server\n"));
|
|
||||||
cli_shutdown(cli);
|
|
||||||
BlockSignals(False,SIGPIPE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
exit_server("Got sigpipe\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
open the socket communication
|
open the socket communication
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -96,7 +77,6 @@ static BOOL open_sockets_inetd(void)
|
|||||||
/* Started from inetd. fd 0 is the socket. */
|
/* Started from inetd. fd 0 is the socket. */
|
||||||
/* We will abort gracefully when the client or remote system
|
/* We will abort gracefully when the client or remote system
|
||||||
goes away */
|
goes away */
|
||||||
CatchSignal(SIGPIPE, SIGNAL_CAST sig_pipe);
|
|
||||||
Client = dup(0);
|
Client = dup(0);
|
||||||
|
|
||||||
/* close our standard file descriptors */
|
/* close our standard file descriptors */
|
||||||
@ -244,9 +224,6 @@ max can be %d\n",
|
|||||||
if (Client != -1 && fork()==0) {
|
if (Client != -1 && fork()==0) {
|
||||||
/* Child code ... */
|
/* Child code ... */
|
||||||
|
|
||||||
CatchSignal(SIGPIPE,
|
|
||||||
SIGNAL_CAST sig_pipe);
|
|
||||||
|
|
||||||
/* close the listening socket(s) */
|
/* close the listening socket(s) */
|
||||||
for(i = 0; i < num_interfaces; i++)
|
for(i = 0; i < num_interfaces; i++)
|
||||||
close(fd_listenset[i]);
|
close(fd_listenset[i]);
|
||||||
@ -552,6 +529,9 @@ static void usage(char *pname)
|
|||||||
fault_setup((void (*)(void *))exit_server);
|
fault_setup((void (*)(void *))exit_server);
|
||||||
CatchSignal(SIGTERM , SIGNAL_CAST dflt_sig);
|
CatchSignal(SIGTERM , SIGNAL_CAST dflt_sig);
|
||||||
|
|
||||||
|
/* we are never interested in SIGPIPE */
|
||||||
|
BlockSignals(True,SIGPIPE);
|
||||||
|
|
||||||
/* we want total control over the permissions on created files,
|
/* we want total control over the permissions on created files,
|
||||||
so set our umask to 0 */
|
so set our umask to 0 */
|
||||||
umask(0);
|
umask(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user