svn commit: samba r1750 - branches/SAMBA_3_0/source/utils

jmcd at samba.org jmcd at samba.org
Thu Aug 12 03:28:57 GMT 2004


Author: jmcd
Date: 2004-08-12 03:28:57 +0000 (Thu, 12 Aug 2004)
New Revision: 1750
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=1750&nolog=1
Log:
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 at us.ibm.com


Modified:
   branches/SAMBA_3_0/source/utils/net_ads.c
   branches/SAMBA_3_0/source/utils/net_ads_cldap.c

Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_ads.c
===================================================================
--- branches/SAMBA_3_0/source/utils/net_ads.c	2004-08-12 03:28:44 UTC (rev 1749)
+++ branches/SAMBA_3_0/source/utils/net_ads.c	2004-08-12 03:28:57 UTC (rev 1750)
@@ -77,9 +77,12 @@
 
 	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);

Modified: branches/SAMBA_3_0/source/utils/net_ads_cldap.c
===================================================================
--- branches/SAMBA_3_0/source/utils/net_ads_cldap.c	2004-08-12 03:28:44 UTC (rev 1749)
+++ branches/SAMBA_3_0/source/utils/net_ads_cldap.c	2004-08-12 03:28:57 UTC (rev 1750)
@@ -280,8 +280,9 @@
 	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), 



More information about the samba-cvs mailing list