Rebase against 9eb56e25e37b4adec0d72875455ffb787238672f.

This commit is contained in:
Sebastian Lackner 2017-02-18 01:14:35 +01:00
parent 9c5d1ebec9
commit d9d5df9f73
10 changed files with 66 additions and 496 deletions

View File

@ -1,185 +0,0 @@
From 9904ee15d00d0809c12759446c09adc1981e3cf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 29 Aug 2016 19:45:47 +0200
Subject: advapi32: Implement AddMandatoryAce.
---
dlls/advapi32/security.c | 6 ++++--
dlls/advapi32/tests/security.c | 45 ++++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/ntdll.spec | 1 +
dlls/ntdll/sec.c | 25 +++++++++++++++++++++++
include/winbase.h | 1 +
include/winternl.h | 1 +
6 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 28331df..45c0f7e 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -1711,10 +1711,12 @@ BOOL WINAPI AddAce(
return set_ntstatus(RtlAddAce(pAcl, dwAceRevision, dwStartingAceIndex, pAceList, nAceListLength));
}
+/******************************************************************************
+ * AddMandatoryAce [ADVAPI32.@]
+ */
BOOL WINAPI AddMandatoryAce(ACL *acl, DWORD ace_revision, DWORD ace_flags, DWORD mandatory_policy, PSID label_sid)
{
- FIXME("%p %x %x %x %p - stub\n", acl, ace_revision, ace_flags, mandatory_policy, label_sid);
- return FALSE;
+ return set_ntstatus(RtlAddMandatoryAce(acl, ace_revision, ace_flags, mandatory_policy, SYSTEM_MANDATORY_LABEL_ACE_TYPE, label_sid));
}
/******************************************************************************
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 18f4e04..cdbe4f8 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -65,6 +65,7 @@
static BOOL (WINAPI *pAddAccessAllowedAceEx)(PACL, DWORD, DWORD, DWORD, PSID);
static BOOL (WINAPI *pAddAccessDeniedAceEx)(PACL, DWORD, DWORD, DWORD, PSID);
static BOOL (WINAPI *pAddAuditAccessAceEx)(PACL, DWORD, DWORD, DWORD, PSID, BOOL, BOOL);
+static BOOL (WINAPI *pAddMandatoryAce)(PACL,DWORD,DWORD,DWORD,PSID);
static VOID (WINAPI *pBuildTrusteeWithSidA)( PTRUSTEEA pTrustee, PSID pSid );
static VOID (WINAPI *pBuildTrusteeWithNameA)( PTRUSTEEA pTrustee, LPSTR pName );
static VOID (WINAPI *pBuildTrusteeWithObjectsAndNameA)( PTRUSTEEA pTrustee,
@@ -199,6 +200,7 @@ static void init(void)
pAddAccessAllowedAceEx = (void *)GetProcAddress(hmod, "AddAccessAllowedAceEx");
pAddAccessDeniedAceEx = (void *)GetProcAddress(hmod, "AddAccessDeniedAceEx");
pAddAuditAccessAceEx = (void *)GetProcAddress(hmod, "AddAuditAccessAceEx");
+ pAddMandatoryAce = (void *)GetProcAddress(hmod, "AddMandatoryAce");
pCheckTokenMembership = (void *)GetProcAddress(hmod, "CheckTokenMembership");
pConvertStringSecurityDescriptorToSecurityDescriptorA =
(void *)GetProcAddress(hmod, "ConvertStringSecurityDescriptorToSecurityDescriptorA" );
@@ -6064,6 +6066,48 @@ static void test_default_dacl_owner_sid(void)
CloseHandle( handle );
}
+static void test_integrity(void)
+{
+ static SID low_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY},
+ {SECURITY_MANDATORY_LOW_RID}};
+ SYSTEM_MANDATORY_LABEL_ACE *ace;
+ char buffer_acl[256];
+ ACL *pAcl = (ACL*)&buffer_acl;
+ BOOL ret, found;
+ DWORD index;
+
+ if (!pAddMandatoryAce)
+ {
+ win_skip("Mandatory integrity labels not supported, skipping test\n");
+ return;
+ }
+
+ ret = InitializeAcl(pAcl, 256, ACL_REVISION);
+ ok(ret, "InitializeAcl failed with %u\n", GetLastError());
+
+ ret = pAddMandatoryAce(pAcl, ACL_REVISION, 0, 0x1234, &low_level);
+ ok(!ret, "AddMandatoryAce succeeded\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER got %u\n", GetLastError());
+
+ ret = pAddMandatoryAce(pAcl, ACL_REVISION, 0, SYSTEM_MANDATORY_LABEL_NO_WRITE_UP, &low_level);
+ ok(ret, "AddMandatoryAce failed with %u\n", GetLastError());
+
+ index = 0;
+ found = FALSE;
+ while (pGetAce( pAcl, index++, (void **)&ace ))
+ {
+ if (ace->Header.AceType == SYSTEM_MANDATORY_LABEL_ACE_TYPE)
+ {
+ found = TRUE;
+ ok(ace->Header.AceFlags == 0, "Expected 0 as flags, got %x\n", ace->Header.AceFlags);
+ ok(ace->Mask == SYSTEM_MANDATORY_LABEL_NO_WRITE_UP,
+ "Expected SYSTEM_MANDATORY_LABEL_NO_WRITE_UP as flag, got %x\n", ace->Mask);
+ ok(EqualSid(&ace->SidStart, &low_level), "Expected low integrity level\n");
+ }
+ }
+ ok(found, "Could not find mandatory label\n");
+}
+
static void test_AdjustTokenPrivileges(void)
{
TOKEN_PRIVILEGES tp, prev;
@@ -6444,6 +6488,7 @@ START_TEST(security)
test_CreateRestrictedToken();
test_TokenIntegrityLevel();
test_default_dacl_owner_sid();
+ test_integrity();
test_AdjustTokenPrivileges();
test_AddAce();
test_system_security_access();
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 28aa2df..f6f8eba 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -422,6 +422,7 @@
@ stdcall RtlAddAuditAccessAceEx(ptr long long long ptr long long)
@ stdcall RtlAddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long)
# @ stub RtlAddCompoundAce
+@ stdcall RtlAddMandatoryAce(ptr long long long long ptr)
# @ stub RtlAddRange
@ cdecl -arch=arm,x86_64 RtlAddFunctionTable(ptr long long)
@ stdcall RtlAddRefActivationContext(ptr)
diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c
index 3bc52ac..daa2cae 100644
--- a/dlls/ntdll/sec.c
+++ b/dlls/ntdll/sec.c
@@ -1379,6 +1379,31 @@ NTSTATUS WINAPI RtlAddAuditAccessObjectAce(
return STATUS_NOT_IMPLEMENTED;
}
+/**************************************************************************
+ * RtlAddMandatoryAce [NTDLL.@]
+ */
+NTSTATUS WINAPI RtlAddMandatoryAce(
+ IN OUT PACL pAcl,
+ IN DWORD dwAceRevision,
+ IN DWORD dwAceFlags,
+ IN DWORD dwMandatoryFlags,
+ IN DWORD dwAceType,
+ IN PSID pSid)
+{
+ static DWORD valid_flags = SYSTEM_MANDATORY_LABEL_NO_WRITE_UP | SYSTEM_MANDATORY_LABEL_NO_READ_UP |
+ SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP;
+
+ TRACE("(%p,%d,0x%08x,0x%08x,%u,%p)\n",pAcl,dwAceRevision,dwAceFlags,dwMandatoryFlags, dwAceType, pSid);
+
+ if (dwAceType != SYSTEM_MANDATORY_LABEL_ACE_TYPE)
+ return STATUS_INVALID_PARAMETER;
+
+ if (dwMandatoryFlags & ~valid_flags)
+ return STATUS_INVALID_PARAMETER;
+
+ return add_access_ace(pAcl, dwAceRevision, dwAceFlags, dwMandatoryFlags, pSid, dwAceType);
+}
+
/******************************************************************************
* RtlValidAcl [NTDLL.@]
*/
diff --git a/include/winbase.h b/include/winbase.h
index eff5972..42c826d 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -1693,6 +1693,7 @@ WINBASEAPI ATOM WINAPI AddAtomW(LPCWSTR);
#define AddAtom WINELIB_NAME_AW(AddAtom)
WINADVAPI BOOL WINAPI AddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
WINADVAPI BOOL WINAPI AddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
+WINADVAPI BOOL WINAPI AddMandatoryAce(PACL,DWORD,DWORD,DWORD,PSID);
WINBASEAPI VOID WINAPI AddRefActCtx(HANDLE);
WINBASEAPI PVOID WINAPI AddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
WINADVAPI BOOL WINAPI AdjustTokenGroups(HANDLE,BOOL,PTOKEN_GROUPS,DWORD,PTOKEN_GROUPS,PDWORD);
diff --git a/include/winternl.h b/include/winternl.h
index f35091c..c104e6f 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2405,6 +2405,7 @@ NTSYSAPI NTSTATUS WINAPI RtlAddAtomToAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_
NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAce(PACL,DWORD,DWORD,PSID,BOOL,BOOL);
NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessAceEx(PACL,DWORD,DWORD,DWORD,PSID,BOOL,BOOL);
NTSYSAPI NTSTATUS WINAPI RtlAddAuditAccessObjectAce(PACL,DWORD,DWORD,DWORD,GUID*,GUID*,PSID,BOOL,BOOL);
+NTSYSAPI NTSTATUS WINAPI RtlAddMandatoryAce(PACL,DWORD,DWORD,DWORD,DWORD,PSID);
NTSYSAPI void WINAPI RtlAddRefActivationContext(HANDLE);
NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
NTSYSAPI NTSTATUS WINAPI RtlAdjustPrivilege(ULONG,BOOLEAN,BOOLEAN,PBOOLEAN);
--
2.9.0

View File

@ -1 +0,0 @@
Fixes: Implement advapi32.AddMandatoryAce

View File

@ -1,4 +1,4 @@
From 3743bfb6a418605e3d30f9b4dad57ec8e498ed71 Mon Sep 17 00:00:00 2001
From 616d2000a5dd5f9e68fe873a368e72dda49d6953 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 15 Oct 2016 19:50:46 +0200
Subject: ntdll: Implement FileIoCompletionNotificationInformation info class.
@ -7,13 +7,12 @@ Subject: ntdll: Implement FileIoCompletionNotificationInformation info class.
FIXME: The tests do not seem to work on all testbots yet.
FIXME: Could we use the existing wineserver call instead?
---
dlls/kernel32/file.c | 13 +++--
dlls/ntdll/file.c | 17 +++++++
dlls/ntdll/tests/file.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++
include/winternl.h | 8 +++
server/fd.c | 23 ++++++++-
server/protocol.def | 8 +++
6 files changed, 195 insertions(+), 4 deletions(-)
dlls/kernel32/file.c | 13 ++++++++++---
dlls/ntdll/file.c | 17 +++++++++++++++++
dlls/ntdll/tests/file.c | 3 +--
server/fd.c | 23 ++++++++++++++++++++++-
server/protocol.def | 8 ++++++++
5 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 3e93b0dfd78..f4e63bcaae6 100644
@ -72,172 +71,23 @@ index fd7f3dd955a..00131f11cf7 100644
io->u.Status = STATUS_INVALID_INFO_CLASS;
break;
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
index 1a02ce5eaa5..0a114e7cc73 100644
index 5053eb123d1..bf45cbfa522 100644
--- a/dlls/ntdll/tests/file.c
+++ b/dlls/ntdll/tests/file.c
@@ -3261,6 +3261,135 @@ static void test_file_all_name_information(void)
HeapFree( GetProcessHeap(), 0, file_name );
}
@@ -3277,12 +3277,11 @@ static void test_file_completion_information(void)
if (!(h = create_temp_file(0))) return;
+static void test_file_completion_information(void)
+{
+ static const char buf[] = "testdata";
+ FILE_IO_COMPLETION_NOTIFICATION_INFORMATION info;
+ OVERLAPPED ov, *pov;
+ IO_STATUS_BLOCK io;
+ NTSTATUS status;
+ DWORD num_bytes;
+ HANDLE port, h;
+ ULONG_PTR key;
+ BOOL ret;
+ int i;
+
+ if (!(h = create_temp_file(0))) return;
+
+ status = pNtSetInformationFile(h, &io, &info, sizeof(info) - 1, FileIoCompletionNotificationInformation);
+ ok(status == STATUS_INFO_LENGTH_MISMATCH || status == STATUS_INVALID_INFO_CLASS /* XP */,
+ "expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
+ if (status == STATUS_INVALID_INFO_CLASS)
+ {
+ CloseHandle(h);
+ return;
+ }
+
+ info.Flags = FILE_SKIP_COMPLETION_PORT_ON_SUCCESS;
+ status = pNtSetInformationFile(h, &io, &info, sizeof(info), FileIoCompletionNotificationInformation);
+ ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %08x\n", status);
+
+ CloseHandle(h);
+ if (!(h = create_temp_file(FILE_FLAG_OVERLAPPED))) return;
+
+ info.Flags = FILE_SKIP_SET_EVENT_ON_HANDLE;
+ status = pNtSetInformationFile(h, &io, &info, sizeof(info), FileIoCompletionNotificationInformation);
+ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
+
+ info.Flags = FILE_SKIP_SET_USER_EVENT_ON_FAST_IO;
+ status = pNtSetInformationFile(h, &io, &info, sizeof(info), FileIoCompletionNotificationInformation);
+ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
+
+ CloseHandle(h);
+ if (!(h = create_temp_file(FILE_FLAG_OVERLAPPED))) return;
+
+ memset(&ov, 0, sizeof(ov));
+ ov.hEvent = CreateEventA(NULL, TRUE, FALSE, NULL);
+ port = CreateIoCompletionPort(h, NULL, 0xdeadbeef, 0);
+ ok(port != NULL, "CreateIoCompletionPort failed, error %u\n", GetLastError());
+
+ for (i = 0; i < 10; i++)
+ {
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(h, buf, sizeof(buf), &num_bytes, &ov);
+ if (ret || GetLastError() != ERROR_IO_PENDING) break;
+ ret = GetOverlappedResult(h, &ov, &num_bytes, TRUE);
+ ok(ret, "GetOverlappedResult failed, error %u\n", GetLastError());
+ ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000);
+ ok(ret, "GetQueuedCompletionStatus failed, error %u\n", GetLastError());
+ ret = FALSE;
+ }
+ if (ret)
+ {
+ ok(num_bytes == sizeof(buf), "expected sizeof(buf), got %u\n", num_bytes);
+
+ key = 0;
+ pov = NULL;
+ ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000);
+ ok(ret, "GetQueuedCompletionStatus failed, error %u\n", GetLastError());
+ ok(key == 0xdeadbeef, "expected 0xdeadbeef, got %lx\n", key);
+ ok(pov == &ov, "expected %p, got %p\n", &ov, pov);
+ }
+ else
+ win_skip("WriteFile never returned TRUE\n");
+
+ info.Flags = FILE_SKIP_COMPLETION_PORT_ON_SUCCESS;
+ status = pNtSetInformationFile(h, &io, &info, sizeof(info), FileIoCompletionNotificationInformation);
+ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
+
+ for (i = 0; i < 10; i++)
+ {
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(h, buf, sizeof(buf), &num_bytes, &ov);
+ if (ret || GetLastError() != ERROR_IO_PENDING) break;
+ ret = GetOverlappedResult(h, &ov, &num_bytes, TRUE);
+ ok(ret, "GetOverlappedResult failed, error %u\n", GetLastError());
+ ret = FALSE;
+ }
+ if (ret)
+ {
+ ok(num_bytes == sizeof(buf), "expected sizeof(buf), got %u\n", num_bytes);
+
+ pov = (void *)0xdeadbeef;
+ ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 500);
+ ok(!ret, "GetQueuedCompletionStatus succeeded\n");
+ ok(pov == NULL, "expected NULL, got %p\n", pov);
+ }
+ else
+ win_skip("WriteFile never returned TRUE\n");
+
+ info.Flags = 0;
+ status = pNtSetInformationFile(h, &io, &info, sizeof(info), FileIoCompletionNotificationInformation);
+ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
+
+ for (i = 0; i < 10; i++)
+ {
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(h, buf, sizeof(buf), &num_bytes, &ov);
+ if (ret || GetLastError() != ERROR_IO_PENDING) break;
+ ret = GetOverlappedResult(h, &ov, &num_bytes, TRUE);
+ ok(ret, "GetOverlappedResult failed, error %u\n", GetLastError());
+ ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000);
+ ok(ret, "GetQueuedCompletionStatus failed, error %u\n", GetLastError());
+ ret = FALSE;
+ }
+ if (ret)
+ {
+ ok(num_bytes == sizeof(buf), "expected sizeof(buf), got %u\n", num_bytes);
+
+ pov = (void *)0xdeadbeef;
+ ret = GetQueuedCompletionStatus(port, &num_bytes, &key, &pov, 1000);
+ ok(!ret, "GetQueuedCompletionStatus succeeded\n");
+ ok(pov == NULL, "expected NULL, got %p\n", pov);
+ }
+ else
+ win_skip("WriteFile never returned TRUE\n");
+
+ CloseHandle(ov.hEvent);
+ CloseHandle(port);
+ CloseHandle(h);
+}
+
static void test_file_id_information(void)
{
BY_HANDLE_FILE_INFORMATION info;
@@ -4299,6 +4428,7 @@ START_TEST(file)
test_file_rename_information();
test_file_link_information();
test_file_disposition_information();
+ test_file_completion_information();
test_file_id_information();
test_query_volume_information_file();
test_query_attribute_information_file();
diff --git a/include/winternl.h b/include/winternl.h
index 2f2ea866ae7..08af643b334 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -741,6 +741,14 @@ typedef struct _FILE_ALL_INFORMATION {
FILE_NAME_INFORMATION NameInformation;
} FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION;
+typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION {
+ ULONG Flags;
+} FILE_IO_COMPLETION_NOTIFICATION_INFORMATION, *PFILE_IO_COMPLETION_NOTIFICATION_INFORMATION;
+
+#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
+#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
+#define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4
+
typedef enum _FSINFOCLASS {
FileFsVolumeInformation = 1,
FileFsLabelInformation,
status = pNtSetInformationFile(h, &io, &info, sizeof(info) - 1, FileIoCompletionNotificationInformation);
- todo_wine
ok(status == STATUS_INFO_LENGTH_MISMATCH || status == STATUS_INVALID_INFO_CLASS /* XP */,
"expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
if (status == STATUS_INVALID_INFO_CLASS || status == STATUS_NOT_IMPLEMENTED)
{
- skip("FileIoCompletionNotificationInformation class not supported\n");
+ win_skip("FileIoCompletionNotificationInformation class not supported\n");
CloseHandle(h);
return;
}
diff --git a/server/fd.c b/server/fd.c
index 732a5b798f3..8ff5f9801ad 100644
--- a/server/fd.c

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "a2f2de1e960d37840bb0df541e31d64941e65197"
echo "9eb56e25e37b4adec0d72875455ffb787238672f"
}
# Show version information
@ -86,7 +86,6 @@ patch_enable_all ()
enable_Coverity="$1"
enable_Pipelight="$1"
enable_Staging="$1"
enable_advapi32_AddMandatoryAce="$1"
enable_advapi32_GetExplicitEntriesFromAclW="$1"
enable_advapi32_LookupSecurityDescriptorParts="$1"
enable_advapi32_LsaLookupSids="$1"
@ -348,7 +347,6 @@ patch_enable_all ()
enable_user32_Auto_Radio_Button="$1"
enable_user32_Combobox_WM_SIZE="$1"
enable_user32_DM_SETDEFID="$1"
enable_user32_DeferWindowPos="$1"
enable_user32_DialogBoxParam="$1"
enable_user32_Dialog_Focus="$1"
enable_user32_Dialog_Paint_Event="$1"
@ -470,9 +468,6 @@ patch_enable ()
Staging)
enable_Staging="$2"
;;
advapi32-AddMandatoryAce)
enable_advapi32_AddMandatoryAce="$2"
;;
advapi32-GetExplicitEntriesFromAclW)
enable_advapi32_GetExplicitEntriesFromAclW="$2"
;;
@ -1256,9 +1251,6 @@ patch_enable ()
user32-DM_SETDEFID)
enable_user32_DM_SETDEFID="$2"
;;
user32-DeferWindowPos)
enable_user32_DeferWindowPos="$2"
;;
user32-DialogBoxParam)
enable_user32_DialogBoxParam="$2"
;;
@ -2118,9 +2110,6 @@ if test "$enable_server_Pipe_ObjectName" -eq 1; then
fi
if test "$enable_server_LABEL_SECURITY_INFORMATION" -eq 1; then
if test "$enable_advapi32_AddMandatoryAce" -gt 1; then
abort "Patchset advapi32-AddMandatoryAce disabled, but server-LABEL_SECURITY_INFORMATION depends on that."
fi
if test "$enable_advapi32_GetExplicitEntriesFromAclW" -gt 1; then
abort "Patchset advapi32-GetExplicitEntriesFromAclW disabled, but server-LABEL_SECURITY_INFORMATION depends on that."
fi
@ -2130,7 +2119,6 @@ if test "$enable_server_LABEL_SECURITY_INFORMATION" -eq 1; then
if test "$enable_server_Stored_ACLs" -gt 1; then
abort "Patchset server-Stored_ACLs disabled, but server-LABEL_SECURITY_INFORMATION depends on that."
fi
enable_advapi32_AddMandatoryAce=1
enable_advapi32_GetExplicitEntriesFromAclW=1
enable_server_Misc_ACL=1
enable_server_Stored_ACLs=1
@ -2522,19 +2510,6 @@ if test "$enable_Staging" -eq 1; then
) >> "$patchlist"
fi
# Patchset advapi32-AddMandatoryAce
# |
# | Modified files:
# | * dlls/advapi32/security.c, dlls/advapi32/tests/security.c, dlls/ntdll/ntdll.spec, dlls/ntdll/sec.c, include/winbase.h,
# | include/winternl.h
# |
if test "$enable_advapi32_AddMandatoryAce" -eq 1; then
patch_apply advapi32-AddMandatoryAce/0001-advapi32-Implement-AddMandatoryAce.patch
(
printf '%s\n' '+ { "Michael Müller", "advapi32: Implement AddMandatoryAce.", 1 },';
) >> "$patchlist"
fi
# Patchset advapi32-GetExplicitEntriesFromAclW
# |
# | Modified files:
@ -4718,8 +4693,8 @@ fi
# | * [#38960] Add support for kernel32.SetFileCompletionNotificationModes
# |
# | Modified files:
# | * dlls/kernel32/file.c, dlls/ntdll/file.c, dlls/ntdll/tests/file.c, dlls/ws2_32/tests/sock.c, include/winternl.h,
# | server/fd.c, server/protocol.def
# | * dlls/kernel32/file.c, dlls/ntdll/file.c, dlls/ntdll/tests/file.c, dlls/ws2_32/tests/sock.c, server/fd.c,
# | server/protocol.def
# |
if test "$enable_kernel32_SetFileCompletionNotificationModes" -eq 1; then
patch_apply kernel32-SetFileCompletionNotificationModes/0001-ntdll-Implement-FileIoCompletionNotificationInformat.patch
@ -6529,8 +6504,7 @@ fi
# Patchset server-LABEL_SECURITY_INFORMATION
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * advapi32-AddMandatoryAce, advapi32-GetExplicitEntriesFromAclW, server-Misc_ACL, ntdll-DOS_Attributes, server-
# | File_Permissions, server-Stored_ACLs
# | * advapi32-GetExplicitEntriesFromAclW, server-Misc_ACL, ntdll-DOS_Attributes, server-File_Permissions, server-Stored_ACLs
# |
# | Modified files:
# | * dlls/advapi32/tests/security.c, dlls/ntdll/nt.c, dlls/ntdll/sec.c, include/winnt.h, server/handle.c, server/object.c,
@ -7313,21 +7287,6 @@ if test "$enable_user32_DM_SETDEFID" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-DeferWindowPos
# |
# | This patchset fixes the following Wine bugs:
# | * [#23187] Fix error handling in DeferWindowPos when passing an invalid HWND
# |
# | Modified files:
# | * dlls/user32/winpos.c
# |
if test "$enable_user32_DeferWindowPos" -eq 1; then
patch_apply user32-DeferWindowPos/0001-user32-Fix-error-handling-in-Begin-End-DeferWindowPo.patch
(
printf '%s\n' '+ { "Rodrigo Rivas", "user32: Fix error handling in {Begin,End,}DeferWindowPos() to match Windows behavior.", 1 },';
) >> "$patchlist"
fi
# Patchset user32-DialogBoxParam
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,4 +1,4 @@
From a05c00f17a61a2d34a5e439b5c4f835f011187b0 Mon Sep 17 00:00:00 2001
From d5ba417b0a446d5c6fccfec1d44999c32fb106c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 29 Aug 2016 20:35:51 +0200
Subject: server: Implement querying the security label of a security
@ -11,18 +11,18 @@ Subject: server: Implement querying the security label of a security
3 files changed, 134 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 98f98721a0c..877250c1ebf 100644
index 90b8392313d..57297760832 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -6435,10 +6435,15 @@ static void test_integrity(void)
@@ -6383,10 +6383,15 @@ static void test_AddMandatoryAce(void)
static SID low_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY},
{SECURITY_MANDATORY_LOW_RID}};
{SECURITY_MANDATORY_LOW_RID}};
SYSTEM_MANDATORY_LABEL_ACE *ace;
+ char buffer_sd[SECURITY_DESCRIPTOR_MIN_LENGTH];
+ SECURITY_DESCRIPTOR *sd2, *sd = (SECURITY_DESCRIPTOR *)&buffer_sd;
+ SECURITY_ATTRIBUTES sa;
char buffer_acl[256];
ACL *pAcl = (ACL*)&buffer_acl;
ACL *pAcl = (ACL *)&buffer_acl;
- BOOL ret, found;
- DWORD index;
+ ACL *sAcl;
@ -32,7 +32,7 @@ index 98f98721a0c..877250c1ebf 100644
if (!pAddMandatoryAce)
{
@@ -6446,6 +6451,36 @@ static void test_integrity(void)
@@ -6394,6 +6399,36 @@ static void test_AddMandatoryAce(void)
return;
}
@ -69,10 +69,10 @@ index 98f98721a0c..877250c1ebf 100644
ret = InitializeAcl(pAcl, 256, ACL_REVISION);
ok(ret, "InitializeAcl failed with %u\n", GetLastError());
@@ -6470,6 +6505,47 @@ static void test_integrity(void)
}
@@ -6418,6 +6453,47 @@ static void test_AddMandatoryAce(void)
found = TRUE;
}
ok(found, "Could not find mandatory label\n");
ok(found, "Could not find mandatory label ace\n");
+
+ ret = SetSecurityDescriptorSacl(sd, TRUE, pAcl, FALSE);
+ ok(ret, "SetSecurityDescriptorSacl failed with %u\n", GetLastError());
@ -116,12 +116,12 @@ index 98f98721a0c..877250c1ebf 100644
+ CloseHandle(handle);
}
static void test_AdjustTokenPrivileges(void)
static void test_system_security_access(void)
diff --git a/include/winnt.h b/include/winnt.h
index 392f77b217d..97d6295bdef 100644
index de7622fbe6f..0af83dcbcb7 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -5282,6 +5282,7 @@ typedef struct _TAPE_GET_MEDIA_PARAMETERS {
@@ -5276,6 +5276,7 @@ typedef struct _TAPE_GET_MEDIA_PARAMETERS {
#define GROUP_SECURITY_INFORMATION 0x00000002
#define DACL_SECURITY_INFORMATION 0x00000004
#define SACL_SECURITY_INFORMATION 0x00000008
@ -130,10 +130,10 @@ index 392f77b217d..97d6295bdef 100644
#define REG_OPTION_RESERVED 0x00000000
#define REG_OPTION_NON_VOLATILE 0x00000000
diff --git a/server/handle.c b/server/handle.c
index 391f4688b6a..3d5485fcdf9 100644
index 3f42352bceb..5ffcd74e464 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -710,6 +710,52 @@ DECL_HANDLER(set_security_object)
@@ -700,6 +700,52 @@ DECL_HANDLER(set_security_object)
release_object( obj );
}
@ -186,7 +186,7 @@ index 391f4688b6a..3d5485fcdf9 100644
DECL_HANDLER(get_security_object)
{
const struct security_descriptor *sd;
@@ -719,6 +765,7 @@ DECL_HANDLER(get_security_object)
@@ -709,6 +755,7 @@ DECL_HANDLER(get_security_object)
int present;
const SID *owner, *group;
const ACL *sacl, *dacl;
@ -194,7 +194,7 @@ index 391f4688b6a..3d5485fcdf9 100644
if (req->security_info & SACL_SECURITY_INFORMATION)
access |= ACCESS_SYSTEM_SECURITY;
@@ -746,6 +793,12 @@ DECL_HANDLER(get_security_object)
@@ -736,6 +783,12 @@ DECL_HANDLER(get_security_object)
sacl = sd_get_sacl( sd, &present );
if (req->security_info & SACL_SECURITY_INFORMATION && present)
req_sd.sacl_len = sd->sacl_len;
@ -207,7 +207,7 @@ index 391f4688b6a..3d5485fcdf9 100644
else
req_sd.sacl_len = 0;
@@ -776,7 +829,9 @@ DECL_HANDLER(get_security_object)
@@ -766,7 +819,9 @@ DECL_HANDLER(get_security_object)
set_error(STATUS_BUFFER_TOO_SMALL);
}

View File

@ -1,4 +1,4 @@
From 703cd39ce88d6b50c0ca7da3ba7533ac3ce91950 Mon Sep 17 00:00:00 2001
From 8147386e251ecad87d6df713d0396c2d097ab83a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 30 Aug 2016 01:15:44 +0200
Subject: server: Implement changing the label of a security descriptor.
@ -10,28 +10,28 @@ Subject: server: Implement changing the label of a security descriptor.
3 files changed, 243 insertions(+), 4 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 877250c1ebf..84a451eb834 100644
index 57297760832..685ab1c2b5f 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -6434,6 +6434,8 @@ static void test_integrity(void)
@@ -6382,6 +6382,8 @@ static void test_AddMandatoryAce(void)
{
static SID low_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY},
{SECURITY_MANDATORY_LOW_RID}};
{SECURITY_MANDATORY_LOW_RID}};
+ static SID medium_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY},
+ {SECURITY_MANDATORY_MEDIUM_RID}};
+ {SECURITY_MANDATORY_MEDIUM_RID}};
SYSTEM_MANDATORY_LABEL_ACE *ace;
char buffer_sd[SECURITY_DESCRIPTOR_MIN_LENGTH];
SECURITY_DESCRIPTOR *sd2, *sd = (SECURITY_DESCRIPTOR *)&buffer_sd;
@@ -6441,7 +6443,7 @@ static void test_integrity(void)
@@ -6389,7 +6391,7 @@ static void test_AddMandatoryAce(void)
char buffer_acl[256];
ACL *pAcl = (ACL*)&buffer_acl;
ACL *pAcl = (ACL *)&buffer_acl;
ACL *sAcl;
- BOOL defaulted, present, ret, found;
+ BOOL defaulted, present, ret, found, found2;
HANDLE handle;
DWORD index, size;
@@ -6545,6 +6547,115 @@ static void test_integrity(void)
@@ -6493,6 +6495,115 @@ static void test_AddMandatoryAce(void)
ok(found, "Could not find mandatory label\n");
HeapFree(GetProcessHeap(), 0, sd2);
@ -148,10 +148,10 @@ index 877250c1ebf..84a451eb834 100644
}
diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c
index f588545f322..5cf6c788ffb 100644
index 3f7aa793236..5c858b5bcbb 100644
--- a/dlls/ntdll/sec.c
+++ b/dlls/ntdll/sec.c
@@ -1782,7 +1782,8 @@ NTSTATUS WINAPI NtSetSecurityObject(HANDLE Handle,
@@ -1775,7 +1775,8 @@ NTSTATUS WINAPI NtSetSecurityObject(HANDLE Handle,
return STATUS_INVALID_SECURITY_DESCR;
}
@ -162,10 +162,10 @@ index f588545f322..5cf6c788ffb 100644
status = RtlGetSaclSecurityDescriptor( SecurityDescriptor, &present, &sacl, &defaulted );
if (status != STATUS_SUCCESS) return status;
diff --git a/server/handle.c b/server/handle.c
index 3d5485fcdf9..a0e27b9507e 100644
index 5ffcd74e464..3a216702026 100644
--- a/server/handle.c
+++ b/server/handle.c
@@ -683,12 +683,89 @@ DECL_HANDLER(get_object_info)
@@ -673,12 +673,89 @@ DECL_HANDLER(get_object_info)
release_object( obj );
}
@ -255,7 +255,7 @@ index 3d5485fcdf9..a0e27b9507e 100644
if (!sd_is_valid( sd, sd_size ))
{
@@ -697,7 +774,8 @@ DECL_HANDLER(set_security_object)
@@ -687,7 +764,8 @@ DECL_HANDLER(set_security_object)
}
if (req->security_info & OWNER_SECURITY_INFORMATION ||
@ -265,7 +265,7 @@ index 3d5485fcdf9..a0e27b9507e 100644
access |= WRITE_OWNER;
if (req->security_info & SACL_SECURITY_INFORMATION)
access |= ACCESS_SYSTEM_SECURITY;
@@ -706,8 +784,57 @@ DECL_HANDLER(set_security_object)
@@ -696,8 +774,57 @@ DECL_HANDLER(set_security_object)
if (!(obj = get_handle_obj( current->process, req->handle, access, NULL ))) return;

View File

@ -1,4 +1,4 @@
From 43ddf2395d512c436fb8912c81d8596f6a16aaab Mon Sep 17 00:00:00 2001
From f7d7038841ba9db93e50fee369e3e8c2b595c74b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 12 Jan 2017 05:58:02 +0100
Subject: server: Assign a default label (high) to all tokens.
@ -11,19 +11,19 @@ Subject: server: Assign a default label (high) to all tokens.
4 files changed, 103 insertions(+), 1 deletion(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 8f0cff78695..44321553226 100644
index 579b444a560..d6ea3a19fad 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -6436,6 +6436,8 @@ static void test_integrity(void)
{SECURITY_MANDATORY_LOW_RID}};
@@ -6487,6 +6487,8 @@ static void test_AddMandatoryAce(void)
{SECURITY_MANDATORY_LOW_RID}};
static SID medium_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY},
{SECURITY_MANDATORY_MEDIUM_RID}};
{SECURITY_MANDATORY_MEDIUM_RID}};
+ static SID high_level = {SID_REVISION, 1, {SECURITY_MANDATORY_LABEL_AUTHORITY},
+ {SECURITY_MANDATORY_HIGH_RID}};
+ {SECURITY_MANDATORY_HIGH_RID}};
SYSTEM_MANDATORY_LABEL_ACE *ace;
char buffer_sd[SECURITY_DESCRIPTOR_MIN_LENGTH];
SECURITY_DESCRIPTOR *sd2, *sd = (SECURITY_DESCRIPTOR *)&buffer_sd;
@@ -6657,6 +6659,45 @@ static void test_integrity(void)
@@ -6708,6 +6710,45 @@ static void test_AddMandatoryAce(void)
HeapFree(GetProcessHeap(), 0, sd2);
CloseHandle(handle);
@ -68,8 +68,8 @@ index 8f0cff78695..44321553226 100644
+ CloseHandle(handle);
}
static void test_AdjustTokenPrivileges(void)
@@ -7274,7 +7315,6 @@ static void test_token_security_descriptor(void)
static void test_system_security_access(void)
@@ -7282,7 +7323,6 @@ static void test_token_security_descriptor(void)
defaulted = TRUE;
ret = GetSecurityDescriptorDacl(sd2, &present, &pAcl2, &defaulted);
ok(ret, "GetSecurityDescriptorDacl failed with %u\n", GetLastError());
@ -114,7 +114,7 @@ index 0342f643187..ee927f91a3d 100644
int impersonation_level, const struct security_descriptor *sd );
extern int token_check_privileges( struct token *token, int all_required,
diff --git a/server/token.c b/server/token.c
index 74a97bb1319..99a62de0ffa 100644
index 85e931b2876..3b5c498147d 100644
--- a/server/token.c
+++ b/server/token.c
@@ -70,6 +70,7 @@ static const SID interactive_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY },

View File

@ -1,5 +1,4 @@
Fixes: Implement support for LABEL_SECURITY_INFORMATION
Depends: advapi32-AddMandatoryAce
Depends: advapi32-GetExplicitEntriesFromAclW
Depends: server-Stored_ACLs
Depends: server-Misc_ACL

View File

@ -1,50 +0,0 @@
From 171fae0615017e437a374cb543bbd98cfe7b88d4 Mon Sep 17 00:00:00 2001
From: Rodrigo Rivas <rodrigorivascosta@gmail.com>
Date: Tue, 25 Aug 2015 15:08:43 +0200
Subject: user32: Fix error handling in {Begin,End,}DeferWindowPos() to match
Windows behavior (resend)
---
dlls/user32/winpos.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 4915aad..b9f549e 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -2422,7 +2422,6 @@ BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
{
DWP *pDWP;
WINDOWPOS *winpos;
- BOOL res = TRUE;
int i;
TRACE("%p\n", hdwp);
@@ -2434,20 +2433,20 @@ BOOL WINAPI EndDeferWindowPos( HDWP hdwp )
return FALSE;
}
- for (i = 0, winpos = pDWP->winPos; res && i < pDWP->actualCount; i++, winpos++)
+ for (i = 0, winpos = pDWP->winPos; i < pDWP->actualCount; i++, winpos++)
{
TRACE("hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n",
winpos->hwnd, winpos->hwndInsertAfter, winpos->x, winpos->y,
winpos->cx, winpos->cy, winpos->flags);
if (WIN_IsCurrentThread( winpos->hwnd ))
- res = USER_SetWindowPos( winpos );
+ USER_SetWindowPos( winpos );
else
- res = SendMessageW( winpos->hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)winpos );
+ SendMessageW( winpos->hwnd, WM_WINE_SETWINDOWPOS, 0, (LPARAM)winpos );
}
HeapFree( GetProcessHeap(), 0, pDWP->winPos );
HeapFree( GetProcessHeap(), 0, pDWP );
- return res;
+ return TRUE;
}
--
2.7.1

View File

@ -1,2 +0,0 @@
Fixes: [23187] Fix error handling in DeferWindowPos when passing an invalid HWND
# From: http://source.winehq.org/patches/data/113938