]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
net: ignore possible SIGPIPE upon ldap_unbind when over TLS
authorIsaac Boukris <iboukris@gmail.com>
Sat, 11 Jul 2020 03:04:59 +0000 (05:04 +0200)
committerIsaac Boukris <iboukris@sn-devel-184>
Mon, 13 Jul 2020 12:06:06 +0000 (12:06 +0000)
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 <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Isaac Boukris <iboukris@samba.org>
Autobuild-Date(master): Mon Jul 13 12:06:07 UTC 2020 on sn-devel-184

source3/utils/net.c

index 683b46794e491373faeb1be0681159291d1498fd..e289b2814bce2fa6725d5080a656c3ad21793144 100644 (file)
@@ -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);