summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-02 23:06:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:39:48 -0500
commitfea5d59b8411244b31df7980bdcdab9ed20dc712 (patch)
tree0adefcfccc5833651ef88f6cc115403de2a7cbb7 /source3/libads
parent5e44fc4cd47108245c567b9e676a5d8c09787d96 (diff)
downloadsamba-fea5d59b8411244b31df7980bdcdab9ed20dc712.tar.gz
samba-fea5d59b8411244b31df7980bdcdab9ed20dc712.tar.bz2
samba-fea5d59b8411244b31df7980bdcdab9ed20dc712.zip
r18010: Ensure we don't timeout twice to the same
server in winbindd when it's down and listed in the -ve connection cache. Fix memory leak, reduce timeout for cldap calls - minimum 3 secs. Jeremy. (This used to be commit 10b32cb6de234fa17fdd691bb294864d4d40f782)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/cldap.c4
-rw-r--r--source3/libads/kerberos.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c
index da1dec6b93..8e34e27353 100644
--- a/source3/libads/cldap.c
+++ b/source3/libads/cldap.c
@@ -188,6 +188,8 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply)
DATA_BLOB blob;
DATA_BLOB os1, os2, os3;
int i1;
+ /* half the time of a regular ldap timeout, not less than 3 seconds. */
+ unsigned int al_secs = MAX(3,lp_ldap_timeout()/2);
char *p;
blob = data_blob(NULL, 8192);
@@ -200,7 +202,7 @@ static int recv_cldap_netlogon(int sock, struct cldap_netlogon_reply *reply)
/* Setup timeout */
gotalarm = 0;
CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig);
- alarm(lp_ldap_timeout());
+ alarm(al_secs);
/* End setup timeout. */
ret = read(sock, blob.data, blob.length);
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index c872508fe8..57233f2182 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -494,10 +494,13 @@ static char *get_kdc_ip_string(char *mem_ctx, const char *realm, struct in_addr
kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
kdc_str, inet_ntoa(ip_srv[i].ip));
if (!kdc_str) {
+ SAFE_FREE(ip_srv);
return NULL;
}
}
+ SAFE_FREE(ip_srv);
+
DEBUG(10,("get_kdc_ip_string: Returning %s\n",
kdc_str ));