summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-08-21 12:36:01 +0000
committerAndrew Tridgell <tridge@samba.org>1996-08-21 12:36:01 +0000
commita782ffb5edfb7759f756032be918e3e939a458bc (patch)
tree1ca8f0681360ae4209bf5e1c25a5a1c3526acd8d
parent4e67124eaa318d8a4efb3850e1028795ca2c2611 (diff)
downloadsamba-a782ffb5edfb7759f756032be918e3e939a458bc.tar.gz
samba-a782ffb5edfb7759f756032be918e3e939a458bc.tar.bz2
samba-a782ffb5edfb7759f756032be918e3e939a458bc.zip
handle sigpipe better for server security
(This used to be commit d87fdb3ee95b6640d5deef823f22e8d98350ca33)
-rw-r--r--source3/smbd/server.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 683d63e7aa..0e0a524f16 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1618,6 +1618,20 @@ static int sig_cld()
**************************************************************************/
static int sig_pipe()
{
+ extern int password_client;
+ BlockSignals(True,SIGPIPE);
+
+ if (password_client != -1) {
+ DEBUG(3,("lost connection to password server\n"));
+ close(password_client);
+ password_client = -1;
+#ifndef DONT_REINSTALL_SIG
+ signal(SIGPIPE, SIGNAL_CAST sig_pipe);
+#endif
+ BlockSignals(False,SIGPIPE);
+ return 0;
+ }
+
exit_server("Got sigpipe\n");
return(0);
}