summaryrefslogtreecommitdiff
path: root/source3/utils/net_lookup.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-11-06 01:29:07 +0000
committerTim Potter <tpot@samba.org>2002-11-06 01:29:07 +0000
commitea24bb2da8f643e043dc3af3ed3f16388878b57b (patch)
treedcffacff686f4867441fc7b177a865bcc43ea212 /source3/utils/net_lookup.c
parent62d4ea1bc50bcd9f89fa054f60ca475f87b4a9de (diff)
downloadsamba-ea24bb2da8f643e043dc3af3ed3f16388878b57b.tar.gz
samba-ea24bb2da8f643e043dc3af3ed3f16388878b57b.tar.bz2
samba-ea24bb2da8f643e043dc3af3ed3f16388878b57b.zip
Merge of get_dc_list() api change. This was slightly more intrusive
than the version in APPLIANCE so watch out for boogs. (This used to be commit 1e054e3db654801fbb5580211529cdfdea9ed686)
Diffstat (limited to 'source3/utils/net_lookup.c')
-rw-r--r--source3/utils/net_lookup.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c
index f76b186251..32921de620 100644
--- a/source3/utils/net_lookup.c
+++ b/source3/utils/net_lookup.c
@@ -79,8 +79,8 @@ static int net_lookup_ldap(int argc, const char **argv)
#ifdef HAVE_LDAP
char *srvlist;
const char *domain;
- int rc, count;
- struct in_addr *addr;
+ int rc;
+ struct in_addr addr;
struct hostent *hostent;
if (argc > 0)
@@ -96,10 +96,10 @@ static int net_lookup_ldap(int argc, const char **argv)
}
DEBUG(9, ("Looking up DC for domain %s\n", domain));
- if (!get_dc_list(True, domain, &addr, &count))
+ if (!get_pdc_ip(domain, &addr))
return -1;
- hostent = gethostbyaddr((char *) &addr->s_addr, sizeof(addr->s_addr),
+ hostent = gethostbyaddr((char *) &addr.s_addr, sizeof(addr.s_addr),
AF_INET);
if (!hostent)
return -1;
@@ -124,7 +124,7 @@ static int net_lookup_ldap(int argc, const char **argv)
static int net_lookup_dc(int argc, const char **argv)
{
- struct in_addr *ip_list;
+ struct in_addr *ip_list, addr;
char *pdc_str = NULL;
const char *domain=opt_target_workgroup;
int count, i;
@@ -133,13 +133,13 @@ static int net_lookup_dc(int argc, const char **argv)
domain=argv[0];
/* first get PDC */
- if (!get_dc_list(True, domain, &ip_list, &count))
+ if (!get_pdc_ip(domain, &addr))
return -1;
- asprintf(&pdc_str, "%s", inet_ntoa(*ip_list));
+ asprintf(&pdc_str, "%s", inet_ntoa(addr));
d_printf("%s\n", pdc_str);
- if (!get_dc_list(False, domain, &ip_list, &count)) {
+ if (!get_dc_list(domain, &ip_list, &count)) {
SAFE_FREE(pdc_str);
return 0;
}