#define TEST_SID "S-1-5-21-1234567890-1234567890-1234567890-500"
-static void init_initshutdown_String(TALLOC_CTX *mem_ctx,
- struct initshutdown_String *name,
- const char *s)
+static void init_lsa_StringLarge(struct lsa_StringLarge *name, const char *s)
{
- name->name = talloc(mem_ctx, struct initshutdown_String_sub);
- name->name->name = s;
+ name->string = s;
}
static void init_winreg_String(struct winreg_String *name, const char *s)
SEC_ACE_FLAG_CONTAINER_INHERIT,
NULL);
- torture_assert_ntstatus_ok(tctx,
- ndr_push_struct_blob(&sdblob, tctx, sd,
+ torture_assert_ndr_success(tctx,
+ ndr_push_struct_blob(&sdblob, tctx, NULL, sd,
(ndr_push_flags_fn_t)ndr_push_security_descriptor),
"Failed to push security_descriptor ?!\n");
sd = talloc_zero(tctx, struct security_descriptor);
- torture_assert_ntstatus_ok(tctx,
- ndr_pull_struct_blob(&sdblob, tctx, sd,
+ torture_assert_ndr_success(tctx,
+ ndr_pull_struct_blob(&sdblob, tctx, NULL, sd,
(ndr_pull_flags_fn_t)ndr_pull_security_descriptor),
"pull_security_descriptor failed");
NDR_PRINT_DEBUG(security_descriptor, sd);
}
- torture_assert_ntstatus_ok(tctx,
- ndr_push_struct_blob(&sdblob, tctx, sd,
+ torture_assert_ndr_success(tctx,
+ ndr_push_struct_blob(&sdblob, tctx, NULL, sd,
(ndr_push_flags_fn_t)ndr_push_security_descriptor),
"push_security_descriptor failed");
uint16_t hostname = 0x0;
r.in.hostname = &hostname;
- r.in.message = talloc(tctx, struct initshutdown_String);
- init_initshutdown_String(tctx, r.in.message, "spottyfood");
+ r.in.message = talloc(tctx, struct lsa_StringLarge);
+ init_lsa_StringLarge(r.in.message, "spottyfood");
r.in.force_apps = 1;
r.in.timeout = 30;
r.in.reboot = 1;
uint16_t hostname = 0x0;
r.in.hostname = &hostname;
- r.in.message = talloc(tctx, struct initshutdown_String);
- init_initshutdown_String(tctx, r.in.message, "spottyfood");
+ r.in.message = talloc(tctx, struct lsa_StringLarge);
+ init_lsa_StringLarge(r.in.message, "spottyfood");
r.in.force_apps = 1;
r.in.timeout = 30;
r.in.reboot = 1;
test_Cleanup(p, tctx, &handle, TEST_KEY3);
test_Cleanup(p, tctx, &handle, TEST_KEY_BASE);
+ if (!test_CreateKey(p, tctx, &handle, TEST_KEY_BASE, NULL)) {
+ torture_comment(tctx,
+ "CreateKey (TEST_KEY_BASE) failed\n");
+ }
+
if (!test_CreateKey(p, tctx, &handle, TEST_KEY1, NULL)) {
torture_comment(tctx,
"CreateKey failed - not considering a failure\n");
}
if (created && deleted &&
- test_OpenKey(p, tctx, &handle, TEST_KEY1, &newhandle)) {
+ !_test_OpenKey(p, tctx, &handle, TEST_KEY1,
+ SEC_FLAG_MAXIMUM_ALLOWED, &newhandle,
+ WERR_BADFILE, NULL)) {
torture_comment(tctx,
- "DeleteKey failed (OpenKey after Delete worked)\n");
+ "DeleteKey failed (OpenKey after Delete "
+ "did not return WERR_BADFILE)\n");
ret = false;
}
created4 = true;
}
- if (!created4 && !test_CloseKey(p, tctx, &newhandle)) {
+ if (created4 && !test_CloseKey(p, tctx, &newhandle)) {
printf("CloseKey failed\n");
ret = false;
}
}
- if (created && !test_DeleteKey(p, tctx, &handle, TEST_KEY2)) {
+ if (created2 && !test_DeleteKey(p, tctx, &handle, TEST_KEY2)) {
printf("DeleteKey failed\n");
ret = false;
}
if(!test_key(p, tctx, &handle, MAX_DEPTH - 1)) {
ret = false;
}
- }
-
- if (!test_key(p, tctx, &handle, 0)) {
- ret = false;
+ } else {
+ if (!test_key(p, tctx, &handle, 0)) {
+ ret = false;
+ }
}
test_Cleanup(p, tctx, &handle, TEST_KEY_BASE);