mirror of
https://github.com/reactos/wine.git
synced 2024-12-02 08:46:29 +00:00
advapi32: Handle NULL DACL in SetSecurityInfo.
This commit is contained in:
parent
fd8a33fde8
commit
52df833a72
@ -5743,7 +5743,7 @@ DWORD WINAPI SetSecurityInfo(HANDLE handle, SE_OBJECT_TYPE ObjectType,
|
||||
SetSecurityDescriptorGroup(&sd, psidGroup, FALSE);
|
||||
if (SecurityInfo & DACL_SECURITY_INFORMATION)
|
||||
{
|
||||
if (ObjectType == SE_FILE_OBJECT)
|
||||
if (ObjectType == SE_FILE_OBJECT && pDacl)
|
||||
{
|
||||
SECURITY_DESCRIPTOR_CONTROL control;
|
||||
PSECURITY_DESCRIPTOR psd;
|
||||
|
@ -3633,6 +3633,22 @@ static void test_GetNamedSecurityInfoA(void)
|
||||
ok(h != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError());
|
||||
CloseHandle(h);
|
||||
|
||||
/* test setting NULL DACL */
|
||||
error = pSetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
|
||||
DACL_SECURITY_INFORMATION, NULL, NULL, NULL, NULL);
|
||||
ok(!error, "SetNamedSecurityInfoA failed with error %d\n", error);
|
||||
|
||||
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION,
|
||||
NULL, NULL, &pDacl, NULL, &pSD);
|
||||
ok(!error, "GetNamedSecurityInfo failed with error %d\n", error);
|
||||
todo_wine ok(!pDacl, "pDacl != NULL\n");
|
||||
LocalFree(pSD);
|
||||
|
||||
h = CreateFileA(tmpfile, GENERIC_READ, FILE_SHARE_DELETE|FILE_SHARE_WRITE|FILE_SHARE_READ,
|
||||
NULL, OPEN_EXISTING, 0, NULL);
|
||||
ok(h != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError());
|
||||
CloseHandle(h);
|
||||
|
||||
/* NtSetSecurityObject doesn't inherit DACL entries */
|
||||
pSD = sd+sizeof(void*)-((ULONG_PTR)sd)%sizeof(void*);
|
||||
InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION);
|
||||
|
Loading…
Reference in New Issue
Block a user