summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-04-26 17:03:32 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-04-28 05:30:20 +0200
commit818ec32d0c4dde545199b4462da30b49a19ecc87 (patch)
treeb9ef927164f792e495ffb768448e47a206f9f6a6 /source3/utils
parentaa8406cadf62ea676ffb7a6239a8b3f4fe71abbf (diff)
downloadsamba-818ec32d0c4dde545199b4462da30b49a19ecc87.tar.gz
samba-818ec32d0c4dde545199b4462da30b49a19ecc87.tar.bz2
samba-818ec32d0c4dde545199b4462da30b49a19ecc87.zip
s3-libads Pass a struct sockaddr_storage to cldap routines
This avoids these routines doing a DNS lookup that has already been done, and ensures that the emulated DNS lookup isn't thrown away. Andrew Bartlett
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_ads.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 4b4b0a8031..3619ac339b 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -60,7 +60,8 @@ static int net_ads_cldap_netlogon(struct net_context *c, ADS_STRUCT *ads)
struct NETLOGON_SAM_LOGON_RESPONSE_EX reply;
print_sockaddr(addr, sizeof(addr), &ads->ldap.ss);
- if ( !ads_cldap_netlogon_5(talloc_tos(), addr, ads->server.realm, &reply ) ) {
+
+ if ( !ads_cldap_netlogon_5(talloc_tos(), &ads->ldap.ss, ads->server.realm, &reply ) ) {
d_fprintf(stderr, _("CLDAP query failed!\n"));
return -1;
}
@@ -383,7 +384,6 @@ int net_ads_check(struct net_context *c)
static int net_ads_workgroup(struct net_context *c, int argc, const char **argv)
{
ADS_STRUCT *ads;
- char addr[INET6_ADDRSTRLEN];
struct NETLOGON_SAM_LOGON_RESPONSE_EX reply;
if (c->display_usage) {
@@ -405,8 +405,7 @@ static int net_ads_workgroup(struct net_context *c, int argc, const char **argv)
ads->ldap.port = 389;
}
- print_sockaddr(addr, sizeof(addr), &ads->ldap.ss);
- if ( !ads_cldap_netlogon_5(talloc_tos(), addr, ads->server.realm, &reply ) ) {
+ if ( !ads_cldap_netlogon_5(talloc_tos(), &ads->ldap.ss, ads->server.realm, &reply ) ) {
d_fprintf(stderr, _("CLDAP query failed!\n"));
ads_destroy(&ads);
return -1;