diff options
author | Günther Deschner <gd@samba.org> | 2007-01-17 19:11:45 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:14 -0500 |
commit | f3ad8bb00acf680863902721c57091d2bf622b72 (patch) | |
tree | 05958f2a582d3336ec341bada5dd391d48d7ecdd /source3/libads | |
parent | ab41ff67f1308389a130c3a4ff804545d8998dd1 (diff) | |
download | samba-f3ad8bb00acf680863902721c57091d2bf622b72.tar.gz samba-f3ad8bb00acf680863902721c57091d2bf622b72.tar.bz2 samba-f3ad8bb00acf680863902721c57091d2bf622b72.zip |
r20860: Adding some small tweaks. When we have no sitename, there is no need to
ask for the list of DCs twice.
Guenther
(This used to be commit a9baf27e1348dd6dadd7a2fafdf9c269087b80ac)
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/kerberos.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 95eed6fe27..d35b59f4cd 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -484,18 +484,21 @@ static char *get_kdc_ip_string(char *mem_ctx, const char *realm, const char *sit /* Get the KDC's only in this site. */ - get_kdc_list(realm, sitename, &ip_srv_site, &count_site); + if (sitename) { - for (i = 0; i < count_site; i++) { - if (ip_equal(ip_srv_site[i].ip, primary_ip)) { - continue; - } - /* Append to the string - inefficient but not done often. */ - kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", - kdc_str, inet_ntoa(ip_srv_site[i].ip)); - if (!kdc_str) { - SAFE_FREE(ip_srv_site); - return NULL; + get_kdc_list(realm, sitename, &ip_srv_site, &count_site); + + for (i = 0; i < count_site; i++) { + if (ip_equal(ip_srv_site[i].ip, primary_ip)) { + continue; + } + /* Append to the string - inefficient but not done often. */ + kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", + kdc_str, inet_ntoa(ip_srv_site[i].ip)); + if (!kdc_str) { + SAFE_FREE(ip_srv_site); + return NULL; + } } } |