[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-771-gb738381

Günther Deschner gd at samba.org
Fri Dec 21 14:14:41 GMT 2007


The branch, v3-2-test has been updated
       via  b7383818168863a7ba43c2456f8c44e96e76707a (commit)
      from  763e13315fc71237b14a186810bc201e725648f5 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit b7383818168863a7ba43c2456f8c44e96e76707a
Author: Günther Deschner <gd at samba.org>
Date:   Fri Dec 21 15:12:40 2007 +0100

    Kill fstring in getdcname & getanydcname return.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/rpc_client/cli_netlogon.c |   14 ++++++++------
 source/rpcclient/cmd_netlogon.c  |    8 ++++----
 source/winbindd/winbindd_cm.c    |    4 ++--
 source/winbindd/winbindd_misc.c  |    6 +++---
 4 files changed, 17 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/rpc_client/cli_netlogon.c b/source/rpc_client/cli_netlogon.c
index 3cb5827..26d2124 100644
--- a/source/rpc_client/cli_netlogon.c
+++ b/source/rpc_client/cli_netlogon.c
@@ -383,7 +383,7 @@ NTSTATUS rpccli_netlogon_logon_ctrl2(struct rpc_pipe_client *cli, TALLOC_CTX *me
 
 WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli,
 				    TALLOC_CTX *mem_ctx, const char *mydcname,
-				    const char *domainname, fstring newdcname)
+				    const char *domainname, char **newdcname)
 {
 	prs_struct qbuf, rbuf;
 	NET_Q_GETANYDCNAME q;
@@ -410,8 +410,9 @@ WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli,
 
 	result = r.status;
 
-	if (W_ERROR_IS_OK(result)) {
-		rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname);
+	if (W_ERROR_IS_OK(result) && newdcname) {
+		*newdcname = rpcstr_pull_unistr2_talloc(mem_ctx, &r.uni_dcname);
+		W_ERROR_HAVE_NO_MEMORY(*newdcname);
 	}
 
 	return result;
@@ -421,7 +422,7 @@ WERROR rpccli_netlogon_getanydcname(struct rpc_pipe_client *cli,
 
 WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
 				 TALLOC_CTX *mem_ctx, const char *mydcname,
-				 const char *domainname, fstring newdcname)
+				 const char *domainname, char **newdcname)
 {
 	prs_struct qbuf, rbuf;
 	NET_Q_GETDCNAME q;
@@ -448,8 +449,9 @@ WERROR rpccli_netlogon_getdcname(struct rpc_pipe_client *cli,
 
 	result = r.status;
 
-	if (W_ERROR_IS_OK(result)) {
-		rpcstr_pull_unistr2_fstring(newdcname, &r.uni_dcname);
+	if (W_ERROR_IS_OK(result) && newdcname) {
+		*newdcname = rpcstr_pull_unistr2_talloc(mem_ctx, &r.uni_dcname);
+		W_ERROR_HAVE_NO_MEMORY(*newdcname);
 	}
 
 	return result;
diff --git a/source/rpcclient/cmd_netlogon.c b/source/rpcclient/cmd_netlogon.c
index e997bb5..2c1f7e0 100644
--- a/source/rpcclient/cmd_netlogon.c
+++ b/source/rpcclient/cmd_netlogon.c
@@ -48,7 +48,7 @@ static WERROR cmd_netlogon_getanydcname(struct rpc_pipe_client *cli,
 					TALLOC_CTX *mem_ctx, int argc, 
 					const char **argv)
 {
-	fstring dcname;
+	char *dcname = NULL;
 	WERROR result = WERR_GENERAL_FAILURE;
 	int old_timeout;
 
@@ -60,7 +60,7 @@ static WERROR cmd_netlogon_getanydcname(struct rpc_pipe_client *cli,
 	/* Make sure to wait for our DC's reply */
 	old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
 
-	result = rpccli_netlogon_getanydcname(cli, mem_ctx, cli->cli->desthost, argv[1], dcname);
+	result = rpccli_netlogon_getanydcname(cli, mem_ctx, cli->cli->desthost, argv[1], &dcname);
 
 	cli_set_timeout(cli->cli, old_timeout);
 
@@ -79,7 +79,7 @@ static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
 				     TALLOC_CTX *mem_ctx, int argc, 
 				     const char **argv)
 {
-	fstring dcname;
+	char *dcname = NULL;
 	WERROR result = WERR_GENERAL_FAILURE;
 	int old_timeout;
 
@@ -91,7 +91,7 @@ static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
 	/* Make sure to wait for our DC's reply */
 	old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
 
-	result = rpccli_netlogon_getdcname(cli, mem_ctx, cli->cli->desthost, argv[1], dcname);
+	result = rpccli_netlogon_getdcname(cli, mem_ctx, cli->cli->desthost, argv[1], &dcname);
 
 	cli_set_timeout(cli->cli, old_timeout);
 
diff --git a/source/winbindd/winbindd_cm.c b/source/winbindd/winbindd_cm.c
index 8ea8155..7fb42a6 100644
--- a/source/winbindd/winbindd_cm.c
+++ b/source/winbindd/winbindd_cm.c
@@ -570,7 +570,7 @@ static bool get_dc_name_via_netlogon(const struct winbindd_domain *domain,
 	WERROR werr;
 	TALLOC_CTX *mem_ctx;
 	unsigned int orig_timeout;
-	fstring tmp;
+	char *tmp = NULL;
 	char *p;
 
 	/* Hmmmm. We can only open one connection to the NETLOGON pipe at the
@@ -602,7 +602,7 @@ static bool get_dc_name_via_netlogon(const struct winbindd_domain *domain,
 	orig_timeout = cli_set_timeout(netlogon_pipe->cli, 35000);
 	
 	werr = rpccli_netlogon_getanydcname(netlogon_pipe, mem_ctx, our_domain->dcname,
-					    domain->name, tmp);
+					    domain->name, &tmp);
 
 	/* And restore our original timeout. */
 	cli_set_timeout(netlogon_pipe->cli, orig_timeout);
diff --git a/source/winbindd/winbindd_misc.c b/source/winbindd/winbindd_misc.c
index 8c3ef5b..76f2554 100644
--- a/source/winbindd/winbindd_misc.c
+++ b/source/winbindd/winbindd_misc.c
@@ -231,7 +231,7 @@ void winbindd_getdcname(struct winbindd_cli_state *state)
 enum winbindd_result winbindd_dual_getdcname(struct winbindd_domain *domain,
 					     struct winbindd_cli_state *state)
 {
-	fstring dcname_slash;
+	char *dcname_slash = NULL;
 	char *p;
 	struct rpc_pipe_client *netlogon_pipe;
 	NTSTATUS result;
@@ -262,12 +262,12 @@ enum winbindd_result winbindd_dual_getdcname(struct winbindd_domain *domain,
 		werr = rpccli_netlogon_getdcname(netlogon_pipe, state->mem_ctx,
 						 domain->dcname,
 						 state->request.domain_name,
-						 dcname_slash);
+						 &dcname_slash);
 	} else {
 		werr = rpccli_netlogon_getanydcname(netlogon_pipe, state->mem_ctx,
 						    domain->dcname,
 						    state->request.domain_name,
-						    dcname_slash);
+						    &dcname_slash);
 	}
 	/* And restore our original timeout. */
 	cli_set_timeout(netlogon_pipe->cli, orig_timeout);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list