mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
r1750: This patch allows net ads lookup to rely on command line arguments if contacting an ADS server fails. This allows net ads lookup to work with clapd (very useful for testing).
from aliguori@us.ibm.com
This commit is contained in:
parent
a1bb6fbbe4
commit
edb4e940b4
@ -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);
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user