summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net_ads.c5
-rw-r--r--source3/utils/net_ads_cldap.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 7b8ace85b6..2efd470bbe 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -77,9 +77,12 @@ static int net_ads_lookup(int argc, const char **argv)
ads_connect(ads);
- if (!ads || !ads->config.realm) {
+ if (!ads) {
d_printf("Didn't find the cldap server!\n");
return -1;
+ } if (!ads->config.realm) {
+ ads->config.realm = opt_target_workgroup;
+ ads->ldap_port = 389;
}
return ads_cldap_netlogon(ads);
diff --git a/source3/utils/net_ads_cldap.c b/source3/utils/net_ads_cldap.c
index 1903172cf7..f3c6c5ff4d 100644
--- a/source3/utils/net_ads_cldap.c
+++ b/source3/utils/net_ads_cldap.c
@@ -280,8 +280,9 @@ int ads_cldap_netlogon(ADS_STRUCT *ads)
int sock;
int ret;
struct cldap_netlogon_reply reply;
+ const char *target = opt_host ? opt_host : inet_ntoa(ads->ldap_ip);
- sock = open_udp_socket(inet_ntoa(ads->ldap_ip), ads->ldap_port);
+ sock = open_udp_socket(target, ads->ldap_port);
if (sock == -1) {
d_printf("Failed to open udp socket to %s:%u\n",
inet_ntoa(ads->ldap_ip),