From 443421828a16bc33a59b43e0a2c400f51b3619a9 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vlendec@samba.org>
Date: Wed, 29 Nov 2006 08:51:18 +0000
Subject: r19946: in SetKeySec, sd is just a [in,ref] ptr (This used to be
 commit 38a88ed5d71c5781286ed12a858dcfb135b33c90)

---
 source3/librpc/gen_ndr/cli_winreg.c |  1 -
 source3/librpc/gen_ndr/ndr_winreg.c | 17 -----------------
 source3/librpc/gen_ndr/srv_winreg.c |  2 --
 source3/librpc/gen_ndr/winreg.h     |  1 -
 source3/librpc/idl/winreg.idl       |  2 +-
 5 files changed, 1 insertion(+), 22 deletions(-)

(limited to 'source3/librpc')

diff --git a/source3/librpc/gen_ndr/cli_winreg.c b/source3/librpc/gen_ndr/cli_winreg.c
index 7ace36ca52..0d52c54467 100644
--- a/source3/librpc/gen_ndr/cli_winreg.c
+++ b/source3/librpc/gen_ndr/cli_winreg.c
@@ -739,7 +739,6 @@ NTSTATUS rpccli_winreg_SetKeySecurity(struct rpc_pipe_client *cli, TALLOC_CTX *m
 	}
 	
 	/* Return variables */
-	*sd = *r.out.sd;
 	
 	/* Return result */
 	return werror_to_ntstatus(r.out.result);
diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c
index bc931dafe8..a9a8814e7b 100644
--- a/source3/librpc/gen_ndr/ndr_winreg.c
+++ b/source3/librpc/gen_ndr/ndr_winreg.c
@@ -2875,8 +2875,6 @@ NTSTATUS ndr_push_winreg_SetKeySecurity(struct ndr_push *ndr, int flags, const s
 		NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd));
 	}
 	if (flags & NDR_OUT) {
-		if (r->out.sd == NULL) return NT_STATUS_INVALID_PARAMETER_MIX;
-		NDR_CHECK(ndr_push_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd));
 		NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 	}
 	return NT_STATUS_OK;
@@ -2887,8 +2885,6 @@ NTSTATUS ndr_pull_winreg_SetKeySecurity(struct ndr_pull *ndr, int flags, struct
 	TALLOC_CTX *_mem_save_handle_0;
 	TALLOC_CTX *_mem_save_sd_0;
 	if (flags & NDR_IN) {
-		ZERO_STRUCT(r->out);
-
 		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 			NDR_PULL_ALLOC(ndr, r->in.handle);
 		}
@@ -2904,17 +2900,8 @@ NTSTATUS ndr_pull_winreg_SetKeySecurity(struct ndr_pull *ndr, int flags, struct
 		NDR_PULL_SET_MEM_CTX(ndr, r->in.sd, LIBNDR_FLAG_REF_ALLOC);
 		NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.sd));
 		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC);
-		NDR_PULL_ALLOC(ndr, r->out.sd);
-		*r->out.sd = *r->in.sd;
 	}
 	if (flags & NDR_OUT) {
-		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-			NDR_PULL_ALLOC(ndr, r->out.sd);
-		}
-		_mem_save_sd_0 = NDR_PULL_GET_MEM_CTX(ndr);
-		NDR_PULL_SET_MEM_CTX(ndr, r->out.sd, LIBNDR_FLAG_REF_ALLOC);
-		NDR_CHECK(ndr_pull_KeySecurityData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.sd));
-		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_sd_0, LIBNDR_FLAG_REF_ALLOC);
 		NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 	}
 	return NT_STATUS_OK;
@@ -2944,10 +2931,6 @@ _PUBLIC_ void ndr_print_winreg_SetKeySecurity(struct ndr_print *ndr, const char
 	if (flags & NDR_OUT) {
 		ndr_print_struct(ndr, "out", "winreg_SetKeySecurity");
 		ndr->depth++;
-		ndr_print_ptr(ndr, "sd", r->out.sd);
-		ndr->depth++;
-		ndr_print_KeySecurityData(ndr, "sd", r->out.sd);
-		ndr->depth--;
 		ndr_print_WERROR(ndr, "result", r->out.result);
 		ndr->depth--;
 	}
diff --git a/source3/librpc/gen_ndr/srv_winreg.c b/source3/librpc/gen_ndr/srv_winreg.c
index 674254c513..30b8da0f1b 100644
--- a/source3/librpc/gen_ndr/srv_winreg.c
+++ b/source3/librpc/gen_ndr/srv_winreg.c
@@ -1499,8 +1499,6 @@ static BOOL api_winreg_SetKeySecurity(pipes_struct *p)
 	if (DEBUGLEVEL >= 10)
 		NDR_PRINT_IN_DEBUG(winreg_SetKeySecurity, &r);
 	
-	ZERO_STRUCT(r.out);
-	r.out.sd = r.in.sd;
 	r.out.result = _winreg_SetKeySecurity(p, r.in.handle, r.in.access_mask, r.in.sd);
 	
 	if (p->rng_fault_state) {
diff --git a/source3/librpc/gen_ndr/winreg.h b/source3/librpc/gen_ndr/winreg.h
index 4703c3dc07..54ab5195d4 100644
--- a/source3/librpc/gen_ndr/winreg.h
+++ b/source3/librpc/gen_ndr/winreg.h
@@ -406,7 +406,6 @@ struct winreg_SetKeySecurity {
 	} in;
 
 	struct {
-		struct KeySecurityData *sd;/* [ref] */
 		WERROR result;
 	} out;
 
diff --git a/source3/librpc/idl/winreg.idl b/source3/librpc/idl/winreg.idl
index c4907a199f..6ec55cc6ed 100644
--- a/source3/librpc/idl/winreg.idl
+++ b/source3/librpc/idl/winreg.idl
@@ -275,7 +275,7 @@ import "lsa.idl", "initshutdown.idl", "security.idl";
 	WERROR winreg_SetKeySecurity(
 		[in,ref] policy_handle *handle,
 		[in] winreg_AccessMask access_mask,
-		[in,out,ref] KeySecurityData *sd
+		[in,ref] KeySecurityData *sd
 	);
 
 	/******************/
-- 
cgit