r11338: Move knowledge of \\ needed into rpc_client/cli_netlogon
authorJeremy Allison <jra@samba.org>
Thu, 27 Oct 2005 18:25:41 +0000 (18:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:13 +0000 (11:05 -0500)
(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.
(This used to be commit aeca4efa11728be53b81967bb5442b5b09d1a975)

source3/nsswitch/winbindd_cm.c
source3/rpc_client/cli_netlogon.c

index 4e11206c9ca3f3673b3e0af98a0f2900682db8c1..e38d4cc426e5721c333332e78477a37e18c37bc4 100644 (file)
@@ -105,7 +105,6 @@ static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain,
        struct rpc_pipe_client *netlogon_pipe;
        NTSTATUS result;
        TALLOC_CTX *mem_ctx;
-       const char *server_name;
 
        fstring tmp;
        char *p;
@@ -132,12 +131,7 @@ static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain,
                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);
index 78e682d12a4d9da0f9949b53505fc3b11a41b935..ee45331975ce30e9dc0e1cb7eb4b10191c0f6d27 100644 (file)
@@ -388,13 +388,15 @@ NTSTATUS rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
        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 */