svn commit: samba r1751 - trunk/source/utils

jmcd at samba.org jmcd at samba.org
Thu Aug 12 03:35:20 GMT 2004


Author: jmcd
Date: 2004-08-12 03:35:20 +0000 (Thu, 12 Aug 2004)
New Revision: 1751
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/&rev=1751&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:
   trunk/source/utils/net_ads.c
   trunk/source/utils/net_ads_cldap.c

Changeset:
Modified: trunk/source/utils/net_ads.c
===================================================================
--- trunk/source/utils/net_ads.c	2004-08-12 03:28:57 UTC (rev 1750)
+++ trunk/source/utils/net_ads.c	2004-08-12 03:35:20 UTC (rev 1751)
@@ -75,9 +75,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: trunk/source/utils/net_ads_cldap.c
===================================================================
--- trunk/source/utils/net_ads_cldap.c	2004-08-12 03:28:57 UTC (rev 1750)
+++ trunk/source/utils/net_ads_cldap.c	2004-08-12 03:35:20 UTC (rev 1751)
@@ -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