[SCM] Samba Shared Repository - branch master updated
Günther Deschner
gd at samba.org
Wed Jun 23 07:42:16 MDT 2010
The branch, master has been updated
via ba40f38... s4-smbtorture: test more valid key names in RPC-WINREG.
via 2dc50ec... s4-smbtorture: more work on test values WINREG test.
from 740c97b... Fix to undo nasty hack for for grouptype conversion
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit ba40f3828180ba63debb4b3578c0e0faf16f6cbc
Author: Günther Deschner <gd at samba.org>
Date: Wed Jun 23 15:00:06 2010 +0200
s4-smbtorture: test more valid key names in RPC-WINREG.
Guenther
commit 2dc50ec44c4e9af144733f028122970be83332ba
Author: Günther Deschner <gd at samba.org>
Date: Wed Jun 23 14:59:27 2010 +0200
s4-smbtorture: more work on test values WINREG test.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source4/torture/rpc/winreg.c | 73 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 71 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index eec8de7..f0510d8 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -2014,7 +2014,13 @@ static bool test_SetValue_values(struct dcerpc_binding_handle *b,
"torture,value",
"torture;value",
"torture/value",
- "torture\\value"
+ "torture\\value",
+ "torture_value_name",
+ "torture value name",
+ "torture,value,name",
+ "torture;value;name",
+ "torture/value/name",
+ "torture\\value\\name",
};
int i;
@@ -2026,7 +2032,9 @@ static bool test_SetValue_values(struct dcerpc_binding_handle *b,
uint32_t w_size, w_length;
uint8_t *w_data;
- blob = data_blob_string_const("binary_blob");
+ blob = data_blob_talloc(tctx, NULL, 32);
+
+ generate_random_buffer(blob.data, 32);
torture_assert(tctx,
test_SetValue(b, tctx, handle, values[i], REG_BINARY, blob.data, blob.length),
@@ -2128,6 +2136,65 @@ static bool test_SetValue_extended(struct dcerpc_binding_handle *b,
return true;
}
+static bool test_create_keynames(struct dcerpc_binding_handle *b,
+ struct torture_context *tctx,
+ struct policy_handle *handle)
+{
+ const char *keys[] = {
+ "torture_key",
+ "torture key",
+ "torture,key",
+ "torture/key",
+ "torture\\key",
+ };
+ int i;
+
+ for (i=0; i < ARRAY_SIZE(keys); i++) {
+
+ enum winreg_CreateAction action_taken;
+ struct policy_handle new_handle;
+ char *q, *tmp;
+
+ torture_assert(tctx,
+ test_CreateKey_opts(tctx, b, handle, keys[i], NULL,
+ REG_OPTION_NON_VOLATILE,
+ SEC_FLAG_MAXIMUM_ALLOWED,
+ NULL,
+ WERR_OK,
+ &action_taken,
+ &new_handle),
+ talloc_asprintf(tctx, "failed to create '%s' key", keys[i]));
+
+ torture_assert_int_equal(tctx, action_taken, REG_CREATED_NEW_KEY, "unexpected action");
+
+ torture_assert(tctx,
+ test_DeleteKey_opts(b, tctx, handle, keys[i], WERR_OK),
+ "failed to delete key");
+
+ torture_assert(tctx,
+ test_DeleteKey_opts(b, tctx, handle, keys[i], WERR_BADFILE),
+ "failed 2nd delete key");
+
+ tmp = talloc_strdup(tctx, keys[i]);
+
+ q = strchr(tmp, '\\');
+ if (q != NULL) {
+ *q = '\0';
+ q++;
+
+ torture_assert(tctx,
+ test_DeleteKey_opts(b, tctx, handle, tmp, WERR_OK),
+ "failed to delete key");
+
+ torture_assert(tctx,
+ test_DeleteKey_opts(b, tctx, handle, tmp, WERR_BADFILE),
+ "failed 2nd delete key");
+ }
+ }
+
+ return true;
+}
+
#define KEY_CURRENT_VERSION "SOFTWARE\\MICROSOFT\\WINDOWS NT\\CURRENTVERSION"
#define VALUE_CURRENT_VERSION "CurrentVersion"
@@ -2542,6 +2609,8 @@ static bool test_key_base(struct torture_context *tctx,
"values SetValue test failed");
torture_assert(tctx, test_SetValue_extended(b, tctx, &newhandle),
"extended SetValue test failed");
+ torture_assert(tctx, test_create_keynames(b, tctx, &newhandle),
+ "keyname CreateKey test failed");
} else {
torture_assert(tctx, test_CreateKey_keytypes(tctx, b, &newhandle, test_key1, hkey),
"keytype test failed");
--
Samba Shared Repository
More information about the samba-cvs
mailing list