summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-11-28 12:53:39 +0100
committerJim McDonough <jmcd@samba.org>2012-11-28 17:17:20 +0100
commitcb0064d35cdc60c7c625ad4561ad77739f8553c5 (patch)
treed4a821ed8d26b63b86d2e3cfa7cf627984d3de2f /source3/winbindd
parentbc6bceec655f241f23d713edc0d7a2633b5d6592 (diff)
downloadsamba-cb0064d35cdc60c7c625ad4561ad77739f8553c5.tar.gz
samba-cb0064d35cdc60c7c625ad4561ad77739f8553c5.tar.bz2
samba-cb0064d35cdc60c7c625ad4561ad77739f8553c5.zip
BUG 9436: Fix leaking sockets of SMB connections to a DC.
As this is a burst of 3 unbound sockets with each try to reach a DC we're running out of file descriptors pretty fast. So winbind is then mostly spinning in an accept loop failing with EMFILE. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jim McDonough <jmcd@samba.org> Autobuild-User(master): Jim McDonough <jmcd@samba.org> Autobuild-Date(master): Wed Nov 28 17:17:21 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_cm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 79b5839d2a..57027eb04d 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1598,6 +1598,10 @@ static NTSTATUS cm_open_connection(struct winbindd_domain *domain,
result = cm_prepare_connection(domain, fd, domain->dcname,
&new_conn->cli, &retry);
+ if (!NT_STATUS_IS_OK(result)) {
+ /* Don't leak the smb connection socket */
+ close(fd);
+ }
if (!retry)
break;