mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +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 used to be commit edb4e940b4
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
ead3776a74
commit
d86f6ceead
@ -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),
|
||||
|
Reference in New Issue
Block a user