[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-977-gacd7fef

Günther Deschner gd at samba.org
Thu Apr 9 12:51:46 GMT 2009


The branch, master has been updated
       via  acd7fef984cba906163b7114a087ca3904e47566 (commit)
       via  0ee3c433c84cd740960216535f181b59bedbd374 (commit)
       via  f0d045be4fbbdc1cd3d76281b0cc3c2fc36e20de (commit)
      from  9945d15a5d184dc9a809072b7c01e5ddff96d26b (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit acd7fef984cba906163b7114a087ca3904e47566
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 9 13:27:08 2009 +0200

    s3-svcctl: Fix _svcctl_Set/GetServiceObjectSecurity after IDL changes.
    
    Guenther

commit 0ee3c433c84cd740960216535f181b59bedbd374
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 9 13:25:21 2009 +0200

    s3: re-run make samba3-idl.
    
    Guenther

commit f0d045be4fbbdc1cd3d76281b0cc3c2fc36e20de
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 9 10:19:03 2009 +0200

    svcctl: Fix IDL for svcctl_QueryServiceObjectSecurity and Set call.
    
    Guenther

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

Summary of changes:
 librpc/gen_ndr/cli_svcctl.c        |   14 +++++-----
 librpc/gen_ndr/cli_svcctl.h        |    8 +++---
 librpc/gen_ndr/ndr_svcctl.c        |   46 ++++++++++++++++++------------------
 librpc/gen_ndr/srv_svcctl.c        |    4 +-
 librpc/gen_ndr/svcctl.h            |    8 +++---
 librpc/idl/svcctl.idl              |   12 ++++----
 source3/rpc_server/srv_svcctl_nt.c |    5 ++-
 7 files changed, 49 insertions(+), 48 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/gen_ndr/cli_svcctl.c b/librpc/gen_ndr/cli_svcctl.c
index bc49121..1d9de55 100644
--- a/librpc/gen_ndr/cli_svcctl.c
+++ b/librpc/gen_ndr/cli_svcctl.c
@@ -189,8 +189,8 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
 						  TALLOC_CTX *mem_ctx,
 						  struct policy_handle *handle /* [in] [ref] */,
 						  uint32_t security_flags /* [in]  */,
-						  uint8_t *buffer /* [out] [ref,size_is(buffer_size)] */,
-						  uint32_t buffer_size /* [in] [range(0,0x40000)] */,
+						  uint8_t *buffer /* [out] [ref,size_is(offered)] */,
+						  uint32_t offered /* [in] [range(0,0x40000)] */,
 						  uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
 						  WERROR *werror)
 {
@@ -200,7 +200,7 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
 	/* In parameters */
 	r.in.handle = handle;
 	r.in.security_flags = security_flags;
-	r.in.buffer_size = buffer_size;
+	r.in.offered = offered;
 
 	if (DEBUGLEVEL >= 10) {
 		NDR_PRINT_IN_DEBUG(svcctl_QueryServiceObjectSecurity, &r);
@@ -225,7 +225,7 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
 	}
 
 	/* Return variables */
-	memcpy(buffer, r.out.buffer, r.in.buffer_size * sizeof(*buffer));
+	memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer));
 	*needed = *r.out.needed;
 
 	/* Return result */
@@ -240,8 +240,8 @@ NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
 						TALLOC_CTX *mem_ctx,
 						struct policy_handle *handle /* [in] [ref] */,
 						uint32_t security_flags /* [in]  */,
-						uint8_t *buffer /* [in] [ref,size_is(buffer_size)] */,
-						uint32_t buffer_size /* [in]  */,
+						uint8_t *buffer /* [in] [ref,size_is(offered)] */,
+						uint32_t offered /* [in]  */,
 						WERROR *werror)
 {
 	struct svcctl_SetServiceObjectSecurity r;
@@ -251,7 +251,7 @@ NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
 	r.in.handle = handle;
 	r.in.security_flags = security_flags;
 	r.in.buffer = buffer;
-	r.in.buffer_size = buffer_size;
+	r.in.offered = offered;
 
 	if (DEBUGLEVEL >= 10) {
 		NDR_PRINT_IN_DEBUG(svcctl_SetServiceObjectSecurity, &r);
diff --git a/librpc/gen_ndr/cli_svcctl.h b/librpc/gen_ndr/cli_svcctl.h
index 60a7fdf..0bd5f53 100644
--- a/librpc/gen_ndr/cli_svcctl.h
+++ b/librpc/gen_ndr/cli_svcctl.h
@@ -24,16 +24,16 @@ NTSTATUS rpccli_svcctl_QueryServiceObjectSecurity(struct rpc_pipe_client *cli,
 						  TALLOC_CTX *mem_ctx,
 						  struct policy_handle *handle /* [in] [ref] */,
 						  uint32_t security_flags /* [in]  */,
-						  uint8_t *buffer /* [out] [ref,size_is(buffer_size)] */,
-						  uint32_t buffer_size /* [in] [range(0,0x40000)] */,
+						  uint8_t *buffer /* [out] [ref,size_is(offered)] */,
+						  uint32_t offered /* [in] [range(0,0x40000)] */,
 						  uint32_t *needed /* [out] [ref,range(0,0x40000)] */,
 						  WERROR *werror);
 NTSTATUS rpccli_svcctl_SetServiceObjectSecurity(struct rpc_pipe_client *cli,
 						TALLOC_CTX *mem_ctx,
 						struct policy_handle *handle /* [in] [ref] */,
 						uint32_t security_flags /* [in]  */,
-						uint8_t *buffer /* [in] [ref,size_is(buffer_size)] */,
-						uint32_t buffer_size /* [in]  */,
+						uint8_t *buffer /* [in] [ref,size_is(offered)] */,
+						uint32_t offered /* [in]  */,
 						WERROR *werror);
 NTSTATUS rpccli_svcctl_QueryServiceStatus(struct rpc_pipe_client *cli,
 					  TALLOC_CTX *mem_ctx,
diff --git a/librpc/gen_ndr/ndr_svcctl.c b/librpc/gen_ndr/ndr_svcctl.c
index 06ea6db..117d497 100644
--- a/librpc/gen_ndr/ndr_svcctl.c
+++ b/librpc/gen_ndr/ndr_svcctl.c
@@ -1592,15 +1592,15 @@ static enum ndr_err_code ndr_push_svcctl_QueryServiceObjectSecurity(struct ndr_p
 			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 		}
 		NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags));
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
+		NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.security_flags));
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
 	}
 	if (flags & NDR_OUT) {
 		if (r->out.buffer == NULL) {
 			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 		}
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
-		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.buffer_size));
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
+		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered));
 		if (r->out.needed == NULL) {
 			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 		}
@@ -1624,13 +1624,13 @@ static enum ndr_err_code ndr_pull_svcctl_QueryServiceObjectSecurity(struct ndr_p
 		NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
 		NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
 		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
-		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags));
-		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size));
-		if (r->in.buffer_size > 0x40000) {
+		NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.security_flags));
+		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+		if (r->in.offered > 0x40000) {
 			return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
 		}
-		NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.buffer_size);
-		memset(r->out.buffer, 0, (r->in.buffer_size) * sizeof(*r->out.buffer));
+		NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered);
+		memset(r->out.buffer, 0, (r->in.offered) * sizeof(*r->out.buffer));
 		NDR_PULL_ALLOC(ndr, r->out.needed);
 		ZERO_STRUCTP(r->out.needed);
 	}
@@ -1652,7 +1652,7 @@ static enum ndr_err_code ndr_pull_svcctl_QueryServiceObjectSecurity(struct ndr_p
 		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
 		NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 		if (r->out.buffer) {
-			NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.buffer_size));
+			NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered));
 		}
 	}
 	return NDR_ERR_SUCCESS;
@@ -1672,8 +1672,8 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr,
 		ndr->depth++;
 		ndr_print_policy_handle(ndr, "handle", r->in.handle);
 		ndr->depth--;
-		ndr_print_uint32(ndr, "security_flags", r->in.security_flags);
-		ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size);
+		ndr_print_security_secinfo(ndr, "security_flags", r->in.security_flags);
+		ndr_print_uint32(ndr, "offered", r->in.offered);
 		ndr->depth--;
 	}
 	if (flags & NDR_OUT) {
@@ -1681,7 +1681,7 @@ _PUBLIC_ void ndr_print_svcctl_QueryServiceObjectSecurity(struct ndr_print *ndr,
 		ndr->depth++;
 		ndr_print_ptr(ndr, "buffer", r->out.buffer);
 		ndr->depth++;
-		ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.buffer_size);
+		ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered);
 		ndr->depth--;
 		ndr_print_ptr(ndr, "needed", r->out.needed);
 		ndr->depth++;
@@ -1700,13 +1700,13 @@ static enum ndr_err_code ndr_push_svcctl_SetServiceObjectSecurity(struct ndr_pus
 			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 		}
 		NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS, r->in.handle));
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.security_flags));
+		NDR_CHECK(ndr_push_security_secinfo(ndr, NDR_SCALARS, r->in.security_flags));
 		if (r->in.buffer == NULL) {
 			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 		}
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
-		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.buffer_size));
-		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.buffer_size));
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
+		NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.offered));
+		NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
 	}
 	if (flags & NDR_OUT) {
 		NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
@@ -1725,15 +1725,15 @@ static enum ndr_err_code ndr_pull_svcctl_SetServiceObjectSecurity(struct ndr_pul
 		NDR_PULL_SET_MEM_CTX(ndr, r->in.handle, LIBNDR_FLAG_REF_ALLOC);
 		NDR_CHECK(ndr_pull_policy_handle(ndr, NDR_SCALARS, r->in.handle));
 		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_handle_0, LIBNDR_FLAG_REF_ALLOC);
-		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.security_flags));
+		NDR_CHECK(ndr_pull_security_secinfo(ndr, NDR_SCALARS, &r->in.security_flags));
 		NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer));
 		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
 			NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer));
 		}
 		NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)));
-		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.buffer_size));
+		NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
 		if (r->in.buffer) {
-			NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.buffer_size));
+			NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.offered));
 		}
 	}
 	if (flags & NDR_OUT) {
@@ -1756,12 +1756,12 @@ _PUBLIC_ void ndr_print_svcctl_SetServiceObjectSecurity(struct ndr_print *ndr, c
 		ndr->depth++;
 		ndr_print_policy_handle(ndr, "handle", r->in.handle);
 		ndr->depth--;
-		ndr_print_uint32(ndr, "security_flags", r->in.security_flags);
+		ndr_print_security_secinfo(ndr, "security_flags", r->in.security_flags);
 		ndr_print_ptr(ndr, "buffer", r->in.buffer);
 		ndr->depth++;
-		ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.buffer_size);
+		ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.offered);
 		ndr->depth--;
-		ndr_print_uint32(ndr, "buffer_size", r->in.buffer_size);
+		ndr_print_uint32(ndr, "offered", r->in.offered);
 		ndr->depth--;
 	}
 	if (flags & NDR_OUT) {
diff --git a/librpc/gen_ndr/srv_svcctl.c b/librpc/gen_ndr/srv_svcctl.c
index 3d80472..cd5a0ee 100644
--- a/librpc/gen_ndr/srv_svcctl.c
+++ b/librpc/gen_ndr/srv_svcctl.c
@@ -353,7 +353,7 @@ static bool api_svcctl_QueryServiceObjectSecurity(pipes_struct *p)
 	}
 
 	ZERO_STRUCT(r->out);
-	r->out.buffer = talloc_zero_array(r, uint8_t, r->in.buffer_size);
+	r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered);
 	if (r->out.buffer == NULL) {
 		talloc_free(r);
 		return false;
@@ -3658,7 +3658,7 @@ NTSTATUS rpc_svcctl_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, c
 		case NDR_SVCCTL_QUERYSERVICEOBJECTSECURITY: {
 			struct svcctl_QueryServiceObjectSecurity *r = (struct svcctl_QueryServiceObjectSecurity *)_r;
 			ZERO_STRUCT(r->out);
-			r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.buffer_size);
+			r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered);
 			if (r->out.buffer == NULL) {
 			return NT_STATUS_NO_MEMORY;
 			}
diff --git a/librpc/gen_ndr/svcctl.h b/librpc/gen_ndr/svcctl.h
index f87d2cc..59bc039 100644
--- a/librpc/gen_ndr/svcctl.h
+++ b/librpc/gen_ndr/svcctl.h
@@ -341,11 +341,11 @@ struct svcctl_QueryServiceObjectSecurity {
 	struct {
 		struct policy_handle *handle;/* [ref] */
 		uint32_t security_flags;
-		uint32_t buffer_size;/* [range(0,0x40000)] */
+		uint32_t offered;/* [range(0,0x40000)] */
 	} in;
 
 	struct {
-		uint8_t *buffer;/* [ref,size_is(buffer_size)] */
+		uint8_t *buffer;/* [ref,size_is(offered)] */
 		uint32_t *needed;/* [ref,range(0,0x40000)] */
 		WERROR result;
 	} out;
@@ -357,8 +357,8 @@ struct svcctl_SetServiceObjectSecurity {
 	struct {
 		struct policy_handle *handle;/* [ref] */
 		uint32_t security_flags;
-		uint8_t *buffer;/* [ref,size_is(buffer_size)] */
-		uint32_t buffer_size;
+		uint8_t *buffer;/* [ref,size_is(offered)] */
+		uint32_t offered;
 	} in;
 
 	struct {
diff --git a/librpc/idl/svcctl.idl b/librpc/idl/svcctl.idl
index 2f461d6..8bbf514 100644
--- a/librpc/idl/svcctl.idl
+++ b/librpc/idl/svcctl.idl
@@ -156,9 +156,9 @@ import "misc.idl", "security.idl";
 	/* Function 0x04 */
 	WERROR svcctl_QueryServiceObjectSecurity(
 		[in] policy_handle *handle,
-		[in] uint32 security_flags,
-		[out,ref,size_is(buffer_size)] uint8 *buffer,
-		[in,range(0,0x40000)] uint32 buffer_size,
+		[in] security_secinfo security_flags,
+		[out,ref,size_is(offered)] uint8 *buffer,
+		[in,range(0,0x40000)] uint32 offered,
 		[out,ref,range(0,0x40000)] uint32 *needed
 	);
 
@@ -166,9 +166,9 @@ import "misc.idl", "security.idl";
 	/* Function 0x05 */
 	WERROR svcctl_SetServiceObjectSecurity(
 		[in] policy_handle *handle,
-		[in] uint32 security_flags,
-		[in,ref,size_is(buffer_size)] uint8 *buffer,
-		[in] uint32 buffer_size
+		[in] security_secinfo security_flags,
+		[in,ref,size_is(offered)] uint8 *buffer,
+		[in] uint32 offered
 	);
 
 	/*****************/
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index 1850dcb..8ed308a 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -872,7 +872,7 @@ WERROR _svcctl_QueryServiceObjectSecurity(pipes_struct *p,
 
 	*r->out.needed = ndr_size_security_descriptor( sec_desc, NULL, 0 );
 
-	if ( *r->out.needed > r->in.buffer_size ) {
+	if ( *r->out.needed > r->in.offered) {
 		ZERO_STRUCTP( &r->out.buffer );
 		return WERR_INSUFFICIENT_BUFFER;
 	}
@@ -932,7 +932,8 @@ WERROR _svcctl_SetServiceObjectSecurity(pipes_struct *p,
 	/* read the security descfriptor */
 
 	status = unmarshall_sec_desc(p->mem_ctx,
-				     r->in.buffer, r->in.buffer_size,
+				     r->in.buffer,
+				     r->in.offered,
 				     &sec_desc);
 	if (!NT_STATUS_IS_OK(status)) {
 		return ntstatus_to_werror(status);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list