1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-09 04:16:08 +00:00

sechost: Support decimal or octal access rights in ConvertStringSecurityDescriptorToSecurityDescriptor.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2022-07-06 15:30:46 +03:00 committed by Alexandre Julliard
parent 4ce220e4e8
commit f2583de38d
2 changed files with 22 additions and 5 deletions

View File

@ -4219,6 +4219,7 @@ static void test_ConvertStringSecurityDescriptor(void)
BOOL ret;
DWORD GLE;
DWORD altGLE;
DWORD ace_Mask;
} cssd[] =
{
{ "D:(A;;GA;;;WD)", 0xdeadbeef, FALSE, ERROR_UNKNOWN_REVISION },
@ -4239,9 +4240,12 @@ static void test_ConvertStringSecurityDescriptor(void)
{ "D:(D;;GA;;; WD)", SDDL_REVISION_1, TRUE },
{ "D:(D;;GA;;;WD )", SDDL_REVISION_1, TRUE },
/* test ACE string access rights */
{ "D:(A;;GA;;;WD)", SDDL_REVISION_1, TRUE },
{ "D:(A;;GRGWGX;;;WD)", SDDL_REVISION_1, TRUE },
{ "D:(A;;RCSDWDWO;;;WD)", SDDL_REVISION_1, TRUE },
{ "D:(A;;GA;;;WD)", SDDL_REVISION_1, TRUE, 0, 0, GENERIC_ALL },
{ "D:(A;;1;;;WD)", SDDL_REVISION_1, TRUE, 0, 0, 1 },
{ "D:(A;;020000000000;;;WD)", SDDL_REVISION_1, TRUE, 0, 0, GENERIC_READ },
{ "D:(A;;0X40000000;;;WD)", SDDL_REVISION_1, TRUE, 0, 0, GENERIC_WRITE },
{ "D:(A;;GRGWGX;;;WD)", SDDL_REVISION_1, TRUE, 0, 0, GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE },
{ "D:(A;;RCSDWDWO;;;WD)", SDDL_REVISION_1, TRUE, 0, 0, READ_CONTROL | DELETE | WRITE_DAC | WRITE_OWNER },
{ "D:(A;;RPWPCCDCLCSWLODTCR;;;WD)", SDDL_REVISION_1, TRUE },
{ "D:(A;;FAFRFWFX;;;WD)", SDDL_REVISION_1, TRUE },
{ "D:(A;;KAKRKWKX;;;WD)", SDDL_REVISION_1, TRUE },
@ -4275,7 +4279,20 @@ static void test_ConvertStringSecurityDescriptor(void)
(cssd[i].altGLE && GLE == cssd[i].altGLE),
"(%02u) Unexpected last error %ld\n", i, GLE);
if (ret)
{
if (cssd[i].ace_Mask)
{
ACCESS_ALLOWED_ACE *ace;
acl = (ACL *)((char *)pSD + sizeof(SECURITY_DESCRIPTOR_RELATIVE));
ok(acl->AclRevision == ACL_REVISION, "(%02u) Got %u\n", i, acl->AclRevision);
ace = (ACCESS_ALLOWED_ACE *)(acl + 1);
ok(ace->Mask == cssd[i].ace_Mask, "(%02u) Expected %08lx, got %08lx\n",
i, cssd[i].ace_Mask, ace->Mask);
}
LocalFree(pSD);
}
}
/* test behaviour with NULL parameters */

View File

@ -900,8 +900,8 @@ static DWORD parse_ace_right( const WCHAR **string_ptr )
const WCHAR *string = *string_ptr;
unsigned int i;
if (string[0] == '0' && string[1] == 'x')
return wcstoul( string, (WCHAR **)string_ptr, 16 );
if (iswdigit( string[0] ))
return wcstoul( string, (WCHAR **)string_ptr, 0 );
for (i = 0; i < ARRAY_SIZE(ace_rights); ++i)
{