From 965d18880081296ed7189daa0eeef6024c308db1 Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Sat, 11 Jul 2020 05:04:59 +0200 Subject: net: ignore possible SIGPIPE upon ldap_unbind when over TLS From local tests with strace: socket(AF_UNIX, SOCK_STREAM, 0) = 12 write(2, "Connecting to 10.53.57.21 at por"..., 38) = 38 ... write(2, "ads_domain_func_level: 3\n", 25) = 25 write(12, "\27\3\3\0\37\0\0\0\0\0\0\0\16nl[\374\375i\325\334\25\227kxG@\326\311R\225x"..., 36) = 36 write(12, "\25\3\3\0\32\0\0\0\0\0\0\0\17Hh\304\254\244\17\342<\334\210L&\20_\177\307\232P", 31) = -1 EPIPE (Broken pipe) --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=12089, si_uid=1000} --- +++ killed by SIGPIPE +++ BUG: https://bugzilla.samba.org/show_bug.cgi?id=14439 Signed-off-by: Isaac Boukris Reviewed-by: Andreas Schneider Autobuild-User(master): Isaac Boukris Autobuild-Date(master): Mon Jul 13 12:06:07 UTC 2020 on sn-devel-184 --- source3/utils/net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/utils/net.c b/source3/utils/net.c index 683b46794e4..e289b2814bc 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -1289,6 +1289,9 @@ static void get_credentials_file(struct net_context *c, POPT_TABLEEND }; + /* Ignore possible SIGPIPE upon ldap_unbind when over TLS */ + BlockSignals(True, SIGPIPE); + zero_sockaddr(&c->opt_dest_ip); setup_logging(argv[0], DEBUG_STDERR); -- cgit v1.2.1