svn commit: samba r11337 - in trunk/source: nsswitch rpc_client

jra at samba.org jra at samba.org
Thu Oct 27 18:25:39 GMT 2005


Author: jra
Date: 2005-10-27 18:25:38 +0000 (Thu, 27 Oct 2005)
New Revision: 11337

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11337

Log:
Move knowledge of \\ needed into rpc_client/cli_netlogon
(this is the way it's been done in other functions). Instead
of moving this into the IDL, I think the best solution would
be to write a wrapper function around any call that needs
this (this is what we already do for many of the calls).
Jeremy.

Modified:
   trunk/source/nsswitch/winbindd_cm.c
   trunk/source/rpc_client/cli_netlogon.c


Changeset:
Modified: trunk/source/nsswitch/winbindd_cm.c
===================================================================
--- trunk/source/nsswitch/winbindd_cm.c	2005-10-27 18:06:29 UTC (rev 11336)
+++ trunk/source/nsswitch/winbindd_cm.c	2005-10-27 18:25:38 UTC (rev 11337)
@@ -105,7 +105,6 @@
 	struct rpc_pipe_client *netlogon_pipe;
 	NTSTATUS result;
 	TALLOC_CTX *mem_ctx;
-	const char *server_name;
 
 	fstring tmp;
 	char *p;
@@ -132,12 +131,7 @@
 		return False;
 	}
 
-	server_name = talloc_asprintf(mem_ctx, "\\\\%s", our_domain->dcname);
-	if (server_name == NULL) {
-		return False;
-	}
-
-	result = rpccli_netlogon_getdcname(netlogon_pipe, mem_ctx, server_name,
+	result = rpccli_netlogon_getdcname(netlogon_pipe, mem_ctx, our_domain->dcname,
 					   domain->name, tmp);
 
 	talloc_destroy(mem_ctx);

Modified: trunk/source/rpc_client/cli_netlogon.c
===================================================================
--- trunk/source/rpc_client/cli_netlogon.c	2005-10-27 18:06:29 UTC (rev 11336)
+++ trunk/source/rpc_client/cli_netlogon.c	2005-10-27 18:25:38 UTC (rev 11337)
@@ -388,13 +388,15 @@
 	NET_Q_GETDCNAME q;
 	NET_R_GETDCNAME r;
 	NTSTATUS result;
+	fstring mydcname_slash;
 
 	ZERO_STRUCT(q);
 	ZERO_STRUCT(r);
 
 	/* Initialise input parameters */
 
-	init_net_q_getdcname(&q, mydcname, domainname);
+	slprintf(mydcname_slash, sizeof(fstring)-1, "\\\\%s", mydcname);
+	init_net_q_getdcname(&q, mydcname_slash, domainname);
 
 	/* Marshall data and send request */
 



More information about the samba-cvs mailing list