return NT_STATUS_NO_LOGON_SERVERS;
}
+ DEBUG(4,("ads_resolve_dc: realm=%s\n", ads->realm));
+
#ifdef HAVE_ADS
/* a full ads_connect() is actually overkill, as we don't srictly need
to do the SASL auth in order to get the info we need, but libads
fstrcpy(remote_machine, ads->ldap_server_name);
strupper(remote_machine);
- *dest_ip = *interpret_addr2(ads->ldap_server);
+ *dest_ip = ads->ldap_ip;
ads_destroy(&ads);
- if (!*remote_machine) {
+ if (!*remote_machine || is_zero_ip(*dest_ip)) {
return NT_STATUS_NO_LOGON_SERVERS;
}
return NT_STATUS_NO_LOGON_SERVERS;
/* Attempt connection */
- result = cli_full_connection(cli, global_myname, server,
- &dest_ip, 0, "IPC$", "IPC", "", "", "", 0);
+ result = cli_full_connection(cli, global_myname, remote_machine,
+ &dest_ip, 0, "IPC$", "IPC", "", "", "");
if (!NT_STATUS_IS_OK(result)) {
release_server_mutex();
ads->ldap_server = strdup(lp_ads_server());
}
if (!ads->ldap_server || !ads->ldap_server[0]) {
+ SAFE_FREE(ads->ldap_server);
ads->ldap_server = find_ldap_server(ads);
}
}
ads->kdc_server = ads->ldap_server? strdup(ads->ldap_server) : NULL;
}
+ if (ads->ldap_server) {
+ /* its very useful knowing the IP of the ldap server */
+ ads->ldap_ip = *interpret_addr2(ads->ldap_server);
+ }
+
return ads;
}
}
d_printf("LDAP server: %s\n", ads->ldap_server);
+ d_printf("LDAP server IP: %s\n", inet_ntoa(ads->ldap_ip));
d_printf("LDAP server name: %s\n", ads->ldap_server_name);
d_printf("Realm: %s\n", ads->realm);
d_printf("Bind Path: %s\n", ads->bind_path);