svn commit: samba r4156 - in branches/SAMBA_4_0/source: librpc/idl torture/rpc

jelmer at samba.org jelmer at samba.org
Sat Dec 11 23:28:48 GMT 2004


Author: jelmer
Date: 2004-12-11 23:28:48 +0000 (Sat, 11 Dec 2004)
New Revision: 4156

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

Log:
GetKeySecurity() IDL and torture test

Modified:
   branches/SAMBA_4_0/source/librpc/idl/winreg.idl
   branches/SAMBA_4_0/source/torture/rpc/winreg.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/winreg.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2004-12-11 20:06:40 UTC (rev 4155)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2004-12-11 23:28:48 UTC (rev 4156)
@@ -158,23 +158,17 @@
 	);
 
 	typedef struct {
-		uint32 max_len;
-		uint32 offset;
+		[size_is(size),length_is(len)] uint8 *data;
+		uint32 size;
 		uint32 len;
-	} KeySecuritySize;
-
-	typedef struct {
-		uint32 max_len;
-		DATA_BLOB data;
 	} KeySecurityData;
 
 	/******************/
 	/* Function: 0x0c */
 	WERROR winreg_GetKeySecurity(
 		[in,ref] policy_handle *handle,
-		[in] uint32 unknown,
-		[in,out] KeySecuritySize *size,
-		[in,out] KeySecurityData data
+		[in] uint32 access_mask,
+		[in,out,ref] KeySecurityData *data
 	);
 
 	/******************/

Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/winreg.c	2004-12-11 20:06:40 UTC (rev 4155)
+++ branches/SAMBA_4_0/source/torture/rpc/winreg.c	2004-12-11 23:28:48 UTC (rev 4156)
@@ -95,6 +95,36 @@
 	return True;
 }
 
+static BOOL test_GetKeySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
+			  struct policy_handle *handle)
+{
+	NTSTATUS status;
+	struct winreg_GetKeySecurity r;
+
+	printf("\ntesting GetKeySecurity\n");
+
+	ZERO_STRUCT(r);
+
+	r.in.handle = handle;
+	r.in.data = r.out.data =  talloc_zero_p(mem_ctx, struct KeySecurityData);
+	r.in.data->size = 0xffff;
+	r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+
+	status = dcerpc_winreg_GetKeySecurity(p, mem_ctx, &r);
+
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("GetKeySecurity failed - %s\n", nt_errstr(status));
+		return False;
+	}
+
+	if (!W_ERROR_IS_OK(r.out.result)) {
+		printf("GetKeySecurity failed - %s\n", win_errstr(r.out.result));
+		return False;
+	}
+
+	return False;
+}
+
 static BOOL test_CloseKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, 
 			  struct policy_handle *handle)
 {
@@ -540,12 +570,17 @@
 	if (!test_QueryInfoKey(p, mem_ctx, handle, NULL)) {
 	}
 
+
+	if (!test_GetKeySecurity(p, mem_ctx, handle)) {
+	}
+
 	if (!test_EnumKey(p, mem_ctx, handle, depth)) {
 	}
 
 	if (!test_EnumValue(p, mem_ctx, handle, 0xFF, 0xFFFF)) {
 	}
 
+
 	test_CloseKey(p, mem_ctx, handle);
 
 	return True;



More information about the samba-cvs mailing list