Commit 57a67ebc authored by Lionel Debroux's avatar Lionel Debroux Committed by Alexandre Julliard

advapi32/tests: Fix a typo.

parent 40c66b89
...@@ -1989,70 +1989,70 @@ static void test_ConvertSecurityDescriptorToString() ...@@ -1989,70 +1989,70 @@ static void test_ConvertSecurityDescriptorToString()
LocalFree(string); LocalFree(string);
InitializeSecurityDescriptor(&desc, SECURITY_DESCRIPTOR_REVISION); InitializeSecurityDescriptor(&desc, SECURITY_DESCRIPTOR_REVISION);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE(""); CHECK_RESULT_AND_FREE("");
size = 4096; size = 4096;
CreateWellKnownSid(WinLocalSid, NULL, sid_buf, &size); CreateWellKnownSid(WinLocalSid, NULL, sid_buf, &size);
SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, FALSE); SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, FALSE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:S-1-2-0"); CHECK_RESULT_AND_FREE("O:S-1-2-0");
SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, TRUE); SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, TRUE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:S-1-2-0"); CHECK_RESULT_AND_FREE("O:S-1-2-0");
size = sizeof(sid_buf); size = sizeof(sid_buf);
CreateWellKnownSid(WinLocalSystemSid, NULL, sid_buf, &size); CreateWellKnownSid(WinLocalSystemSid, NULL, sid_buf, &size);
SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, TRUE); SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, TRUE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SY"); CHECK_RESULT_AND_FREE("O:SY");
ConvertStringSidToSid("S-1-5-21-93476-23408-4576", &psid); ConvertStringSidToSid("S-1-5-21-93476-23408-4576", &psid);
SetSecurityDescriptorGroup(&desc, psid, TRUE); SetSecurityDescriptorGroup(&desc, psid, TRUE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576");
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, GROUP_SECURITY_INFORMATION, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, GROUP_SECURITY_INFORMATION, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("G:S-1-5-21-93476-23408-4576"); CHECK_RESULT_AND_FREE("G:S-1-5-21-93476-23408-4576");
pacl = (PACL)acl_buf; pacl = (PACL)acl_buf;
InitializeAcl(pacl, sizeof(acl_buf), ACL_REVISION); InitializeAcl(pacl, sizeof(acl_buf), ACL_REVISION);
SetSecurityDescriptorDacl(&desc, TRUE, pacl, TRUE); SetSecurityDescriptorDacl(&desc, TRUE, pacl, TRUE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:");
SetSecurityDescriptorDacl(&desc, TRUE, pacl, FALSE); SetSecurityDescriptorDacl(&desc, TRUE, pacl, FALSE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:");
ConvertStringSidToSid("S-1-5-6", &psid2); ConvertStringSidToSid("S-1-5-6", &psid2);
AddAccessAllowedAceEx(pacl, ACL_REVISION, NO_PROPAGATE_INHERIT_ACE, 0xf0000000, psid2); AddAccessAllowedAceEx(pacl, ACL_REVISION, NO_PROPAGATE_INHERIT_ACE, 0xf0000000, psid2);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)");
AddAccessAllowedAceEx(pacl, ACL_REVISION, INHERIT_ONLY_ACE|INHERITED_ACE, 0x00000003, psid2); AddAccessAllowedAceEx(pacl, ACL_REVISION, INHERIT_ONLY_ACE|INHERITED_ACE, 0x00000003, psid2);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)");
AddAccessDeniedAceEx(pacl, ACL_REVISION, OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE, 0xffffffff, psid); AddAccessDeniedAceEx(pacl, ACL_REVISION, OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE, 0xffffffff, psid);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)");
pacl = (PACL)acl_buf; pacl = (PACL)acl_buf;
InitializeAcl(pacl, sizeof(acl_buf), ACL_REVISION); InitializeAcl(pacl, sizeof(acl_buf), ACL_REVISION);
SetSecurityDescriptorSacl(&desc, TRUE, pacl, FALSE); SetSecurityDescriptorSacl(&desc, TRUE, pacl, FALSE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:");
SetSecurityDescriptorDacl(&desc, TRUE, NULL, FALSE); SetSecurityDescriptorDacl(&desc, TRUE, NULL, FALSE);
AddAuditAccessAceEx(pacl, ACL_REVISION, VALID_INHERIT_FLAGS, KEY_READ|KEY_WRITE, psid2, TRUE, TRUE); AddAuditAccessAceEx(pacl, ACL_REVISION, VALID_INHERIT_FLAGS, KEY_READ|KEY_WRITE, psid2, TRUE, TRUE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)");
AddAuditAccessAceEx(pacl, ACL_REVISION, NO_PROPAGATE_INHERIT_ACE, FILE_GENERIC_READ|FILE_GENERIC_WRITE, psid2, TRUE, FALSE); AddAuditAccessAceEx(pacl, ACL_REVISION, NO_PROPAGATE_INHERIT_ACE, FILE_GENERIC_READ|FILE_GENERIC_WRITE, psid2, TRUE, FALSE);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)"); CHECK_RESULT_AND_FREE("O:SYG:S-1-5-21-93476-23408-4576D:S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)");
} }
...@@ -2081,7 +2081,7 @@ static void test_PrivateObjectSecurity(void) ...@@ -2081,7 +2081,7 @@ static void test_PrivateObjectSecurity(void)
ok(GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION, buf, dwDescSize, &retSize), ok(GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION, buf, dwDescSize, &retSize),
"GetPrivateObjectSecurity failed (err=%u)\n", GetLastError()); "GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
ok(retSize <= dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize); ok(retSize <= dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("G:S-1-5-21-93476-23408-4576"); CHECK_RESULT_AND_FREE("G:S-1-5-21-93476-23408-4576");
GetSecurityDescriptorControl(buf, &ctrl, &dwRevision); GetSecurityDescriptorControl(buf, &ctrl, &dwRevision);
expect_eq(ctrl, 0x8000, int, "%x"); expect_eq(ctrl, 0x8000, int, "%x");
...@@ -2089,7 +2089,7 @@ static void test_PrivateObjectSecurity(void) ...@@ -2089,7 +2089,7 @@ static void test_PrivateObjectSecurity(void)
ok(GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, buf, dwDescSize, &retSize), ok(GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, buf, dwDescSize, &retSize),
"GetPrivateObjectSecurity failed (err=%u)\n", GetLastError()); "GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
ok(retSize <= dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize); ok(retSize <= dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed err=%u\n", GetLastError()); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed err=%u\n", GetLastError());
CHECK_RESULT_AND_FREE("G:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"); CHECK_RESULT_AND_FREE("G:S-1-5-21-93476-23408-4576D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)");
GetSecurityDescriptorControl(buf, &ctrl, &dwRevision); GetSecurityDescriptorControl(buf, &ctrl, &dwRevision);
expect_eq(ctrl, 0x8004, int, "%x"); expect_eq(ctrl, 0x8004, int, "%x");
...@@ -2097,7 +2097,7 @@ static void test_PrivateObjectSecurity(void) ...@@ -2097,7 +2097,7 @@ static void test_PrivateObjectSecurity(void)
ok(GetPrivateObjectSecurity(sec, sec_info, buf, dwDescSize, &retSize), ok(GetPrivateObjectSecurity(sec, sec_info, buf, dwDescSize, &retSize),
"GetPrivateObjectSecurity failed (err=%u)\n", GetLastError()); "GetPrivateObjectSecurity failed (err=%u)\n", GetLastError());
ok(retSize == dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize); ok(retSize == dwDescSize, "Buffer too small (%d vs %d)\n", retSize, dwDescSize);
ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Convertion failed\n"); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(buf, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n");
CHECK_RESULT_AND_FREE("O:SY" CHECK_RESULT_AND_FREE("O:SY"
"G:S-1-5-21-93476-23408-4576" "G:S-1-5-21-93476-23408-4576"
"D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)" "D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment