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

tridge at samba.org tridge at samba.org
Wed Nov 2 01:01:21 GMT 2005


Author: tridge
Date: 2005-11-02 01:01:17 +0000 (Wed, 02 Nov 2005)
New Revision: 11457

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

Log:

fixed the winreg IDL and torture code so key and value enumerations
work again. The automatic value() is fine for the length, but cannot
be used for the size as the size is not the number of bytes being
sent, but the number of bytes that the server is allowed to use in the
reply

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	2005-11-02 00:59:01 UTC (rev 11456)
+++ branches/SAMBA_4_0/source/librpc/idl/winreg.idl	2005-11-02 01:01:17 UTC (rev 11457)
@@ -131,7 +131,10 @@
 
 	typedef struct {
 		[value(strlen_m(name)*2)] uint16 length; 
-		[value(strlen_m(name)*2)] uint16 size;
+		/* size cannot be auto-set by value() as it is the
+		   amount of space the server is allowed to use for this
+		   string in the reply, not its current size */
+		uint16 size;
 		[size_is(size/2),length_is(length/2),charset(UTF16)] uint16 *name;
 	} winreg_StringBuf;
 

Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/winreg.c	2005-11-02 00:59:01 UTC (rev 11456)
+++ branches/SAMBA_4_0/source/torture/rpc/winreg.c	2005-11-02 01:01:17 UTC (rev 11457)
@@ -403,6 +403,7 @@
 	printf("Testing EnumKey\n\n");
 
 	class.name   = "";
+	class.size   = 1024;
 
 	r.in.handle = handle;
 	r.in.enum_index = 0;
@@ -413,6 +414,7 @@
 
 	do {
 		name.name   = NULL;
+		name.size   = 1024;
 
 		status = dcerpc_winreg_EnumKey(p, mem_ctx, &r);
 
@@ -533,6 +535,7 @@
 	printf("testing EnumValue\n");
 
 	name.name   = "";
+	name.size   = 1024;
 
 	r.in.handle = handle;
 	r.in.enum_index = 0;
@@ -684,7 +687,7 @@
 		      const char *name, winreg_open_fn open_fn)
 {
 	struct policy_handle handle, newhandle;
-	BOOL ret = True, created = False, deleted = False;
+	BOOL ret = True, created = False, created2 = False, deleted = False;
 	struct winreg_OpenHKLM r;
 	NTSTATUS status;
 
@@ -742,20 +745,17 @@
 		ret = False;
 	}
 
-	if (created && !test_CreateKey_sd(p, mem_ctx, &handle, TEST_KEY2, 
+	if (created && test_CreateKey_sd(p, mem_ctx, &handle, TEST_KEY2, 
 					  NULL, &newhandle)) {
-		printf("CreateKey failed - not considering a failure\n");
-		created = False;
-	} else {
-		created = True;
+		created2 = True;
 	}
 
-	if (created && !test_GetKeySecurity(p, mem_ctx, &newhandle)) {
+	if (created2 && !test_GetKeySecurity(p, mem_ctx, &newhandle)) {
 		printf("GetKeySecurity failed\n");
 		ret = False;
 	}
 
-	if (created && !test_CloseKey(p, mem_ctx, &newhandle)) {
+	if (created2 && !test_CloseKey(p, mem_ctx, &newhandle)) {
 		printf("CloseKey failed\n");
 		ret = False;
 	}



More information about the samba-cvs mailing list