Compare commits

...

245 Commits

Author SHA1 Message Date
Alistair Leslie-Hughes
34ba08404f Release v6.5 2021-03-28 18:24:50 +11:00
Zebediah Figura
7b199110bb Rebase against 71d41b37a1917cdf20cdb171dc73c20dbfdaeefa. 2021-03-27 10:31:02 -05:00
Alistair Leslie-Hughes
3d3cbfce86 Updated ntdll-Hide_Wine_Exports patchset 2021-03-26 15:05:50 +11:00
Alistair Leslie-Hughes
0547bb4578 Rebase against 34652f37e443a9e7698f66d13df3b4811b1c0cc3. 2021-03-26 10:38:20 +11:00
Zebediah Figura
f20c33fa04 Rebase against 12cfe6826773708e3b15f73b9674ccb959000d8b. 2021-03-24 16:48:35 -05:00
Zebediah Figura
a644c49d6d winmm-Delay_Import_Depends: Remove patch set.
This was fixed upstream at some point.
2021-03-24 11:27:50 -05:00
Zebediah Figura
d2102728fe Rebase against f69c8f018188af49d5a3916f7bb7e3ab984fd3ec. 2021-03-23 17:24:09 -05:00
Zebediah Figura
a93d3b6369 Use source.winehq.org in CI scripts. 2021-03-22 18:20:56 -05:00
Zebediah Figura
09fdb3b5c9 Rebase against d1764a45cfd12f8c5699fd7428cf90f90a2d31ef.
Actually rebase this time.
2021-03-22 18:18:36 -05:00
Zebediah Figura
5897bc1d27 Rebase against 41df83c50e1c3cfdd6e8ffb65de7838f8503632c. 2021-03-22 17:37:48 -05:00
Zebediah Figura
f8b6fde40c Rebase against 41df83c50e1c3cfdd6e8ffb65de7838f8503632c. 2021-03-19 21:15:35 -05:00
Alistair Leslie-Hughes
34d5c3568f Rebase against 6d26689484070b2c4ad4e0e16812c6eb8176cd40. 2021-03-19 14:27:44 +11:00
Zebediah Figura
44af049de7 Rebase against 2828d0820a1661e46f606f28db090d710cef11f4. 2021-03-18 00:32:41 -05:00
Alistair Leslie-Hughes
c747e46d75 Rebase against 4d5824112e13160e538013a25f1c13a124565180. 2021-03-17 09:44:07 +11:00
Zebediah Figura
1f89c15143 Rebase against 23ffd0a7986421958c23cffce138afa389209920. 2021-03-15 18:28:35 -05:00
Alistair Leslie-Hughes
7ec998e17a Release v6.4 2021-03-15 08:31:03 +11:00
Zebediah Figura
186c17f454 ntdll-Junction_Points: Updates from Erich E. Hoover. 2021-03-12 21:53:58 -06:00
Zebediah Figura
4a427fa757 Rebase against 4336ed0b84b3dd3097bbbbf8e4b9de2e4d444ad7. 2021-03-12 16:12:02 -06:00
Alistair Leslie-Hughes
5bcba4ef5a Rebase against 0ae1669ec2798193b11fd2d2ac74d51203f673b2. 2021-03-12 10:33:43 +11:00
Zebediah Figura
acc0de4def Rebase against 580413032c61bc142078d08efb1d1167fe385a97. 2021-03-10 19:40:52 -06:00
Zebediah Figura
3790a70510 setupapi-SPFILENOTIFY_FILEINCABINET: Remove patch set.
This is fixed upstream now.
2021-03-09 17:07:04 -06:00
Alistair Leslie-Hughes
e7c08665ab Rebase against 9107f591d3d73a3b4040db2e13ef51d9846591c9. 2021-03-10 08:55:33 +11:00
Alistair Leslie-Hughes
a11594e19e Merge pull request #77 from Gcenx/master
Add a GitHub action to test building for macOS
2021-03-07 13:14:15 +11:00
Dean M Greer
bbebe570f3 Create macOS.yml 2021-03-06 07:11:22 -05:00
Zebediah Figura
89c049ee68 ntdll-Junction_Points: Updates from Erich E. Hoover. 2021-03-05 21:27:36 -06:00
Zebediah Figura
f4cb879b3d ntdll-NtAlertThreadByThreadId: Include mach/mach.h in unix_private.h.
Thanks to Dean Greer for finding this one.
2021-03-05 21:24:30 -06:00
Zebediah Figura
cb2a6e06e1 Rebase against 5bccf6fc3f309207ef4162df335157649f627f50. 2021-03-05 21:21:19 -06:00
Zebediah Figura
3a33c70a9a Rebase against 31af1aeb7895bddf59a73886b89759f76881bc9e. 2021-03-04 17:50:31 -06:00
Alistair Leslie-Hughes
64efb6f0d3 Added ntdll-RtlFirstFreeAce patchset 2021-03-04 12:06:54 +11:00
Alistair Leslie-Hughes
404b698d44 Rebase against 6d5659103f49db9e045087dd0093acc3b9a4b919. 2021-03-04 11:24:46 +11:00
Erich E. Hoover
a2ca43d98b ntdll-Junction_Points: Fix compilation on MacOS. 2021-03-02 20:26:41 -06:00
Zebediah Figura
0b1ffe4b94 Rebase against 7fa74fa78e2f8fedeea6fa3c796f0f2eb202825e. 2021-03-02 20:22:19 -06:00
Zebediah Figura
5d8901ac21 ntdll-set_full_cpu_context: Remove patch set.
These prefixes are redundant. We're restoring the context from 32-bit code, so
%ss = %ds already, and if we're on this side of the code then our %ss = the
target %ss.

Still, why was the patch written?

Before 44fbc018ed, there was a single path to restore contexts, and it looked
like this:

    output( "2:\tpushl 0x94(%%ecx)\n");     /* SegEs */
    output( "\tpopl %%es\n" );
    output( "\tpushl 0x90(%%ecx)\n");       /* SegFs */
    output( "\tpopl %%fs\n" );
    output( "\tpushl 0x8c(%%ecx)\n");       /* SegGs */
    output( "\tpopl %%gs\n" );

    output( "\tmovl 0x9c(%%ecx),%%edi\n");  /* Edi */
    output( "\tmovl 0xa0(%%ecx),%%esi\n");  /* Esi */
    output( "\tmovl 0xa8(%%ecx),%%edx\n");  /* Edx */
    output( "\tmovl 0xa4(%%ecx),%%ebx\n");  /* Ebx */
    output( "\tmovl 0xb0(%%ecx),%%eax\n");  /* Eax */
    output( "\tmovl 0xb4(%%ecx),%%ebp\n");  /* Ebp */

    output( "\tpushl 0xc8(%%ecx)\n");       /* SegSs */
    output( "\tpopl %%ss\n" );
    output( "\tmovl 0xc4(%%ecx),%%esp\n");  /* Esp */

    output( "\tpushl 0xc0(%%ecx)\n");       /* EFlags */
    output( "\tpushl 0xbc(%%ecx)\n");       /* SegCs */
    output( "\tpushl 0xb8(%%ecx)\n");       /* Eip */
    output( "\tpushl 0x98(%%ecx)\n");       /* SegDs */
    output( "\tmovl 0xac(%%ecx),%%ecx\n");  /* Ecx */

    output( "\tpopl %%ds\n" );
    output( "\tiret\n" );

Very simple: we restore most registers (but not %ds), then switch stacks, then
push control registers and %ds to the current (target) stack, then pop %ds and
iret.

This was vulnerable to signal races:

+    /* As soon as we have switched stacks the context structure could
+     * be invalid (when signal handlers are executed for example). Copy
+     * values on the target stack before changing ESP. */

so 44fbc018ed changed the path to a different one:

    output( "\tpushl 0xc8(%%ecx)\n" );      /* SegSs */
    output( "\tpopl %%es\n" );
    output( "\tmovl 0xc4(%%ecx),%%eax\n" ); /* Esp */
    output( "\tleal -4*4(%%eax),%%eax\n" );

    output( "\tmovl 0xc0(%%ecx),%%edx\n" ); /* EFlags */
    output( "\t.byte 0x26\n\tmovl %%edx,3*4(%%eax)\n" );
    output( "\tmovl 0xbc(%%ecx),%%edx\n" ); /* SegCs */
    output( "\t.byte 0x26\n\tmovl %%edx,2*4(%%eax)\n" );
    output( "\tmovl 0xb8(%%ecx),%%edx\n" ); /* Eip */
    output( "\t.byte 0x26\n\tmovl %%edx,1*4(%%eax)\n" );
    output( "\tmovl 0xb0(%%ecx),%%edx\n" ); /* Eax */
    output( "\t.byte 0x26\n\tmovl %%edx,0*4(%%eax)\n" );

    output( "\tpushl %%es\n" );
    output( "\tpushl 0x98(%%ecx)\n" );      /* SegDs */

    output(" \tpushl 0x94(%%ecx)\n" );      /* SegEs */
    output( "\tpopl %%es\n" );
    output( "\tpushl 0x90(%%ecx)\n");       /* SegFs */
    output( "\tpopl %%fs\n" );
    output( "\tpushl 0x8c(%%ecx)\n");       /* SegGs */
    output( "\tpopl %%gs\n" );

    output( "\tmovl 0x9c(%%ecx),%%edi\n" ); /* Edi */
    output( "\tmovl 0xa0(%%ecx),%%esi\n" ); /* Esi */
    output( "\tmovl 0xa4(%%ecx),%%ebx\n" ); /* Ebx */
    output( "\tmovl 0xa8(%%ecx),%%edx\n" ); /* Edx */
    output( "\tmovl 0xb4(%%ecx),%%ebp\n" ); /* Ebp */
    output( "\tmovl 0xac(%%ecx),%%ecx\n" ); /* Ecx */

    output( "\tpopl %%ds\n" );
    output( "\tpopl %%ss\n" );
    output( "\tmovl %%eax,%%esp\n" );

    output( "\tpopl %%eax\n" );
    output( "\tiret\n" );

That is, we set %es to the target %ss, write control regs onto the target stack
using %es, switch to the target stack, then pop + iret. In this case the %es
overrides make perfect sense: the target stack might be different from ours
(i.e. we are returning to 16-bit code).

Evidently this was invalid:

+    /* Restore the context when the stack segment changes. We can't use
+     * the same code as above because we do not know if the stack segment
+     * is 16 or 32 bit, and 'movl' will throw an exception when we try to
+     * access memory above the limit. */

In 4c8b3f63be1 slackner introduced two different paths. If we need to switch
stacks, we use the original path. (I think it's still vulnerable to signal
races, but we have no way of preventing those.) Meanwhile the other path can be
simplified a bit, since we're already on the target stack:

-    output( "\tpushl 0xc8(%%ecx)\n" );      /* SegSs */
-    output( "\tpopl %%es\n" );
     output( "\tmovl 0xc4(%%ecx),%%eax\n" ); /* Esp */
     output( "\tleal -4*4(%%eax),%%eax\n" );

     output( "\tmovl 0xc0(%%ecx),%%edx\n" ); /* EFlags */
-    output( "\t.byte 0x26\n\tmovl %%edx,3*4(%%eax)\n" );
+    output( "\t.byte 0x36\n\tmovl %%edx,3*4(%%eax)\n" );
     output( "\tmovl 0xbc(%%ecx),%%edx\n" ); /* SegCs */
-    output( "\t.byte 0x26\n\tmovl %%edx,2*4(%%eax)\n" );
+    output( "\t.byte 0x36\n\tmovl %%edx,2*4(%%eax)\n" );
     output( "\tmovl 0xb8(%%ecx),%%edx\n" ); /* Eip */
-    output( "\t.byte 0x26\n\tmovl %%edx,1*4(%%eax)\n" );
+    output( "\t.byte 0x36\n\tmovl %%edx,1*4(%%eax)\n" );
     output( "\tmovl 0xb0(%%ecx),%%edx\n" ); /* Eax */
-    output( "\t.byte 0x26\n\tmovl %%edx,0*4(%%eax)\n" );
+    output( "\t.byte 0x36\n\tmovl %%edx,0*4(%%eax)\n" );

-    output( "\tpushl %%es\n" );
     output( "\tpushl 0x98(%%ecx)\n" );      /* SegDs */

@@ -890,11 +889,37 @@ static void build_call_from_regs_x86(void)
     output( "\tmovl 0xac(%%ecx),%%ecx\n" ); /* Ecx */

     output( "\tpopl %%ds\n" );
-    output( "\tpopl %%ss\n" );
     output( "\tmovl %%eax,%%esp\n" );

     output( "\tpopl %%eax\n" );
     output( "\tiret\n" );

Sebastian got rid of the setting of %es, and replaced the %es prefixes with %ss
prefixes. What I think happened is that he made a subtle mistake—or, well, not a
mistake, but a redundancy. %es: was changed to %ss: by analogy, but it's
actually not necessary: we're operating on the source stack, and we know the
source stack is 32-bit, and we haven't set %ds yet, so %ds == %ss already, and
we can use the %implicit %ds prefix.

Alexandre presumably saw this in bab6ece63, and silently removed them. My guess
is that Sebastian saw that, wasn't sure, but (in the best case) didn't want to
submit his fix upstream until he had checked whether it was actually correct,
and never got around to checking. (Alternatively, he thought that the %ss should
have been retained for clarity, and decided not to try to submit that upstream.)
2021-03-02 20:22:01 -06:00
Zebediah Figura
6b24c39d32 Rebase against 3c2db20f66806074b047b0b3c76aa86ad79e3175. 2021-03-01 16:31:44 -06:00
Zebediah Figura
15f4220e49 Fix some whitespace errors. 2021-02-28 15:17:57 -06:00
Zebediah Figura
b0ddfb4172 Remove obsolete dependencies from some definition files. 2021-02-28 15:09:58 -06:00
Zebediah Figura
0fb17feeaa ntdll-NtQueryVirtualMemory: Remove patch 0007.
K32GetMappedFileName() is implemented upstream now.
2021-02-28 15:06:13 -06:00
Zebediah Figura
ba02aa0e4d ntdll-NtAlertThreadByThreadId: Restore the NTDLL_UNIXLIB_VERSION changes. 2021-02-27 17:16:06 -06:00
Alistair Leslie-Hughes
e83fdffe77 Release v6.3 2021-02-27 17:52:14 +11:00
Zebediah Figura
750044c08c ntdll-Junction_Points: Updates from Erich E. Hoover.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50586
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50285
2021-02-27 00:07:31 -06:00
Zebediah Figura
dfc989712e server-default_integrity: Support the "runas" verb, and set EnableLUA to 1.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50727
2021-02-26 22:47:31 -06:00
Zebediah Figura
783002b5de Rebase against 0f972e2247932f255f131792724e4796b4b2b87a. 2021-02-26 22:46:07 -06:00
Zebediah Figura
806bbc0198 wow64cpu-Wow64Transition: Fix rebase. 2021-02-25 21:40:19 -06:00
Zebediah Figura
e4debaae9b Rebase against 35e43ccf1b42e9f67d7765753f0c3ef8cf102c46. 2021-02-25 21:04:11 -06:00
Alistair Leslie-Hughes
9a7b25dfd2 Rebase against 1649389edca12d2998f72a159b2bbbf247176163. 2021-02-25 10:39:29 +11:00
Alistair Leslie-Hughes
43a3110e95 Rebase against 4981785f0fbcafbdc6a9dc4f71d06b137d558597.
This rebase is affected by the same upstream bug.
https://bugs.winehq.org/show_bug.cgi?id=50713
2021-02-23 13:31:24 +11:00
Zebediah Figura
0d3a7a3596 nvapi-Stub_DLL: Build nvapi and nvapi64 with msvcrt. 2021-02-21 14:25:13 -06:00
Zebediah Figura
101e672955 api-ms-win-Stub_DLLs: Build iertutil with msvcrt. 2021-02-21 14:25:13 -06:00
Zebediah Figura
29ce68fa31 api-ms-win-Stub_DLLs: Use --prefer-native instead of DLL_WINE_PREATTACH. 2021-02-21 14:01:58 -06:00
Zebediah Figura
3486cceeba nvcuda-CUDA_Support: Don't temporarily prefer native. 2021-02-21 13:58:51 -06:00
Zebediah Figura
37fa6ccbbd packager-DllMain: Use --prefer-native instead of DLL_WINE_PREATTACH. 2021-02-21 13:55:56 -06:00
Zebediah Figura
9aeea5d12e Rebase against 4de079bb7247c8b849558c0f27a280a9546c5570. 2021-02-19 19:32:08 -06:00
Zebediah Figura
aa8a3d90cb Rebase against b8719736c5a022fa9c50f64adfc3ef58b40460f2. 2021-02-18 20:16:43 -06:00
Zebediah Figura
811467bf6a server-default_integrity: New patch set.
This patch set, as an alternative approach to advapi32-Token_Integrity_Level,
creates all processes as a limited administrator by default. This doesn't
actually seem to break most applications, apparently since they assume that
their manifest is enough to force them to run as administrator and don't bother
verifying that's what they get, and since we don't actually prevent accessing
low-integrity objects. I'm adding this patch to wine-staging in order to smoke
out any applications that might be broken, as it's still a very risky patch.
2021-02-17 20:57:47 -06:00
Zebediah Figura
2a9a56c4d0 Rebase against c6a3072051fb88edd3847c750c2ec852f11870f6. 2021-02-17 20:40:31 -06:00
Alistair Leslie-Hughes
d0873d2c72 Rebase against a55a37d1dae2231d8dec9f3191449f89be0b10dc. 2021-02-17 09:56:43 +11:00
Alistair Leslie-Hughes
4046ffe6c9 Rebase against a9c8196e97ec255f4f69d005ea1cbf8fcf2537e8. 2021-02-16 11:02:22 +11:00
Alistair Leslie-Hughes
3b5ea332d6 Release v6.2 2021-02-13 17:25:34 +11:00
Alistair Leslie-Hughes
81e3e6dafa Rebase against 4f7e621dc58fd82924e64c695dc61a78c55fd44e. 2021-02-13 17:11:37 +11:00
Alistair Leslie-Hughes
41cb9f5179 Rebase against b922b5aeef18fd30b13a4e86c115d68e505c9393. 2021-02-12 11:53:19 +11:00
Zebediah Figura
41e15516bd Rebase against 2d6b0b67d91b6433744ec859b10b8ee8eb4a37b3. 2021-02-10 19:45:27 -06:00
Zebediah Figura
6347bdd1fc Rebase against 7a9745022b1bfcc235b922be98a8fdc91976c587. 2021-02-08 16:01:40 -06:00
Zebediah Figura
677b445b0d Rebase against 4f1b297a14bbd304fb20da7c4b64266c14d110e5. 2021-02-05 18:01:09 -06:00
Zebediah Figura
a2f82c5c85 Rebase against dd417540bb3afb3aa5a04a007eea9a7ee347655b. 2021-02-04 17:28:33 -06:00
Zebediah Figura
cfe1b94e0f ntdll-Junction_Points: Updates from Erich E. Hoover. 2021-02-03 19:44:26 -06:00
Zebediah Figura
2be4bfb8fe Rebase against 2201ca08fb03d069fa2ccf46773c150a6f7988bc. 2021-02-03 16:10:49 -06:00
Alistair Leslie-Hughes
cae1b3eba0 Rebase against 433b9081ba7c862feb947400f507228e793d7d4c. 2021-02-03 10:11:33 +11:00
Alistair Leslie-Hughes
32b29ad4d8 Updated xactengine3_7-Notification patchset 2021-02-02 11:34:34 +11:00
Alistair Leslie-Hughes
a6054cf2e9 Rebase against cfbbde2abce1eedc7f53db3f8af8078fe4a11cac. 2021-02-02 10:51:17 +11:00
Alistair Leslie-Hughes
f6dacd2f9a Release v6.1 2021-01-31 19:09:00 +11:00
Alistair Leslie-Hughes
43c064ef3c Rebase against 47ac628b4a4e476c1b044765c95d5be2a7101d14. 2021-01-31 18:52:51 +11:00
Alistair Leslie-Hughes
5c5a8f3b2c Rebase against f72ef20e88fba67254caf0124ab8713e3d15fa2a. 2021-01-29 11:11:41 +11:00
Alistair Leslie-Hughes
bd135b1477 Updated xactengine3_7-Notification patchset 2021-01-28 13:24:47 +11:00
Alistair Leslie-Hughes
9692b2e5eb Rebase against 24b9203d3544001dd51894f1c1edd99819367198. 2021-01-28 09:08:29 +11:00
Alistair Leslie-Hughes
bcf5899a3c Drop ntdll-Interrupt-0x2e patchset
The program itself later updated not to use that interrupt, and nobody seems to have an old copy of it.
2021-01-27 11:19:20 +11:00
Alistair Leslie-Hughes
73480ec459 Rebase against c1824d578ac514d29e79a5a00d6759f11dbe4813. 2021-01-27 11:13:11 +11:00
Alistair Leslie-Hughes
fd3372e71c Rebase against 2d6462cdee2bd87a49382794e5a554f33c367f09. 2021-01-26 15:37:12 +11:00
Alistair Leslie-Hughes
3dec70bf32 Updated dsound-EAX patchset 2021-01-25 19:18:14 +11:00
Zebediah Figura
b201ee708b ntdll-NtAlertThreadByThreadId: Various fixes for Mac compilation from Gijs Vermeulen. 2021-01-24 21:49:17 -06:00
Alistair Leslie-Hughes
74534094a0 Added xactengine3_7-Notification patchset 2021-01-23 18:15:12 +11:00
Alistair Leslie-Hughes
1830eaa655 Updated msxml3-FreeThreadedXMLHTTP60 patchset
Moved coclass inside the library to ensure it's registered correctly.
2021-01-23 17:30:52 +11:00
Alistair Leslie-Hughes
f168899ce1 Rebase against 2d4dd4252b0cf6526b3cc8194cce642b16eb12f6. 2021-01-23 11:32:31 +11:00
Zebediah Figura
f8ce6cbb21 ntdll-NtAlertThreadByThreadId: Add explicit memory barriers.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50448
2021-01-21 23:32:19 -06:00
Zebediah Figura
64877514fb Rebase against 158a9e738421cd16f2e8296f11baa724c64c8ca7. 2021-01-21 17:44:50 -06:00
Alistair Leslie-Hughes
310072bb63 Updated mfplat-streaming-support patchset 2021-01-21 14:28:59 +11:00
Alistair Leslie-Hughes
2f619b2a53 Rebase against a952453888fb5df3c70edf357820bc924b4f3e7f. 2021-01-21 12:00:14 +11:00
Alistair Leslie-Hughes
76f8eb15f1 Added imm32-com-initialization patchset 2021-01-20 16:13:06 +11:00
Alistair Leslie-Hughes
6364ada0ad Rebase against 04a9c9eba77f56d61d615f1147590c67b466bdf8. 2021-01-20 10:56:34 +11:00
Alistair Leslie-Hughes
caa2471e20 Rebase against 88220e0ee41640940e7686fe0cab7f1e0bfb42f1. 2021-01-19 11:50:03 +11:00
Alistair Leslie-Hughes
2414b1da6a Release v6.0 2021-01-15 07:40:07 +11:00
Alistair Leslie-Hughes
7ab49f09a2 Release v6.0-rc6 2021-01-09 10:12:38 +11:00
Alistair Leslie-Hughes
a3d08de2b8 Rebase against 7d3186e029fb4cf417fab59483a37d8aece95b5d. 2021-01-09 09:59:05 +11:00
Alistair Leslie-Hughes
1c969cbbed Rebase against 9bc3a9f78bf5e6a09d4e9811f645def4a477f3d0. 2021-01-08 10:04:17 +11:00
Alistair Leslie-Hughes
0e7472e7a3 Added dsound-localder patchset 2021-01-07 13:22:54 +11:00
Alistair Leslie-Hughes
f3e785a3a8 Rebase against 4ac05afd39aff3030e3379ee06e32d6544ef5d62. 2021-01-07 13:15:41 +11:00
Zebediah Figura
dfddef9654 ntdll-NtAlertThreadByThreadId: Reset a thread's Win32 futex entry when waking it.
Avoid a race where two simultaneous calls to RtlWakeAddressSingle() wake the same address.
2021-01-05 19:53:40 -06:00
Alistair Leslie-Hughes
d87ec36ccf Rebase against 221fdb09b4c20da45e9834aa0cae27dcc75ea27b. 2021-01-05 09:57:51 +11:00
Alistair Leslie-Hughes
a3710ff21f Release v6.0-rc5 2021-01-03 10:25:03 +11:00
Alistair Leslie-Hughes
0e67af3d09 Updated dsound-EAX patchset
Enable this feature by default, to allow for more testing.
2021-01-01 13:48:55 +11:00
Zebediah Figura
8b1e0eec1d ntdll-NtAlertThreadByThreadId: Free the address wait entry on thread exit. 2020-12-28 12:36:15 -06:00
Zebediah Figura
b8ca0eae9f ntdll-NtAlertThreadByThreadId: Use a lock-free (list of) arrays to map thread IDs to addresses. 2020-12-28 12:22:10 -06:00
Alistair Leslie-Hughes
350eb136a5 Release v6.0-rc4 2020-12-27 10:59:24 +11:00
Alistair Leslie-Hughes
f40763d8a5 Updated dxdiag-new-dlls patchset 2020-12-27 10:03:16 +11:00
Alistair Leslie-Hughes
4462586c80 Updated mfplat-streaming-support patchset 2020-12-27 10:03:16 +11:00
Zebediah Figura
aae98229b0 libs-Unicode_Collation: Add another bug reference. 2020-12-25 14:02:42 -06:00
Zebediah Figura
7ad10427be server-File_Permissions: Clarify patch 0008 (DACL mapping) a bit.
This code should be effectively identical, but it makes the diff against
upstream a bit clearer.
2020-12-21 22:04:22 -06:00
Alistair Leslie-Hughes
9912133b6a Release v6.0-rc3 2020-12-19 14:48:29 +11:00
Alistair Leslie-Hughes
14450482bc Updated mfplat-streaming-support patchset 2020-12-19 13:09:14 +11:00
Alistair Leslie-Hughes
a8947d8016 Rebase against 0aa6f8e2ea1e3f2e852bef1a07d0d1f983870150. 2020-12-19 12:29:38 +11:00
Alistair Leslie-Hughes
a5a402a003 Added ntdll-RtlQueryProcessPlaceholderCompatibilityMode patchset 2020-12-18 09:44:36 +11:00
Alistair Leslie-Hughes
2505882bc6 Rebase against 0aa6f8e2ea1e3f2e852bef1a07d0d1f983870150. 2020-12-18 09:21:49 +11:00
Alistair Leslie-Hughes
760b2fbc35 Updated widl-winrt-support patchset 2020-12-18 08:06:29 +11:00
Zebediah Figura
909415c8d0 setupapi-DiskSpaceList: Add a bug reference. 2020-12-17 14:50:58 -06:00
Alistair Leslie-Hughes
5cd622f667 Added dxdiag-new-dlls patchset 2020-12-17 20:57:15 +11:00
Alistair Leslie-Hughes
4004f81390 Added odbccp32-SQLWriteDSNToIni patchset 2020-12-17 10:01:37 +11:00
Alistair Leslie-Hughes
28c6e62cb9 Added d3drm-IDirect3D3-support patchset 2020-12-17 09:46:35 +11:00
Alistair Leslie-Hughes
df37ef7599 Updated mfplat-streaming-support patchset
Restore file.
2020-12-17 09:37:21 +11:00
Alistair Leslie-Hughes
3b4ce945a6 Updated dxva2-Video_Decoder patchset 2020-12-17 08:14:07 +11:00
Alistair Leslie-Hughes
6d67766abd Updated mfplat-streaming-support patchset 2020-12-17 07:44:48 +11:00
Paul Gofman
143e59bfe2 Updated bcrypt-ECDHSecretAgreement patchset.
Also fix fallback function table and backend function resolution.
2020-12-16 16:23:54 +03:00
Paul Gofman
7dbce711de Updated ntdll-Syscall_Emulation patchset. 2020-12-16 12:08:17 +03:00
Paul Gofman
53bbade133 Updated bcrypt-ECDHSecretAgreement patchset.
Update key_funcs[] in gcrypt.c and thus fix the crash
on attempt to compute ECDH secret agreement.
2020-12-16 00:30:51 +03:00
Alistair Leslie-Hughes
fe5b02cbbc Rebase against 04ddabfdff644561adf0e36050db1bbc63cad83a. 2020-12-15 10:55:34 +11:00
Paul Gofman
abb7ae8b1c Updated and reenabled ntdll-NtQueryVirtualMemory patchset. 2020-12-15 00:53:49 +03:00
Alistair Leslie-Hughes
0fc2f15ac5 Updated Staging patchset
Restore file removed by mistake.
2020-12-14 15:33:15 +11:00
Alistair Leslie-Hughes
c646dc9283 Release v6.0-rc2 2020-12-13 14:02:53 +11:00
Alistair Leslie-Hughes
d0b0b5be24 Updated ntdll-Junction_Points patchset
Fixes: https://bugs.winehq.org/show_bug.cgi?id=50303
2020-12-13 13:18:23 +11:00
Alistair Leslie-Hughes
8cbc70df46 Disable ntdll-NtAlertThreadByThreadId patchset
This patchset is causing applications to freeze on startup (intermittently).

Disabled until the root cause can be fixed.
2020-12-13 09:08:36 +11:00
Alistair Leslie-Hughes
a8684593e2 Updated mfplat-streaming-support patchset 2020-12-13 08:44:17 +11:00
Alistair Leslie-Hughes
e015f0590c Updated mfplat-streaming-support patchset
Godfall intro movie playback - Still crashes though if you dont click to skip before it ends.
2020-12-10 17:15:10 +11:00
Alistair Leslie-Hughes
dea57ccd5f Revert "Updated mfplat-streaming-support patchset"
This update cause regressions with UE4 based games.

This reverts commit 3511fe03ee.
2020-12-10 17:15:10 +11:00
Zebediah Figura
fd8727a320 eventfd_synchronization: Try harder to make sure hunks are applied in the right place.
As of dc77e28 hunks were getting swapped when applied after ntdll-NtAlertThreadByThreadId. Spotted by Etienne Juvigny.
2020-12-09 23:38:36 -06:00
Zebediah Figura
dc77e28b0f ntdll-NtAlertThreadByThreadId: New patch set. 2020-12-08 20:56:56 -06:00
Zebediah Figura
213037cb33 libs-Unicode_Collation: Replace with new patches from Fabian Maurer. 2020-12-08 20:14:26 -06:00
Zebediah Figura
fce121fcd9 ntdll-Junction_Points: Do not use O_SYMLINK if it is not defined.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50255
2020-12-05 22:16:49 -06:00
Zebediah Figura
2dc013940d ntdll-DOS_Attributes: Restore a definition for FreeBSD. 2020-12-05 21:48:19 -06:00
Zebediah Figura
8229c98169 server-Stored_ACLs: Define xattr_valid_namespace() where it's first used. 2020-12-05 21:46:14 -06:00
Alistair Leslie-Hughes
d7b71f0bb4 Release v6.0rc1 2020-12-05 15:50:13 +11:00
Alistair Leslie-Hughes
3511fe03ee Updated mfplat-streaming-support patchset 2020-12-05 11:15:09 +11:00
Alistair Leslie-Hughes
7ffd7fc333 Removed libs-Debug_Channel patchset
This patch would have to completely rewriten and hasn't been used for quite sometime.
2020-12-05 10:31:59 +11:00
Alistair Leslie-Hughes
7be9c41c35 Rebase against 842b38e29166a429d59331be40761335807c85d2. 2020-12-05 10:25:39 +11:00
Alistair Leslie-Hughes
e002d94a8b Rebase against 727168a9e116a43f851df2673a9169ad280a9ec8.
Includes an updated mfplat patchset.
2020-12-04 11:22:01 +11:00
Alistair Leslie-Hughes
5eb920dd83 Rebase against e4fbae832c868e9fcf5a91c58255fe3f4ea1cb30. 2020-12-03 10:02:16 +11:00
Zebediah Figura
968e22f2ed server-unix_name: New patch set. 2020-12-02 10:35:06 -06:00
Zebediah Figura
f9e86098b3 ntdll-Junction_Points: Updates from Erich E. Hoover. 2020-12-02 10:34:50 -06:00
Alistair Leslie-Hughes
023588ac34 Rebase against 447924a6d68f7919bd451661314a52aa99cab709. 2020-12-02 09:52:16 +11:00
Alistair Leslie-Hughes
d3b70d6278 Rebase against 2ad09b01673381261815bfc804a2f69ce4d85f86. 2020-12-01 10:45:13 +11:00
Alistair Leslie-Hughes
47fea9ffa2 Updated mfplat-streaming-support patchset 2020-11-30 14:14:26 +11:00
Alistair Leslie-Hughes
2a073f334b Rebase against cbca9f847f60773b4e7e5408f6a079f4896c5c1e. 2020-11-28 15:07:12 +11:00
Alistair Leslie-Hughes
3b0de86bf9 Rebase against 9faa5eeddd24a057d9ff522259c9dbdc6203c098. 2020-11-27 11:25:44 +11:00
Alistair Leslie-Hughes
b9d3415f29 Rebase against 40d4fbe45997a1820296e7909ba2212518bcfacc. 2020-11-26 09:32:07 +11:00
Alistair Leslie-Hughes
84bb779a9b Added user32-message-order patchset 2020-11-26 08:22:51 +11:00
Alistair Leslie-Hughes
3553024da0 Updated widl-winrt-support patchset
Thanks Rémi Bernon.
2020-11-25 22:14:33 +11:00
Alistair Leslie-Hughes
991f2e8ebf Rebase against 4807a8f588c67e2296474399368a96c0046120fd. 2020-11-24 09:12:33 +11:00
Zebediah Figura
837404f454 crypt32-CRYPT_KEY_PROV_INFO: New patch set. 2020-11-22 21:03:03 -06:00
Zebediah Figura
18032936f1 ntdll-Junction_Points: Updates from Erich E. Hoover. 2020-11-22 20:16:54 -06:00
Alistair Leslie-Hughes
0ae7315541 Updated mfplat-streaming-support patchset
Already handled upstream.
2020-11-22 17:57:24 +11:00
Alistair Leslie-Hughes
f257f37b92 Updated msvcrt-Math_Precision patchset
Fixes: https://bugs.winehq.org/show_bug.cgi?id=50161
Fixes: https://bugs.winehq.org/show_bug.cgi?id=50162
2020-11-22 11:21:53 +11:00
Alistair Leslie-Hughes
371d6ff606 Release v5.22 2020-11-21 11:24:11 +11:00
Alistair Leslie-Hughes
88ffa8d374 Rebase against bedfb9cae224a369efa4588332a5518dbee57035. 2020-11-21 09:56:05 +11:00
Alistair Leslie-Hughes
7734f7a808 Rebase against 65d917402f43d6c061668cff811f5fd6729d5750. 2020-11-19 14:33:39 +11:00
Alistair Leslie-Hughes
0192a7b36c Rebase against 764a93f121c6b0f88c3444454ebb85eb7cb63295. 2020-11-18 09:40:10 +11:00
Alistair Leslie-Hughes
5566259fb5 Rebase against 86e6c0bc28177a3794950fe2a13b8208400b6194. 2020-11-17 10:18:40 +11:00
Alistair Leslie-Hughes
7bdc1d6bac Updated eventfd_synchronization patchset 2020-11-15 14:23:28 +11:00
Alistair Leslie-Hughes
852a7d9a7d Removed dwmapi-DwmGetTransportAttributes patchset
Only contains tests, and DwmGetTransportAttributes is upstream.
2020-11-15 09:47:44 +11:00
Alistair Leslie-Hughes
3b6b470bca Rebase against cf49617c1a378dd4a37ab7226187708c501b046f. 2020-11-14 21:51:08 +11:00
Alistair Leslie-Hughes
cd3ee9b25d Rebase against 1f15ddce9c7d0ee71521d7b98c698488b76d3f01. 2020-11-12 09:22:07 +11:00
Alistair Leslie-Hughes
c7ea1850c7 Rebase against b940c5e7c91bff963336dd7d2c4defc3a82c75a1. 2020-11-11 10:26:07 +11:00
Alistair Leslie-Hughes
41c7c741d7 Updated mfplat-streaming-support patchset 2020-11-10 16:42:53 +11:00
Alistair Leslie-Hughes
009f571ba1 Rebase against 572aa09de1b0e3ba0e8b19f48d5e96539625bb0a. 2020-11-10 14:02:03 +11:00
Alistair Leslie-Hughes
e2d9f97b61 Release v5.21 2020-11-07 16:30:34 +11:00
Alistair Leslie-Hughes
c32fb530b8 Rebase against 70d77a439ab58dcf56664d1545aa0c4cd3edb31e. 2020-11-07 11:30:52 +11:00
Alistair Leslie-Hughes
9d2a93164f Rebase against 4919b9b99fe20cfb8599b7b827811fdd7937ea9d. 2020-11-06 11:12:16 +11:00
Alistair Leslie-Hughes
4130b2a71c Rebase against b793799d3d5facb765d97041669da4bc159b860b. 2020-11-05 11:02:49 +11:00
Alistair Leslie-Hughes
786cac8be4 Rebase against 908c837b17ac1c285ef32e98f53df730c3770295. 2020-11-04 10:18:49 +11:00
Paul Gofman
6ad4bdecd2 Updated ntdll-Syscall_Emulation patchset. 2020-11-03 19:55:50 +03:00
Alistair Leslie-Hughes
950d7c6c43 Rebase against dfa4c07941322dbcad54507cd0acf271a6c719ab. 2020-11-03 20:45:48 +11:00
Zebediah Figura
66561ecf5d patchinstall.py: Remove the autogenerated patch list. 2020-11-01 15:25:10 -06:00
Alistair Leslie-Hughes
7925f8829e Fix rebase 2020-11-01 08:27:02 +11:00
Alistair Leslie-Hughes
f7739e7052 Rebase against 03eaa2cc93e5e2ea4c36495870c268797aea3ca8. 2020-10-31 19:32:08 +11:00
Alistair Leslie-Hughes
44f49e8001 Rebase against c9e2deac39924473ac538ee22a2a0c0dbe3bad85. 2020-10-30 14:28:10 +11:00
Zebediah Figura
c118dfd709 msxml3-FreeThreadedXMLHTTP60: Restore a mistakenly deleted hunk.
Spotted by Gijs Vermeulen.
2020-10-29 10:47:54 -05:00
Alistair Leslie-Hughes
c811f7aa7e Rebase against 03395fdf71b606b589b917eab5d4766842188b91. 2020-10-29 15:52:40 +11:00
Alistair Leslie-Hughes
495ae4e9af Updated mfplat-streaming-support patchset 2020-10-28 15:13:16 +11:00
Alistair Leslie-Hughes
819539b19f Updated dinput-remap-joystick patchset
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50066
2020-10-28 15:10:34 +11:00
Zebediah Figura
bd2086ff97 Rebase against 2148167f2557cc6c7d1e2f5ffef28bd936503a9a. 2020-10-27 17:40:08 -05:00
Zebediah Figura
db6b6282eb bcrypt-ECDHSecretAgreement: Also add a missing RESOLVE_FUNC for key_asymmetric_duplicate.
Spotted by Juuso Alasuutari <juuso.alasuutari@gmail.com>.
2020-10-27 10:43:26 -05:00
Erich E. Hoover
3dc5147b28 ntdll-Junction_Points: Updates from Erich E. Hoover. 2020-10-26 22:07:42 -05:00
Zebediah Figura
d1a75649b7 bcrypt-ECDHSecretAgreement: Add a missing function table entry. 2020-10-26 18:44:49 -05:00
Zebediah Figura
40dda2bf72 Rebase against 93107c08f5aa7f37ad7ece9cd7ca248dba3030ce. 2020-10-26 18:36:59 -05:00
Zebediah Figura
534f6ae34e ntdll-Fix_Aligment: Remove patch set.
This is fixed upstream, presumably by e3e477e6a14fbcb153258b47d1905915dc4c1f22.
2020-10-24 15:42:52 -05:00
Zebediah Figura
411aeb2398 server-Stored_ACLs: Restore some definitions for FreeBSD. 2020-10-24 10:28:29 -05:00
Zebediah Figura
7e7e0bbe3e ntdll-DOS_Attributes: Restore some definitions for FreeBSD. 2020-10-24 10:28:17 -05:00
Alistair Leslie-Hughes
bf69e4ee2b Release v5.20 2020-10-24 12:18:18 +11:00
Alistair Leslie-Hughes
8d04884c1f Updated winex11.drv-Query_server_position patchset
Reverted to the older patch to stop issues with windows
not being hidden correctly.
2020-10-22 12:40:44 +11:00
Alistair Leslie-Hughes
8d07859cb1 Rebase against f6a5a3d03c1eb914444af96352ca54eec79d7e2c. 2020-10-22 08:18:16 +11:00
Alistair Leslie-Hughes
05efccaeaf Fix rebase 2020-10-21 20:19:12 +11:00
Alistair Leslie-Hughes
8cacc0d955 Updated mfplat-streaming-support patchset 2020-10-21 17:52:40 +11:00
Alistair Leslie-Hughes
5b5a6de9b8 Rebase against 42bba70a024060fbd698aadec20fbb6f61ad9e16. 2020-10-21 16:32:58 +11:00
Zebediah Figura
be9c96813a eventfd_synchronization: Create esync file descriptors for console server objects. 2020-10-17 19:24:53 -05:00
Zebediah Figura
ed56966feb eventfd_synchronization: Rebase and reënable. 2020-10-17 16:57:58 -05:00
Alistair Leslie-Hughes
80498dd440 Rebase against de679af492ed93d70c99dff7f7cfc01cc8f25eb0. 2020-10-16 10:49:21 +11:00
Alistair Leslie-Hughes
601cfd7fdb Updated mfplat-streaming-support patchset 2020-10-15 16:57:57 +11:00
Alistair Leslie-Hughes
6d726da3ba Rebase against e909986e6ea5ecd49b2b847f321ad89b2ae4f6f1. 2020-10-15 09:36:18 +11:00
Alistair Leslie-Hughes
6a87f0a479 Updated windows.networking.connectivity.dll patchset 2020-10-14 18:26:41 +11:00
Alistair Leslie-Hughes
2d12fd01d7 Updated windows.globalization-dll patchset 2020-10-14 18:24:09 +11:00
Alistair Leslie-Hughes
fbf364bce9 Updated windows.gaming.input-dll patchset 2020-10-14 18:12:00 +11:00
Alistair Leslie-Hughes
23ca7fe894 Updated windows.media.speech.dll patchset 2020-10-14 18:00:35 +11:00
Alistair Leslie-Hughes
ae8bdc6121 Added widl-winrt-support patchset 2020-10-14 17:43:08 +11:00
Alistair Leslie-Hughes
3cea972271 Rebase against f4a66ad257df4605e73dfea792eec55a70a04e84. 2020-10-14 08:12:47 +11:00
Paul Gofman
b49e874386 Updated and reenabled ntdll-FLS_Callbacks patchset. 2020-10-10 15:23:36 +03:00
Alistair Leslie-Hughes
6ea9eb634f Release v5.19 2020-10-10 10:18:47 +11:00
Alistair Leslie-Hughes
24fa2aa786 Updated bcrypt-ECDHSecretAgreement patchset 2020-10-10 09:06:27 +11:00
Alistair Leslie-Hughes
8bef81b0a6 Updated color-sRGB-profile patchset 2020-10-10 08:58:41 +11:00
Paul Gofman
ab4391f61b Updated ntdll-ForceBottomUpAlloc patchset. 2020-10-09 13:12:52 +03:00
Alistair Leslie-Hughes
f6356a2c93 Rebase against 412db7789379549c4f821acb11c92f7aabab71c9. 2020-10-09 08:19:43 +11:00
Alistair Leslie-Hughes
8c5be4c9e7 Updated xactengine2-dll patchset 2020-10-07 10:42:36 +11:00
Alistair Leslie-Hughes
48fc6b0ba0 Updated xactengine-initial patchset 2020-10-07 10:34:59 +11:00
Alistair Leslie-Hughes
ee0185d9e2 Rebase against c29f9e6ee7656aa028bb1630284e7d4873bd5b0f. 2020-10-07 10:30:27 +11:00
Paul Gofman
df02967431 Updated server-Object_Types patchset.
Don't grab type object in get_object_type().
2020-10-06 23:37:25 +03:00
Alistair Leslie-Hughes
87a40ed683 Rebase against 568e3e8b697a960881c162671a33c28727921797. 2020-10-06 10:01:40 +11:00
Alistair Leslie-Hughes
194669052e Updated bcrypt-ECDHSecretAgreement patchset 2020-10-03 18:55:33 +10:00
Alistair Leslie-Hughes
aa7895faf6 Updated mfplat-streaming-support patchset 2020-10-03 18:10:26 +10:00
Alistair Leslie-Hughes
f82518af72 Rebase against cce4f36e214125173a8df84d27ba5b33df8d1434. 2020-10-03 15:35:36 +10:00
Alistair Leslie-Hughes
7145412e08 Rebase against fa9f4a20f5305b7cbcfe3a644d39d4b759f89203. 2020-10-02 08:48:09 +10:00
Alistair Leslie-Hughes
cd9f6dbd90 Updated xactengine-initial patchset
Use the Version 2 of the tests patch whcih moved them to xactengine.
Seperated out x3daudio1_7 library into it's own patch.
2020-10-01 19:14:39 +10:00
Alistair Leslie-Hughes
e634569429 Rebase against d45b3d4fdd7cbcfdba70c327ab90976a3b658da2. 2020-10-01 08:58:16 +10:00
Zebediah Figura
76a479203b Rebase against 23c6dd55b8c983ec88cada0a6d6c75ee9cd93976. 2020-09-29 15:52:53 -05:00
Alistair Leslie-Hughes
639755741e Rebase against 2ee75bf9ade3e90f10ffe4236c8c95d817402392. 2020-09-29 12:58:11 +10:00
Alistair Leslie-Hughes
9acfa3b899 Added windows.networking.connectivity.dll patchset 2020-09-28 15:32:22 +10:00
Alistair Leslie-Hughes
7b32c6a57f Updated mfplat-streaming-support patchset 2020-09-28 15:32:21 +10:00
Zebediah Figura
7bd8acb4ca ntdll-Junction_Points: Updates from Erich E. Hoover.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49790
2020-09-27 20:30:44 -05:00
Alistair Leslie-Hughes
0a299f39c8 Release v5.18 2020-09-28 10:00:50 +10:00
Zebediah Figura
f22ff249a9 Rebase against 9a6e5b23293fbad3bbdcd52007402a3b9a1cb99d. 2020-09-26 15:18:07 -05:00
Zebediah Figura
f90534f9da xactengine-initial: Rebase and re-enable. 2020-09-24 21:16:37 -05:00
Zebediah Figura
de03562a2d Rebase against 5f24f3012469f7056aa9b22765af1c0f11e1f6a2. 2020-09-24 20:34:42 -05:00
Zebediah Figura
831d2d8b52 Rebase against 0a49202109e29bd18daaf746cb9493e385511e13. 2020-09-23 18:52:01 -05:00
Zebediah Figura
5087d8a8d9 Rebase against 1a7b256f7c69c50c2a216317e03f9caeb268d0af. 2020-09-23 17:32:29 -05:00
Alistair Leslie-Hughes
22ed5ee061 Added xactengine2-dll 2020-09-19 18:08:41 +10:00
Alistair Leslie-Hughes
003d5833c2 Added windows.globalization-dll patchset 2020-09-18 11:11:59 +10:00
Alistair Leslie-Hughes
151728b04d Updated dbghelp-Debug_Symbols patchset 2020-09-16 15:13:10 +10:00
Alistair Leslie-Hughes
83c7e2a993 Updated color-sRGB-profile 2020-09-16 15:09:31 +10:00
Alistair Leslie-Hughes
91a9c0e3db Rebase against 666c5b6e20e3b9e1e34d10b88372406f494699f2. 2020-09-15 11:25:35 +10:00
Alistair Leslie-Hughes
c35a3386eb Release v5.17.2 2020-09-13 15:09:46 +10:00
Alistair Leslie-Hughes
2996658d6a Updated mfplat-streaming-support patchset 2020-09-13 14:08:47 +10:00
574 changed files with 25954 additions and 42746 deletions

128
.github/workflows/macOS.yml vendored Normal file
View File

@@ -0,0 +1,128 @@
name: MacOS
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
wine-staging:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
brew install --cask xquartz
brew install bison \
faudio \
gphoto2 \
gst-plugins-base \
little-cms2 \
mingw-w64 \
molten-vk \
mpg123
- name: Add bison & krb5 to $PATH
run: |
set -eu
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix krb5)/bin" >> $GITHUB_PATH
- name: Get upstream-commit
run: |
mkdir $GITHUB_WORKSPACE/wine
cd wine
git init
git fetch git://source.winehq.org/git/wine.git $($GITHUB_WORKSPACE/patches/patchinstall.sh --upstream-commit) --depth=1
git checkout $($GITHUB_WORKSPACE/patches/patchinstall.sh --upstream-commit)
- name: Run patchinstall.sh --all
run: |
$GITHUB_WORKSPACE/patches/patchinstall.sh DESTDIR=$GITHUB_WORKSPACE/wine --all
- name: Configure wine64
env:
LDFLAGS: "-Wl,-rpath,/opt/X11/lib"
# Avoid weird linker errors with Xcode 10 and later
MACOSX_DEPLOYMENT_TARGET: "10.14"
run: |
cd $GITHUB_WORKSPACE/wine
./configure --enable-win64 \
--without-alsa \
--without-capi \
--without-dbus \
--without-inotify \
--without-oss \
--without-pulse \
--without-udev \
--without-v4l2 \
--x-include=/opt/X11/include \
--x-lib=/opt/X11/lib
- name: Build wine64
run: |
cd $GITHUB_WORKSPACE/wine
make -j$(sysctl -n hw.ncpu 2>/dev/null)
wine-devel:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
brew install --cask xquartz
brew install bison \
faudio \
gphoto2 \
gst-plugins-base \
little-cms2 \
mingw-w64 \
molten-vk \
mpg123
- name: Add bison & krb5 to $PATH
run: |
set -eu
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix krb5)/bin" >> $GITHUB_PATH
- name: Get upstream-commit
run: |
mkdir $GITHUB_WORKSPACE/wine
cd wine
git init
git fetch git://source.winehq.org/git/wine.git $($GITHUB_WORKSPACE/patches/patchinstall.sh --upstream-commit) --depth=1
git checkout $($GITHUB_WORKSPACE/patches/patchinstall.sh --upstream-commit)
- name: Configure wine64
env:
LDFLAGS: "-Wl,-rpath,/opt/X11/lib"
# Avoid weird linker errors with Xcode 10 and later
MACOSX_DEPLOYMENT_TARGET: "10.14"
run: |
cd $GITHUB_WORKSPACE/wine
cd $GITHUB_WORKSPACE/wine
./configure --enable-win64 \
--without-alsa \
--without-capi \
--without-dbus \
--without-inotify \
--without-oss \
--without-pulse \
--without-udev \
--without-v4l2 \
--x-include=/opt/X11/include \
--x-lib=/opt/X11/lib
- name: Build wine64
run: |
cd $GITHUB_WORKSPACE/wine
make -j$(sysctl -n hw.ncpu 2>/dev/null)

View File

@@ -1,4 +1,4 @@
From 7529755fcc41fda650aac6b27f34438354435d34 Mon Sep 17 00:00:00 2001
From b51fdc7e211f676d169c937209bf689e57252c5d Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Tue, 22 Mar 2016 21:58:40 +0100
Subject: [PATCH] dwrite: Avoid implicit cast of interface pointer.
@@ -9,10 +9,10 @@ Subject: [PATCH] dwrite: Avoid implicit cast of interface pointer.
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 9280b5d32..2f0974a4c 100644
index aa51c744297..7cad015480f 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -1887,7 +1887,7 @@ static struct dwrite_font *unsafe_impl_from_IDWriteFont(IDWriteFont *iface)
@@ -2130,7 +2130,7 @@ static struct dwrite_font *unsafe_impl_from_IDWriteFont(IDWriteFont *iface)
if (!iface)
return NULL;
assert(iface->lpVtbl == (IDWriteFontVtbl*)&dwritefontvtbl);
@@ -21,7 +21,7 @@ index 9280b5d32..2f0974a4c 100644
}
struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
@@ -1895,7 +1895,7 @@ struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
@@ -2138,7 +2138,7 @@ struct dwrite_fontface *unsafe_impl_from_IDWriteFontFace(IDWriteFontFace *iface)
if (!iface)
return NULL;
assert(iface->lpVtbl == (IDWriteFontFaceVtbl*)&dwritefontfacevtbl);
@@ -31,10 +31,10 @@ index 9280b5d32..2f0974a4c 100644
static struct dwrite_fontfacereference *unsafe_impl_from_IDWriteFontFaceReference(IDWriteFontFaceReference *iface)
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
index b9321157a..76ea23ba6 100644
index 1f6201a6a93..35791d5c22e 100644
--- a/dlls/dwrite/layout.c
+++ b/dlls/dwrite/layout.c
@@ -5895,7 +5895,7 @@ static const IDWriteTextFormat3Vtbl dwritetextformatvtbl =
@@ -5886,7 +5886,7 @@ static const IDWriteTextFormat3Vtbl dwritetextformatvtbl =
static struct dwrite_textformat *unsafe_impl_from_IDWriteTextFormat(IDWriteTextFormat *iface)
{
return (iface->lpVtbl == (IDWriteTextFormatVtbl*)&dwritetextformatvtbl) ?
@@ -42,7 +42,7 @@ index b9321157a..76ea23ba6 100644
+ CONTAINING_RECORD((IDWriteTextFormat3 *)iface, struct dwrite_textformat, IDWriteTextFormat3_iface) : NULL;
}
HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight, DWRITE_FONT_STYLE style,
HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *collection, DWRITE_FONT_WEIGHT weight,
--
2.24.0
2.29.2

View File

@@ -1,4 +1,4 @@
From 700513f28e4844cbfc40b3ebf1b77cf121b71e71 Mon Sep 17 00:00:00 2001
From 0cf6433af95363c5fbba2af482b2ba50b863dfb7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 2 Oct 2014 19:44:31 +0200
Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
@@ -9,7 +9,7 @@ Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
1 file changed, 15 insertions(+)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 587c87bbfc0..05b40326d82 100644
index 20bc3f977d1..c2187a19397 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -44,6 +44,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
@@ -20,7 +20,7 @@ index 587c87bbfc0..05b40326d82 100644
#ifdef _WIN64
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
@@ -3487,6 +3488,7 @@ static void process_breakpoint(void)
@@ -3456,6 +3457,7 @@ static void process_breakpoint(void)
__ENDTRY
}
@@ -28,17 +28,17 @@ index 587c87bbfc0..05b40326d82 100644
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
@@ -3497,6 +3499,9 @@ static void process_breakpoint(void)
@@ -3465,6 +3467,9 @@ static void process_breakpoint(void)
*/
void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR unknown3, ULONG_PTR unknown4 )
{
static const unsigned int fls_slot_count = 8 * sizeof(NtCurrentTeb()->Peb->FlsBitmapBits);
+ OBJECT_ATTRIBUTES staging_event_attr;
+ UNICODE_STRING staging_event_string;
+ HANDLE staging_event;
static int attach_done;
int i;
NTSTATUS status;
@@ -3515,6 +3520,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
@@ -3483,6 +3488,16 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
entry = (void **)&context->u.s.X0;
#endif

View File

@@ -1,25 +1,25 @@
From b1bbc311c1e2dec72e04be9c668b6072d11b04fb Mon Sep 17 00:00:00 2001
From cfcc687562d4fa68b507cbf2c29722ef523d26aa Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 2 Oct 2014 19:53:46 +0200
Subject: [PATCH] winelib: Append '(Staging)' at the end of the version string.
---
dlls/ntdll/Makefile.in | 2 +-
Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
index a553536d4c7..71e3df13b66 100644
--- a/dlls/ntdll/Makefile.in
+++ b/dlls/ntdll/Makefile.in
@@ -81,7 +81,7 @@ unix_loader_EXTRADEFS = \
-DBIN_TO_DATADIR=\"`${MAKEDEP} -R ${bindir} ${datadir}/wine`\"
diff --git a/Makefile.in b/Makefile.in
index b52495f741f..d5a8cad20da 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -116,7 +116,7 @@ install-manpages:: manpages
# Rules for generated source files
unix/version.c: dummy
- version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || (rm -f $@ && exit 1)
+ version=`(GIT_DIR=$(top_srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1 (Staging)";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || (rm -f $@ && exit 1)
dlls/ntdll/unix/version.c: dummy
- @version=`(GIT_DIR=$(srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
+ @version=`(GIT_DIR=$(srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1 (Staging)";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || (rm -f $@ && exit 1)
dummy:
.PHONY: dummy
programs/winetest/build.rc: dummy
@build="STRINGTABLE { 1 \"`GIT_DIR=$(srcdir)/.git git rev-parse HEAD 2>/dev/null`\" }" && (echo $$build | cmp -s - $@) || echo $$build >$@ || (rm -f $@ && exit 1)
--
2.28.0
2.20.1

View File

@@ -1 +0,0 @@
Depends: ntdll-FLS_Callbacks

View File

@@ -1,334 +0,0 @@
From 1b222275e7faf71ae1e5c94e297004055ec6f82f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 4 Aug 2017 02:33:14 +0200
Subject: [PATCH] ntdll: Implement NtFilterToken.
---
dlls/ntdll/ntdll.spec | 2 +-
dlls/ntdll/unix/security.c | 64 +++++++++++++++++++++++++++++
include/winnt.h | 5 +++
include/winternl.h | 1 +
server/named_pipe.c | 2 +-
server/process.c | 2 +-
server/protocol.def | 10 +++++
server/security.h | 4 +-
server/token.c | 84 +++++++++++++++++++++++++++++++++++++-
9 files changed, 168 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index a3bc57716da..f604c8a3c35 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -208,7 +208,7 @@
# @ stub NtEnumerateSystemEnvironmentValuesEx
@ stdcall -syscall NtEnumerateValueKey(long long long ptr long ptr)
@ stub NtExtendSection
-# @ stub NtFilterToken
+@ stdcall -syscall NtFilterToken(long long ptr ptr ptr ptr)
@ stdcall -syscall NtFindAtom(ptr long ptr)
@ stdcall -syscall NtFlushBuffersFile(long ptr)
@ stdcall -syscall NtFlushInstructionCache(long ptr long)
diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c
index daecc5e0591..d063d43d6d4 100644
--- a/dlls/ntdll/unix/security.c
+++ b/dlls/ntdll/unix/security.c
@@ -604,6 +604,70 @@ NTSTATUS WINAPI NtAdjustPrivilegesToken( HANDLE token, BOOLEAN disable, TOKEN_PR
}
+/***********************************************************************
+ * NtFilterToken (NTDLL.@)
+ */
+NTSTATUS WINAPI NtFilterToken( HANDLE token, ULONG flags, TOKEN_GROUPS *disable_sids,
+ TOKEN_PRIVILEGES *privileges, TOKEN_GROUPS *restrict_sids,
+ HANDLE *new_token )
+{
+ data_size_t privileges_len = 0;
+ data_size_t sids_len = 0;
+ SID *sids = NULL;
+ NTSTATUS status;
+
+ TRACE( "(%p, 0x%08x, %p, %p, %p, %p)\n", token, flags, disable_sids, privileges,
+ restrict_sids, new_token );
+
+ if (flags)
+ FIXME( "flags %x unsupported\n", flags );
+
+ if (restrict_sids)
+ FIXME( "support for restricting sids not yet implemented\n" );
+
+ if (privileges)
+ privileges_len = privileges->PrivilegeCount * sizeof(LUID_AND_ATTRIBUTES);
+
+ if (disable_sids)
+ {
+ DWORD len, i;
+ BYTE *tmp;
+
+ for (i = 0; i < disable_sids->GroupCount; i++)
+ {
+ SID *sid = disable_sids->Groups[i].Sid;
+ sids_len += offsetof( SID, SubAuthority[sid->SubAuthorityCount] );
+ }
+
+ sids = malloc( sids_len );
+ if (!sids) return STATUS_NO_MEMORY;
+
+ for (i = 0, tmp = (BYTE *)sids; i < disable_sids->GroupCount; i++, tmp += len)
+ {
+ SID *sid = disable_sids->Groups[i].Sid;
+ len = offsetof( SID, SubAuthority[sid->SubAuthorityCount] );
+ memcpy( tmp, disable_sids->Groups[i].Sid, len );
+ }
+ }
+
+ SERVER_START_REQ( filter_token )
+ {
+ req->handle = wine_server_obj_handle( token );
+ req->flags = flags;
+ req->privileges_size = privileges_len;
+ wine_server_add_data( req, privileges->Privileges, privileges_len );
+ wine_server_add_data( req, sids, sids_len );
+ status = wine_server_call( req );
+ if (!status) *new_token = wine_server_ptr_handle( reply->new_handle );
+ }
+ SERVER_END_REQ;
+
+ free( sids );
+ return status;
+}
+
+
+
/***********************************************************************
* NtPrivilegeCheck (NTDLL.@)
*/
diff --git a/include/winnt.h b/include/winnt.h
index e1cf78420a6..da17fe3e330 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -4221,6 +4221,11 @@ typedef enum _TOKEN_INFORMATION_CLASS {
TOKEN_ADJUST_SESSIONID | \
TOKEN_ADJUST_DEFAULT )
+#define DISABLE_MAX_PRIVILEGE 0x1
+#define SANDBOX_INERT 0x2
+#define LUA_TOKEN 0x4
+#define WRITE_RESTRICTED 0x8
+
#ifndef _SECURITY_DEFINED
#define _SECURITY_DEFINED
diff --git a/include/winternl.h b/include/winternl.h
index b3fbb90feff..4687a410ca4 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -2749,6 +2749,7 @@ NTSYSAPI NTSTATUS WINAPI NtDuplicateToken(HANDLE,ACCESS_MASK,POBJECT_ATTRIBUTES
NTSYSAPI NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void *,DWORD,DWORD *);
NTSYSAPI NTSTATUS WINAPI NtEnumerateValueKey(HANDLE,ULONG,KEY_VALUE_INFORMATION_CLASS,PVOID,ULONG,PULONG);
NTSYSAPI NTSTATUS WINAPI NtExtendSection(HANDLE,PLARGE_INTEGER);
+NTSYSAPI NTSTATUS WINAPI NtFilterToken(HANDLE,ULONG,TOKEN_GROUPS*,TOKEN_PRIVILEGES*,TOKEN_GROUPS*,HANDLE*);
NTSYSAPI NTSTATUS WINAPI NtFindAtom(const WCHAR*,ULONG,RTL_ATOM*);
NTSYSAPI NTSTATUS WINAPI NtFlushBuffersFile(HANDLE,IO_STATUS_BLOCK*);
NTSYSAPI NTSTATUS WINAPI NtFlushInstructionCache(HANDLE,LPCVOID,SIZE_T);
diff --git a/server/named_pipe.c b/server/named_pipe.c
index b259abb8de4..4cd4d7dc4a8 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -1142,7 +1142,7 @@ static int pipe_server_ioctl( struct fd *fd, ioctl_code_t code, struct async *as
if (current->process->token) /* FIXME: use the client token */
{
struct token *token;
- if (!(token = token_duplicate( current->process->token, 0, SecurityImpersonation, NULL )))
+ if (!(token = token_duplicate( current->process->token, 0, SecurityImpersonation, NULL, NULL, 0, NULL, 0 )))
return 0;
if (current->token) release_object( current->token );
current->token = token;
diff --git a/server/process.c b/server/process.c
index 5e587b28cbe..406167e825b 100644
--- a/server/process.c
+++ b/server/process.c
@@ -577,7 +577,7 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
: alloc_handle_table( process, 0 );
/* Note: for security reasons, starting a new process does not attempt
* to use the current impersonation token for the new process */
- process->token = token_duplicate( parent->token, TRUE, 0, NULL );
+ process->token = token_duplicate( parent->token, TRUE, 0, NULL, NULL, 0, NULL, 0 );
process->affinity = parent->affinity;
}
if (!process->handles || !process->token) goto error;
diff --git a/server/protocol.def b/server/protocol.def
index a121c371c19..ee07b1eca14 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3263,6 +3263,16 @@ enum caret_state
obj_handle_t new_handle; /* duplicated handle */
@END
+@REQ(filter_token)
+ obj_handle_t handle; /* handle to the token to duplicate */
+ unsigned int flags; /* flags */
+ data_size_t privileges_size; /* size of privileges */
+ VARARG(privileges,LUID_AND_ATTRIBUTES,privileges_size); /* privileges to remove from new token */
+ VARARG(disable_sids,SID); /* array of groups to remove from new token */
+@REPLY
+ obj_handle_t new_handle; /* filtered handle */
+@END
+
@REQ(access_check)
obj_handle_t handle; /* handle to the token */
unsigned int desired_access; /* desired access to the object */
diff --git a/server/security.h b/server/security.h
index 606dbb2ab2c..6c337143c3d 100644
--- a/server/security.h
+++ b/server/security.h
@@ -56,7 +56,9 @@ extern const PSID security_high_label_sid;
extern struct token *token_create_admin(void);
extern int token_assign_label( struct token *token, PSID label );
extern struct token *token_duplicate( struct token *src_token, unsigned primary,
- int impersonation_level, const struct security_descriptor *sd );
+ int impersonation_level, const struct security_descriptor *sd,
+ const LUID_AND_ATTRIBUTES *filter_privileges, unsigned int priv_count,
+ const SID *filter_groups, unsigned int group_count );
extern int token_check_privileges( struct token *token, int all_required,
const LUID_AND_ATTRIBUTES *reqprivs,
unsigned int count, LUID_AND_ATTRIBUTES *usedprivs);
diff --git a/server/token.c b/server/token.c
index 2fa95e17aaf..38a4c203d54 100644
--- a/server/token.c
+++ b/server/token.c
@@ -285,6 +285,19 @@ static int acl_is_valid( const ACL *acl, data_size_t size )
return TRUE;
}
+static unsigned int get_sid_count( const SID *sid, data_size_t size )
+{
+ unsigned int count;
+
+ for (count = 0; size >= sizeof(SID) && security_sid_len( sid ) <= size; count++)
+ {
+ size -= security_sid_len( sid );
+ sid = (const SID *)((char *)sid + security_sid_len( sid ));
+ }
+
+ return count;
+}
+
/* checks whether all members of a security descriptor fit inside the size
* of memory specified */
int sd_is_valid( const struct security_descriptor *sd, data_size_t size )
@@ -626,8 +639,36 @@ static struct token *create_token( unsigned primary, const SID *user,
return token;
}
+static int filter_group( struct group *group, const SID *filter, unsigned int count )
+{
+ unsigned int i;
+
+ for (i = 0; i < count; i++)
+ {
+ if (security_equal_sid( &group->sid, filter )) return 1;
+ filter = (const SID *)((char *)filter + security_sid_len( filter ));
+ }
+
+ return 0;
+}
+
+static int filter_privilege( struct privilege *privilege, const LUID_AND_ATTRIBUTES *filter, unsigned int count )
+{
+ unsigned int i;
+
+ for (i = 0; i < count; i++)
+ {
+ if (!memcmp( &privilege->luid, &filter[i].Luid, sizeof(LUID) ))
+ return 1;
+ }
+
+ return 0;
+}
+
struct token *token_duplicate( struct token *src_token, unsigned primary,
- int impersonation_level, const struct security_descriptor *sd )
+ int impersonation_level, const struct security_descriptor *sd,
+ const LUID_AND_ATTRIBUTES *filter_privileges, unsigned int priv_count,
+ const SID *filter_groups, unsigned int group_count)
{
const luid_t *modified_id =
primary || (impersonation_level == src_token->impersonation_level) ?
@@ -663,6 +704,12 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
return NULL;
}
memcpy( newgroup, group, size );
+ if (filter_group( group, filter_groups, group_count ))
+ {
+ newgroup->enabled = 0;
+ newgroup->def = 0;
+ newgroup->deny_only = 1;
+ }
list_add_tail( &token->groups, &newgroup->entry );
if (src_token->primary_group == &group->sid)
{
@@ -674,11 +721,14 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
/* copy privileges */
LIST_FOR_EACH_ENTRY( privilege, &src_token->privileges, struct privilege, entry )
+ {
+ if (filter_privilege( privilege, filter_privileges, priv_count )) continue;
if (!privilege_add( token, &privilege->luid, privilege->enabled ))
{
release_object( token );
return NULL;
}
+ }
if (sd) default_set_sd( &token->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION );
@@ -1311,7 +1361,7 @@ DECL_HANDLER(duplicate_token)
TOKEN_DUPLICATE,
&token_ops )))
{
- struct token *token = token_duplicate( src_token, req->primary, req->impersonation_level, sd );
+ struct token *token = token_duplicate( src_token, req->primary, req->impersonation_level, sd, NULL, 0, NULL, 0 );
if (token)
{
reply->new_handle = alloc_handle_no_access_check( current->process, token, req->access, objattr->attributes );
@@ -1321,6 +1371,36 @@ DECL_HANDLER(duplicate_token)
}
}
+/* creates a restricted version of a token */
+DECL_HANDLER(filter_token)
+{
+ struct token *src_token;
+
+ if ((src_token = (struct token *)get_handle_obj( current->process, req->handle,
+ TOKEN_DUPLICATE,
+ &token_ops )))
+ {
+ const LUID_AND_ATTRIBUTES *filter_privileges = get_req_data();
+ unsigned int priv_count, group_count;
+ const SID *filter_groups;
+ struct token *token;
+
+ priv_count = min( req->privileges_size, get_req_data_size() ) / sizeof(LUID_AND_ATTRIBUTES);
+ filter_groups = (const SID *)((char *)filter_privileges + priv_count * sizeof(LUID_AND_ATTRIBUTES));
+ group_count = get_sid_count( filter_groups, get_req_data_size() - priv_count * sizeof(LUID_AND_ATTRIBUTES) );
+
+ token = token_duplicate( src_token, src_token->primary, src_token->impersonation_level, NULL,
+ filter_privileges, priv_count, filter_groups, group_count );
+ if (token)
+ {
+ unsigned int access = get_handle_access( current->process, req->handle );
+ reply->new_handle = alloc_handle_no_access_check( current->process, token, access, 0 );
+ release_object( token );
+ }
+ release_object( src_token );
+ }
+}
+
/* checks the specified privileges are held by the token */
DECL_HANDLER(check_token_privileges)
{
--
2.27.0

View File

@@ -1,132 +0,0 @@
From 3c1f5962482e7acf531f57f49d923d9c4e5278b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Fri, 4 Aug 2017 02:51:57 +0200
Subject: [PATCH] advapi32: Implement CreateRestrictedToken.
---
dlls/kernelbase/security.c | 103 ++++++++++++++++++++++++++++++-------
1 file changed, 84 insertions(+), 19 deletions(-)
diff --git a/dlls/kernelbase/security.c b/dlls/kernelbase/security.c
index 2e75e81ed77..97f6ee6a2fd 100644
--- a/dlls/kernelbase/security.c
+++ b/dlls/kernelbase/security.c
@@ -592,31 +592,96 @@ exit:
return ret;
}
+static BOOL allocate_groups(TOKEN_GROUPS **groups_ret, SID_AND_ATTRIBUTES *sids, DWORD count)
+{
+ TOKEN_GROUPS *groups;
+ DWORD i;
+
+ if (!count)
+ {
+ *groups_ret = NULL;
+ return TRUE;
+ }
+
+ groups = (TOKEN_GROUPS *)heap_alloc(FIELD_OFFSET(TOKEN_GROUPS, Groups) +
+ count * sizeof(SID_AND_ATTRIBUTES));
+ if (!groups)
+ {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
+
+ groups->GroupCount = count;
+ for (i = 0; i < count; i++)
+ groups->Groups[i] = sids[i];
+
+ *groups_ret = groups;
+ return TRUE;
+}
+
+static BOOL allocate_privileges(TOKEN_PRIVILEGES **privileges_ret, LUID_AND_ATTRIBUTES *privs, DWORD count)
+{
+ TOKEN_PRIVILEGES *privileges;
+ DWORD i;
+
+ if (!count)
+ {
+ *privileges_ret = NULL;
+ return TRUE;
+ }
+
+ privileges = (TOKEN_PRIVILEGES *)heap_alloc(FIELD_OFFSET(TOKEN_PRIVILEGES, Privileges) +
+ count * sizeof(LUID_AND_ATTRIBUTES));
+ if (!privileges)
+ {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
+
+ privileges->PrivilegeCount = count;
+ for (i = 0; i < count; i++)
+ privileges->Privileges[i] = privs[i];
+
+ *privileges_ret = privileges;
+ return TRUE;
+}
+
/*************************************************************************
* CreateRestrictedToken (kernelbase.@)
*/
-BOOL WINAPI CreateRestrictedToken( HANDLE token, DWORD flags,
- DWORD disable_count, PSID_AND_ATTRIBUTES disable_sids,
- DWORD delete_count, PLUID_AND_ATTRIBUTES delete_privs,
- DWORD restrict_count, PSID_AND_ATTRIBUTES restrict_sids, PHANDLE ret )
+BOOL WINAPI CreateRestrictedToken( HANDLE baseToken, DWORD flags,
+ DWORD nDisableSids, PSID_AND_ATTRIBUTES disableSids,
+ DWORD nDeletePrivs, PLUID_AND_ATTRIBUTES deletePrivs,
+ DWORD nRestrictSids, PSID_AND_ATTRIBUTES restrictSids, PHANDLE newToken )
{
- TOKEN_TYPE type;
- SECURITY_IMPERSONATION_LEVEL level = SecurityAnonymous;
- DWORD size;
+ TOKEN_PRIVILEGES *delete_privs = NULL;
+ TOKEN_GROUPS *disable_groups = NULL;
+ TOKEN_GROUPS *restrict_sids = NULL;
+ BOOL ret = FALSE;
- FIXME("(%p, 0x%x, %u, %p, %u, %p, %u, %p, %p): stub\n",
- token, flags, disable_count, disable_sids, delete_count, delete_privs,
- restrict_count, restrict_sids, ret );
+ TRACE("(%p, 0x%x, %u, %p, %u, %p, %u, %p, %p)\n",
+ baseToken, flags, nDisableSids, disableSids,
+ nDeletePrivs, deletePrivs,
+ nRestrictSids, restrictSids,
+ newToken);
+
+ if (!allocate_groups(&disable_groups, disableSids, nDisableSids))
+ goto done;
+
+ if (!allocate_privileges(&delete_privs, deletePrivs, nDeletePrivs))
+ goto done;
+
+ if (!allocate_groups(&restrict_sids, restrictSids, nRestrictSids))
+ goto done;
+
+ ret = set_ntstatus(NtFilterToken(baseToken, flags, disable_groups, delete_privs, restrict_sids, newToken));
+
+done:
+ heap_free(disable_groups);
+ heap_free(delete_privs);
+ heap_free(restrict_sids);
+ return ret;
- size = sizeof(type);
- if (!GetTokenInformation( token, TokenType, &type, size, &size )) return FALSE;
- if (type == TokenImpersonation)
- {
- size = sizeof(level);
- if (!GetTokenInformation( token, TokenImpersonationLevel, &level, size, &size ))
- return FALSE;
- }
- return DuplicateTokenEx( token, MAXIMUM_ALLOWED, NULL, level, type, ret );
}
/******************************************************************************
--
2.20.1

View File

@@ -1 +0,0 @@
Fixes: [25834] Implement advapi32.CreateRestrictedToken

View File

@@ -1,137 +0,0 @@
From d2e98b2054a5af671fd81ded32f2cf60a062312c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 5 Aug 2017 00:26:03 +0200
Subject: [PATCH] server: Implement token elevation information.
---
dlls/ntdll/unix/security.c | 16 ++++++++++++----
server/protocol.def | 8 ++++++++
server/token.c | 22 +++++++++++++++++++---
3 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c
index d063d43d6d4..03a81afa46e 100644
--- a/dlls/ntdll/unix/security.c
+++ b/dlls/ntdll/unix/security.c
@@ -390,19 +390,27 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c
break;
case TokenElevationType:
+ SERVER_START_REQ( get_token_elevation_type )
{
TOKEN_ELEVATION_TYPE *type = info;
- FIXME("QueryInformationToken( ..., TokenElevationType, ...) semi-stub\n");
- *type = TokenElevationTypeFull;
+ req->handle = wine_server_obj_handle( token );
+ status = wine_server_call( req );
+ if (status == STATUS_SUCCESS)
+ *type = reply->elevation;
}
+ SERVER_END_REQ;
break;
case TokenElevation:
+ SERVER_START_REQ( get_token_elevation_type )
{
TOKEN_ELEVATION *elevation = info;
- FIXME("QueryInformationToken( ..., TokenElevation, ...) semi-stub\n");
- elevation->TokenIsElevated = TRUE;
+ req->handle = wine_server_obj_handle( token );
+ status = wine_server_call( req );
+ if (status == STATUS_SUCCESS)
+ elevation->TokenIsElevated = (reply->elevation == TokenElevationTypeFull);
}
+ SERVER_END_REQ;
break;
case TokenSessionId:
diff --git a/server/protocol.def b/server/protocol.def
index ee07b1eca14..84f0b577d72 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3566,6 +3566,14 @@ struct handle_info
@END
+/* Get elevation level of token */
+@REQ(get_token_elevation_type)
+ obj_handle_t handle; /* handle to the object */
+@REPLY
+ unsigned int elevation; /* elevation level */
+@END
+
+
/* Create I/O completion port */
@REQ(create_completion)
unsigned int access; /* desired access to a port */
diff --git a/server/token.c b/server/token.c
index 38a4c203d54..14343637af5 100644
--- a/server/token.c
+++ b/server/token.c
@@ -110,6 +110,7 @@ struct token
ACL *default_dacl; /* the default DACL to assign to objects created by this user */
TOKEN_SOURCE source; /* source of the token */
int impersonation_level; /* impersonation level this token is capable of if non-primary token */
+ TOKEN_ELEVATION_TYPE elevation; /* elevation level */
};
struct privilege
@@ -552,7 +553,7 @@ static struct token *create_token( unsigned primary, const SID *user,
const LUID_AND_ATTRIBUTES *privs, unsigned int priv_count,
const ACL *default_dacl, TOKEN_SOURCE source,
const luid_t *modified_id,
- int impersonation_level )
+ int impersonation_level, TOKEN_ELEVATION_TYPE elevation )
{
struct token *token = alloc_object( &token_ops );
if (token)
@@ -574,6 +575,7 @@ static struct token *create_token( unsigned primary, const SID *user,
token->impersonation_level = impersonation_level;
token->default_dacl = NULL;
token->primary_group = NULL;
+ token->elevation = elevation;
/* copy user */
token->user = memdup( user, security_sid_len( user ));
@@ -689,7 +691,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
token = create_token( primary, src_token->user, NULL, 0,
NULL, 0, src_token->default_dacl,
src_token->source, modified_id,
- impersonation_level );
+ impersonation_level,
+ src_token->elevation );
if (!token) return token;
/* copy groups */
@@ -895,7 +898,7 @@ struct token *token_create_admin( void )
static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}};
token = create_token( TRUE, user_sid, admin_groups, ARRAY_SIZE( admin_groups ),
admin_privs, ARRAY_SIZE( admin_privs ), default_dacl,
- admin_source, NULL, -1 );
+ admin_source, NULL, -1, TokenElevationTypeFull );
/* we really need a primary group */
assert( token->primary_group );
}
@@ -1634,6 +1637,19 @@ DECL_HANDLER(get_token_statistics)
}
}
+DECL_HANDLER(get_token_elevation_type)
+{
+ struct token *token;
+
+ if ((token = (struct token *)get_handle_obj( current->process, req->handle,
+ TOKEN_QUERY,
+ &token_ops )))
+ {
+ reply->elevation = token->elevation;
+ release_object( token );
+ }
+}
+
DECL_HANDLER(get_token_default_dacl)
{
struct token *token;
--
2.27.0

View File

@@ -1,81 +0,0 @@
From 7e73f449d158f0d6a6b6b421d073dbaf1741e1c7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 7 Aug 2017 02:22:11 +0200
Subject: server: Correctly treat zero access mask in duplicate_token
wineserver call.
---
dlls/advapi32/tests/security.c | 14 +++++++-------
server/token.c | 3 ++-
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 4a03db27e69..f1a64e29dea 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -7438,7 +7438,7 @@ static void test_token_security_descriptor(void)
ret = DuplicateTokenEx(token4, 0, NULL, SecurityImpersonation, TokenImpersonation, &token5);
ok(ret, "DuplicateTokenEx failed with error %u\n", GetLastError());
ret = SetThreadToken(NULL, token5);
- todo_wine ok(ret, "SetThreadToken failed with error %u\n", GetLastError());
+ ok(ret, "SetThreadToken failed with error %u\n", GetLastError());
CloseHandle(token4);
/* Restrict current process token while impersonating a medium integrity token */
@@ -7503,16 +7503,16 @@ static void test_token_security_descriptor(void)
size = 0;
ret = GetKernelObjectSecurity(token6, LABEL_SECURITY_INFORMATION, NULL, 0, &size);
- todo_wine ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
+ ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Unexpected GetKernelObjectSecurity return value %u, error %u\n", ret, GetLastError());
sd3 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
ret = GetKernelObjectSecurity(token6, LABEL_SECURITY_INFORMATION, sd3, size, &size);
- todo_wine ok(ret, "GetKernelObjectSecurity failed with error %u\n", GetLastError());
+ ok(ret, "GetKernelObjectSecurity failed with error %u\n", GetLastError());
sacl = NULL;
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
- todo_wine ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
+ ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
todo_wine ok(present, "No SACL in the security descriptor\n");
todo_wine ok(sacl != NULL, "NULL SACL in the security descriptor\n");
@@ -7606,16 +7606,16 @@ static void test_token_security_descriptor(void)
size = 0;
ret = GetKernelObjectSecurity(token4, LABEL_SECURITY_INFORMATION, NULL, 0, &size);
- todo_wine ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
+ ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Unexpected GetKernelObjectSecurity return value %u, error %u\n", ret, GetLastError());
sd3 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
ret = GetKernelObjectSecurity(token4, LABEL_SECURITY_INFORMATION, sd3, size, &size);
- todo_wine ok(ret, "GetKernelObjectSecurity failed with error %u\n", GetLastError());
+ ok(ret, "GetKernelObjectSecurity failed with error %u\n", GetLastError());
sacl = NULL;
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
- todo_wine ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
+ ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
todo_wine ok(present, "No SACL in the security descriptor\n");
todo_wine ok(sacl != NULL, "NULL SACL in the security descriptor\n");
diff --git a/server/token.c b/server/token.c
index 6a1085bae12..292e1df80fd 100644
--- a/server/token.c
+++ b/server/token.c
@@ -1376,7 +1376,8 @@ DECL_HANDLER(duplicate_token)
struct token *token = token_duplicate( src_token, req->primary, req->impersonation_level, sd, NULL, 0, NULL, 0 );
if (token)
{
- reply->new_handle = alloc_handle_no_access_check( current->process, token, req->access, objattr->attributes );
+ unsigned int access = req->access ? req->access : get_handle_access( current->process, req->handle );
+ reply->new_handle = alloc_handle_no_access_check( current->process, token, access, objattr->attributes );
release_object( token );
}
release_object( src_token );
--
2.13.1

View File

@@ -1,46 +0,0 @@
From 48f4c131f9e8ffc091dde12437ad0772ed1c5ca6 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sun, 6 Aug 2017 15:16:33 +0200
Subject: server: Use all group attributes in create_token.
---
server/token.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/server/token.c b/server/token.c
index 0019b3a..2a56664 100644
--- a/server/token.c
+++ b/server/token.c
@@ -592,13 +592,13 @@ static struct token *create_token( unsigned primary, const SID *user,
return NULL;
}
memcpy( &group->sid, groups[i].Sid, security_sid_len( groups[i].Sid ));
- group->enabled = TRUE;
- group->def = TRUE;
- group->logon = (groups[i].Attributes & SE_GROUP_LOGON_ID) != 0;
group->mandatory = (groups[i].Attributes & SE_GROUP_MANDATORY) != 0;
- group->owner = (groups[i].Attributes & SE_GROUP_OWNER) != 0;
- group->resource = FALSE;
- group->deny_only = FALSE;
+ group->def = (groups[i].Attributes & SE_GROUP_ENABLED_BY_DEFAULT) != 0;
+ group->enabled = (groups[i].Attributes & SE_GROUP_ENABLED) != 0;
+ group->owner = (groups[i].Attributes & SE_GROUP_OWNER) != 0;
+ group->deny_only = (groups[i].Attributes & SE_GROUP_USE_FOR_DENY_ONLY) != 0;
+ group->logon = (groups[i].Attributes & SE_GROUP_LOGON_ID) != 0;
+ group->resource = (groups[i].Attributes & SE_GROUP_RESOURCE) != 0;
list_add_tail( &token->groups, &group->entry );
/* Use first owner capable group as owner and primary group */
if (!token->primary_group && group->owner)
@@ -1603,8 +1603,8 @@ DECL_HANDLER(get_token_groups)
if (group->enabled) *attr_ptr |= SE_GROUP_ENABLED;
if (group->owner) *attr_ptr |= SE_GROUP_OWNER;
if (group->deny_only) *attr_ptr |= SE_GROUP_USE_FOR_DENY_ONLY;
- if (group->resource) *attr_ptr |= SE_GROUP_RESOURCE;
if (group->logon) *attr_ptr |= SE_GROUP_LOGON_ID;
+ if (group->resource) *attr_ptr |= SE_GROUP_RESOURCE;
memcpy(sid_ptr, &group->sid, security_sid_len( &group->sid ));
--
2.7.4

View File

@@ -1,219 +0,0 @@
From c47977a8bbd739483589d1f01cfece435be1c100 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 5 Aug 2017 01:45:29 +0200
Subject: [PATCH] ntdll: Add function to create new tokens for elevation
purposes.
---
dlls/ntdll/ntdll.spec | 3 ++
dlls/ntdll/ntdll_misc.h | 3 ++
dlls/ntdll/process.c | 18 +++++++++
server/protocol.def | 8 ++++
server/security.h | 1 +
server/token.c | 84 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 117 insertions(+)
diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec
index 0997c310110..8e3786e1972 100644
--- a/dlls/ntdll/ntdll.spec
+++ b/dlls/ntdll/ntdll.spec
@@ -1600,6 +1600,9 @@
# Virtual memory
@ cdecl __wine_locked_recvmsg(long ptr long)
+# Token
+@ cdecl __wine_create_default_token(long)
+
# Version
@ cdecl wine_get_version()
@ cdecl wine_get_build_id()
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
index 63ceac42e94..5a98501381b 100644
--- a/dlls/ntdll/ntdll_misc.h
+++ b/dlls/ntdll/ntdll_misc.h
@@ -67,6 +67,9 @@ extern void init_user_process_params(void) DECLSPEC_HIDDEN;
extern NTSTATUS restart_process( RTL_USER_PROCESS_PARAMETERS *params, NTSTATUS status ) DECLSPEC_HIDDEN;
extern void CDECL DECLSPEC_NORETURN signal_start_thread( CONTEXT *ctx ) DECLSPEC_HIDDEN;
+/* token */
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
+
/* server support */
extern BOOL is_wow64 DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index 77ba5b371e2..3e91a1fa9c4 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -72,6 +72,24 @@ HANDLE CDECL __wine_make_process_system(void)
return ret;
}
+/***********************************************************************
+ * __wine_create_default_token (NTDLL.@)
+ *
+ * Creates a default limited or admin token.
+ */
+HANDLE CDECL __wine_create_default_token( BOOL admin )
+{
+ HANDLE ret = NULL;
+ SERVER_START_REQ( create_token )
+ {
+ req->admin = admin;
+ if (!wine_server_call( req ))
+ ret = wine_server_ptr_handle( reply->token );
+ }
+ SERVER_END_REQ;
+ return ret;
+}
+
/***********************************************************************
* restart_process
*/
diff --git a/server/protocol.def b/server/protocol.def
index 30a102d7b82..a9308904afc 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -3481,6 +3481,14 @@ struct handle_info
@END
+/* Create a new token */
+@REQ(create_token)
+ unsigned int admin; /* admin or limited token */
+@REPLY
+ obj_handle_t token; /* handle for new token */
+@END
+
+
/* Create I/O completion port */
@REQ(create_completion)
unsigned int access; /* desired access to a port */
diff --git a/server/security.h b/server/security.h
index 6c337143c3d..21e90ccf23f 100644
--- a/server/security.h
+++ b/server/security.h
@@ -49,6 +49,7 @@ extern const PSID security_builtin_users_sid;
extern const PSID security_builtin_admins_sid;
extern const PSID security_domain_users_sid;
extern const PSID security_high_label_sid;
+extern const PSID security_medium_label_sid;
/* token functions */
diff --git a/server/token.c b/server/token.c
index c4f1cd943c2..970ed1838da 100644
--- a/server/token.c
+++ b/server/token.c
@@ -77,6 +77,7 @@ static const SID anonymous_logon_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORIT
static const SID authenticated_user_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_AUTHENTICATED_USER_RID } };
static const SID local_system_sid = { SID_REVISION, 1, { SECURITY_NT_AUTHORITY }, { SECURITY_LOCAL_SYSTEM_RID } };
static const SID high_label_sid = { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY }, { SECURITY_MANDATORY_HIGH_RID } };
+static const SID medium_label_sid = { SID_REVISION, 1, { SECURITY_MANDATORY_LABEL_AUTHORITY }, { SECURITY_MANDATORY_MEDIUM_RID } };
static const SID_N(5) local_user_sid = { SID_REVISION, 5, { SECURITY_NT_AUTHORITY }, { SECURITY_NT_NON_UNIQUE, 0, 0, 0, 1000 } };
static const SID_N(2) builtin_admins_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS } };
static const SID_N(2) builtin_users_sid = { SID_REVISION, 2, { SECURITY_NT_AUTHORITY }, { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS } };
@@ -93,6 +94,7 @@ const PSID security_builtin_admins_sid = (PSID)&builtin_admins_sid;
const PSID security_builtin_users_sid = (PSID)&builtin_users_sid;
const PSID security_domain_users_sid = (PSID)&domain_users_sid;
const PSID security_high_label_sid = (PSID)&high_label_sid;
+const PSID security_medium_label_sid = (PSID)&medium_label_sid;
static luid_t prev_luid_value = { 1000, 0 };
@@ -915,6 +917,64 @@ struct token *token_create_admin( void )
return token;
}
+static struct token *token_create_limited( void )
+{
+ struct token *token = NULL;
+ static const SID_IDENTIFIER_AUTHORITY nt_authority = { SECURITY_NT_AUTHORITY };
+ static const unsigned int alias_admins_subauth[] = { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS };
+ static const unsigned int alias_users_subauth[] = { SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_USERS };
+ /* on Windows, this value changes every time the user logs on */
+ static const unsigned int logon_subauth[] = { SECURITY_LOGON_IDS_RID, 0, 1 /* FIXME: should be randomly generated when tokens are inherited by new processes */ };
+ PSID alias_admins_sid;
+ PSID alias_users_sid;
+ PSID logon_sid;
+ const SID *user_sid = security_unix_uid_to_sid( getuid() );
+ ACL *default_dacl = create_default_dacl( user_sid );
+
+ alias_admins_sid = security_sid_alloc( &nt_authority, sizeof(alias_admins_subauth)/sizeof(alias_admins_subauth[0]),
+ alias_admins_subauth );
+ alias_users_sid = security_sid_alloc( &nt_authority, sizeof(alias_users_subauth)/sizeof(alias_users_subauth[0]),
+ alias_users_subauth );
+ logon_sid = security_sid_alloc( &nt_authority, sizeof(logon_subauth)/sizeof(logon_subauth[0]),
+ logon_subauth );
+
+ if (alias_admins_sid && alias_users_sid && logon_sid && default_dacl)
+ {
+ const LUID_AND_ATTRIBUTES user_privs[] =
+ {
+ { SeChangeNotifyPrivilege , SE_PRIVILEGE_ENABLED },
+ { SeShutdownPrivilege , 0 },
+ { SeUndockPrivilege , 0 },
+ };
+ /* note: we don't include non-builtin groups here for the user -
+ * telling us these is the job of a client-side program */
+ const SID_AND_ATTRIBUTES user_groups[] =
+ {
+ { security_world_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
+ { security_local_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
+ { security_interactive_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
+ { security_authenticated_user_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
+ { security_domain_users_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY|SE_GROUP_OWNER },
+ { alias_admins_sid, SE_GROUP_USE_FOR_DENY_ONLY },
+ { alias_users_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY },
+ { logon_sid, SE_GROUP_ENABLED|SE_GROUP_ENABLED_BY_DEFAULT|SE_GROUP_MANDATORY|SE_GROUP_LOGON_ID },
+ };
+ static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}};
+ token = create_token( TRUE, user_sid, user_groups, sizeof(user_groups)/sizeof(user_groups[0]),
+ user_privs, sizeof(user_privs)/sizeof(user_privs[0]), default_dacl,
+ admin_source, NULL, -1, TokenElevationTypeLimited, &medium_label_sid );
+ /* we really need a primary group */
+ assert( token->primary_group );
+ }
+
+ free( logon_sid );
+ free( alias_admins_sid );
+ free( alias_users_sid );
+ free( default_dacl );
+
+ return token;
+}
+
static struct privilege *token_find_privilege( struct token *token, const LUID *luid, int enabled_only )
{
struct privilege *privilege;
@@ -1720,3 +1780,27 @@ DECL_HANDLER(set_token_default_dacl)
release_object( token );
}
}
+
+DECL_HANDLER(create_token)
+{
+ struct token *token;
+ PSID label;
+
+ if (req->admin)
+ {
+ token = token_create_admin();
+ label = security_high_label_sid;
+ }
+ else
+ {
+ token = token_create_limited();
+ label = security_medium_label_sid;
+ }
+
+ if (token)
+ {
+ if (token_assign_label( token, label ))
+ reply->token = alloc_handle( current->process, token, TOKEN_ALL_ACCESS, 0 );
+ release_object( token );
+ }
+}
--
2.28.0

View File

@@ -1,66 +0,0 @@
From cf24ca0854a5b0dca2055f0991fd9a932125c65e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 5 Aug 2017 02:03:20 +0200
Subject: shell32: Implement process elevation using runas verb.
---
dlls/shell32/shlexec.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 0cf112b6373..af50078dbca 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -50,6 +50,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(exec);
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
+
static const WCHAR wszOpen[] = {'o','p','e','n',0};
static const WCHAR wszExe[] = {'.','e','x','e',0};
static const WCHAR wszILPtr[] = {':','%','p',0};
@@ -312,6 +314,8 @@ static HRESULT SHELL_GetPathFromIDListForExecuteW(LPCITEMIDLIST pidl, LPWSTR psz
static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
const SHELLEXECUTEINFOW *psei, LPSHELLEXECUTEINFOW psei_out)
{
+ static WCHAR runasW[] = {'r','u','n','a','s',0};
+ HANDLE token = NULL;
STARTUPINFOW startup;
PROCESS_INFORMATION info;
UINT_PTR retval = SE_ERR_NOASSOC;
@@ -344,8 +348,20 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
dwCreationFlags = CREATE_UNICODE_ENVIRONMENT;
if (!(psei->fMask & SEE_MASK_NO_CONSOLE))
dwCreationFlags |= CREATE_NEW_CONSOLE;
- if (CreateProcessW(NULL, (LPWSTR)lpCmd, NULL, NULL, FALSE, dwCreationFlags, env,
- lpDirectory, &startup, &info))
+
+ /* Spawning a process with runas verb means that the process should be
+ * executed with admin rights. This function ignores the manifest data,
+ * and allows programs to elevate rights on-demand. On Windows a complex
+ * RPC menchanism is used, using CreateProcessAsUser would fail because
+ * it can only be used to drop rights. */
+ if (psei->lpVerb && !strcmpiW(psei->lpVerb, runasW))
+ {
+ if (!(token = __wine_create_default_token(TRUE)))
+ ERR("Failed to create admin token\n");
+ }
+
+ if (CreateProcessAsUserW(token, NULL, (LPWSTR)lpCmd, NULL, NULL, FALSE,
+ dwCreationFlags, env, lpDirectory, &startup, &info))
{
/* Give 30 seconds to the app to come up, if desired. Probably only needed
when starting app immediately before making a DDE connection. */
@@ -365,6 +381,8 @@ static UINT_PTR SHELL_ExecuteW(const WCHAR *lpCmd, WCHAR *env, BOOL shWait,
retval = ERROR_BAD_FORMAT;
}
+ if (token) CloseHandle(token);
+
TRACE("returning %lu\n", retval);
psei_out->hInstApp = (HINSTANCE)retval;
--
2.13.1

View File

@@ -1,67 +0,0 @@
From e34d019222909281390f83149be755a4145024c4 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 7 Aug 2017 15:28:33 +0200
Subject: [PATCH] ntdll: Add semi-stub for TokenLinkedToken info class.
---
dlls/ntdll/unix/security.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/security.c b/dlls/ntdll/unix/security.c
index f0057116dee..2769e5f6a7b 100644
--- a/dlls/ntdll/unix/security.c
+++ b/dlls/ntdll/unix/security.c
@@ -138,6 +138,7 @@ NTSTATUS WINAPI NtDuplicateToken( HANDLE token, ACCESS_MASK access, OBJECT_ATTRI
return status;
}
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
/***********************************************************************
* NtQueryInformationToken (NTDLL.@)
@@ -166,7 +167,7 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c
0, /* TokenAuditPolicy */
0, /* TokenOrigin */
sizeof(TOKEN_ELEVATION_TYPE), /* TokenElevationType */
- 0, /* TokenLinkedToken */
+ sizeof(TOKEN_LINKED_TOKEN), /* TokenLinkedToken */
sizeof(TOKEN_ELEVATION), /* TokenElevation */
0, /* TokenHasRestrictions */
0, /* TokenAccessInformation */
@@ -401,6 +402,33 @@ NTSTATUS WINAPI NtQueryInformationToken( HANDLE token, TOKEN_INFORMATION_CLASS c
SERVER_END_REQ;
break;
+ case TokenLinkedToken:
+ SERVER_START_REQ( get_token_elevation_type )
+ {
+ TOKEN_LINKED_TOKEN *linked_token = info;
+ req->handle = wine_server_obj_handle( token );
+ status = wine_server_call( req );
+ if (status == STATUS_SUCCESS)
+ {
+ HANDLE token;
+ /* FIXME: On Wine we do not have real linked tokens yet. Typically, a
+ * program running with admin privileges is linked to a limited token,
+ * and vice versa. We just create a new token instead of storing links
+ * on the wineserver side. Using TokenLinkedToken twice should return
+ * back the original token. */
+ if ((reply->elevation == TokenElevationTypeFull || reply->elevation == TokenElevationTypeLimited) &&
+ (token = __wine_create_default_token( reply->elevation != TokenElevationTypeFull )))
+ {
+ status = NtDuplicateToken( token, 0, NULL, SecurityIdentification, TokenImpersonation, &linked_token->LinkedToken );
+ NtClose( token );
+ }
+ else
+ status = STATUS_NO_TOKEN;
+ }
+ }
+ SERVER_END_REQ;
+ break;
+
case TokenElevation:
SERVER_START_REQ( get_token_elevation_type )
{
--
2.27.0

View File

@@ -1,310 +0,0 @@
From 9c61f6acfa2c43e43f07fae1a5cd447573b9529b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 6 Aug 2017 02:08:05 +0200
Subject: [PATCH] server: Implement support for creating processes using a
token.
---
dlls/kernelbase/process.c | 24 +++++++++++++-----------
dlls/ntdll/unix/process.c | 1 +
server/process.c | 39 +++++++++++++++++++++++++++++++++++----
server/process.h | 2 +-
server/protocol.def | 1 +
server/request.c | 2 +-
server/security.h | 2 ++
server/token.c | 11 +++++++++++
8 files changed, 65 insertions(+), 17 deletions(-)
diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c
index a3b168543fc..b5c8b47239d 100644
--- a/dlls/kernelbase/process.c
+++ b/dlls/kernelbase/process.c
@@ -244,7 +244,7 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename
/***********************************************************************
* create_nt_process
*/
-static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES *tsa,
+static NTSTATUS create_nt_process( HANDLE token, SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES *tsa,
BOOL inherit, DWORD flags, RTL_USER_PROCESS_PARAMETERS *params,
RTL_USER_PROCESS_INFORMATION *info, HANDLE parent )
{
@@ -259,7 +259,7 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
status = RtlCreateUserProcess( &nameW, OBJ_CASE_INSENSITIVE, params,
psa ? psa->lpSecurityDescriptor : NULL,
tsa ? tsa->lpSecurityDescriptor : NULL,
- parent, inherit, 0, 0, info );
+ parent, inherit, 0, token, info );
RtlFreeUnicodeString( &nameW );
}
return status;
@@ -269,7 +269,7 @@ static NTSTATUS create_nt_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES
/***********************************************************************
* create_vdm_process
*/
-static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES *tsa,
+static NTSTATUS create_vdm_process( HANDLE token, SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES *tsa,
BOOL inherit, DWORD flags, RTL_USER_PROCESS_PARAMETERS *params,
RTL_USER_PROCESS_INFORMATION *info )
{
@@ -290,7 +290,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
winevdm, params->ImagePathName.Buffer, params->CommandLine.Buffer );
RtlInitUnicodeString( &params->ImagePathName, winevdm );
RtlInitUnicodeString( &params->CommandLine, newcmdline );
- status = create_nt_process( psa, tsa, inherit, flags, params, info, NULL );
+ status = create_nt_process( token, psa, tsa, inherit, flags, params, info, NULL );
HeapFree( GetProcessHeap(), 0, newcmdline );
return status;
}
@@ -299,7 +299,7 @@ static NTSTATUS create_vdm_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
/***********************************************************************
* create_cmd_process
*/
-static NTSTATUS create_cmd_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES *tsa,
+static NTSTATUS create_cmd_process( HANDLE token, SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTES *tsa,
BOOL inherit, DWORD flags, RTL_USER_PROCESS_PARAMETERS *params,
RTL_USER_PROCESS_INFORMATION *info )
{
@@ -318,7 +318,7 @@ static NTSTATUS create_cmd_process( SECURITY_ATTRIBUTES *psa, SECURITY_ATTRIBUTE
swprintf( newcmdline, len, L"%s /s/c \"%s\"", comspec, params->CommandLine.Buffer );
RtlInitUnicodeString( &params->ImagePathName, comspec );
RtlInitUnicodeString( &params->CommandLine, newcmdline );
- status = create_nt_process( psa, tsa, inherit, flags, params, info, NULL );
+ status = create_nt_process( token, psa, tsa, inherit, flags, params, info, NULL );
RtlFreeHeap( GetProcessHeap(), 0, newcmdline );
return status;
}
@@ -450,7 +450,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
TRACE( "app %s cmdline %s\n", debugstr_w(app_name), debugstr_w(cmd_line) );
- if (token) FIXME( "Creating a process with a token is not yet implemented\n" );
+ /* FIXME: Starting a process which requires admin rights should fail
+ * with ERROR_ELEVATION_REQUIRED when no token is passed. */
+
if (new_token) FIXME( "No support for returning created process token\n" );
if (app_name)
@@ -523,7 +525,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
}
}
- status = create_nt_process( process_attr, thread_attr, inherit, flags, params, &rtl_info, parent );
+ status = create_nt_process( token, process_attr, thread_attr, inherit, flags, params, &rtl_info, parent );
switch (status)
{
case STATUS_SUCCESS:
@@ -532,7 +534,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
case STATUS_INVALID_IMAGE_NE_FORMAT:
case STATUS_INVALID_IMAGE_PROTECT:
TRACE( "starting %s as Win16/DOS binary\n", debugstr_w(app_name) );
- status = create_vdm_process( process_attr, thread_attr, inherit, flags, params, &rtl_info );
+ status = create_vdm_process( token, process_attr, thread_attr, inherit, flags, params, &rtl_info );
break;
case STATUS_INVALID_IMAGE_NOT_MZ:
/* check for .com or .bat extension */
@@ -540,12 +542,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR
if (!wcsicmp( p, L".com" ) || !wcsicmp( p, L".pif" ))
{
TRACE( "starting %s as DOS binary\n", debugstr_w(app_name) );
- status = create_vdm_process( process_attr, thread_attr, inherit, flags, params, &rtl_info );
+ status = create_vdm_process( token, process_attr, thread_attr, inherit, flags, params, &rtl_info );
}
else if (!wcsicmp( p, L".bat" ) || !wcsicmp( p, L".cmd" ))
{
TRACE( "starting %s as batch binary\n", debugstr_w(app_name) );
- status = create_cmd_process( process_attr, thread_attr, inherit, flags, params, &rtl_info );
+ status = create_cmd_process( token, process_attr, thread_attr, inherit, flags, params, &rtl_info );
}
break;
}
diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c
index cca6c2747bf..379a0036b63 100644
--- a/dlls/ntdll/unix/process.c
+++ b/dlls/ntdll/unix/process.c
@@ -827,6 +827,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_
req->access = process_access;
req->cpu = pe_info.cpu;
req->info_size = startup_info_size;
+ req->token = wine_server_obj_handle( token );
wine_server_add_data( req, objattr, attr_len );
wine_server_add_data( req, startup_info, startup_info_size );
wine_server_add_data( req, params->Environment, env_size );
diff --git a/server/process.c b/server/process.c
index 52604ec4d61..047916ffd09 100644
--- a/server/process.c
+++ b/server/process.c
@@ -499,7 +499,7 @@ static void start_sigkill_timer( struct process *process )
/* create a new process */
/* if the function fails the fd is closed */
struct process *create_process( int fd, struct process *parent, int inherit_all,
- const struct security_descriptor *sd )
+ const struct security_descriptor *sd, struct token *token )
{
struct process *process;
@@ -576,7 +576,7 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
: alloc_handle_table( process, 0 );
/* Note: for security reasons, starting a new process does not attempt
* to use the current impersonation token for the new process */
- process->token = token_duplicate( parent->token, TRUE, 0, NULL, NULL, 0, NULL, 0 );
+ process->token = token_duplicate( token ? token : parent->token, TRUE, 0, NULL, NULL, 0, NULL, 0 );
process->affinity = parent->affinity;
}
if (!process->handles || !process->token) goto error;
@@ -1132,6 +1132,7 @@ DECL_HANDLER(new_process)
const struct security_descriptor *sd;
const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL );
struct process *process = NULL;
+ struct token *token = NULL;
struct process *parent;
struct thread *parent_thread = current;
int socket_fd = thread_get_inflight_fd( current, req->socket_fd );
@@ -1185,10 +1186,39 @@ DECL_HANDLER(new_process)
return;
}
+ if (req->token)
+ {
+ token = get_token_from_handle( req->token, TOKEN_QUERY | TOKEN_DUPLICATE | TOKEN_ASSIGN_PRIMARY );
+ if (!token)
+ {
+ close( socket_fd );
+ return;
+ }
+ if (!token_is_primary( token ))
+ {
+ set_error( STATUS_BAD_TOKEN_TYPE );
+ release_object( token );
+ close( socket_fd );
+ return;
+ }
+ }
+
+ if (!req->info_size) /* create an orphaned process */
+ {
+ if ((process = create_process( socket_fd, NULL, 0, sd, token )))
+ {
+ create_thread( -1, process, NULL );
+ release_object( process );
+ }
+ if (token) release_object( token );
+ return;
+ }
+
/* build the startup info for a new process */
if (!(info = alloc_object( &startup_info_ops )))
{
close( socket_fd );
+ if (token) release_object( token );
release_object( parent );
return;
}
@@ -1236,7 +1266,7 @@ DECL_HANDLER(new_process)
#undef FIXUP_LEN
}
- if (!(process = create_process( socket_fd, parent, req->inherit_all, sd ))) goto done;
+ if (!(process = create_process( socket_fd, parent, req->inherit_all, sd, token ))) goto done;
process->startup_info = (struct startup_info *)grab_object( info );
@@ -1297,6 +1327,7 @@ DECL_HANDLER(new_process)
reply->handle = alloc_handle_no_access_check( current->process, process, req->access, objattr->attributes );
done:
+ if (token) release_object( token );
if (process) release_object( process );
release_object( parent );
release_object( info );
@@ -1330,7 +1361,7 @@ DECL_HANDLER(exec_process)
close( socket_fd );
return;
}
- if (!(process = create_process( socket_fd, NULL, 0, NULL ))) return;
+ if (!(process = create_process( socket_fd, NULL, 0, NULL, NULL ))) return;
create_thread( -1, process, NULL );
release_object( process );
}
diff --git a/server/process.h b/server/process.h
index dfe5c4e52d8..61b83abf693 100644
--- a/server/process.h
+++ b/server/process.h
@@ -118,7 +118,7 @@ extern unsigned int alloc_ptid( void *ptr );
extern void free_ptid( unsigned int id );
extern void *get_ptid_entry( unsigned int id );
extern struct process *create_process( int fd, struct process *parent, int inherit_all,
- const struct security_descriptor *sd );
+ const struct security_descriptor *sd, struct token *token );
extern data_size_t init_process( struct thread *thread );
extern struct thread *get_process_first_thread( struct process *process );
extern struct process *get_process_from_id( process_id_t id );
diff --git a/server/protocol.def b/server/protocol.def
index 901c380b721..8c86967609f 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -801,6 +801,7 @@ struct rawinput_device
unsigned int access; /* access rights for process object */
client_cpu_t cpu; /* CPU that the new process will use */
data_size_t info_size; /* size of startup info */
+ obj_handle_t token; /* token for the new process */
VARARG(objattr,object_attributes); /* object attributes */
VARARG(info,startup_info,info_size); /* startup information */
VARARG(env,unicode_str); /* environment for new process */
diff --git a/server/request.c b/server/request.c
index 4c1f30a5fe7..321bb6cfa81 100644
--- a/server/request.c
+++ b/server/request.c
@@ -582,7 +582,7 @@ static void master_socket_poll_event( struct fd *fd, int event )
int client = accept( get_unix_fd( master_socket->fd ), (struct sockaddr *) &dummy, &len );
if (client == -1) return;
fcntl( client, F_SETFL, O_NONBLOCK );
- if ((process = create_process( client, NULL, 0, NULL )))
+ if ((process = create_process( client, NULL, 0, NULL, NULL )))
{
create_thread( -1, process, NULL );
release_object( process );
diff --git a/server/security.h b/server/security.h
index 21e90ccf23f..32dfe5f8db9 100644
--- a/server/security.h
+++ b/server/security.h
@@ -67,6 +67,8 @@ extern const ACL *token_get_default_dacl( struct token *token );
extern const SID *token_get_user( struct token *token );
extern const SID *token_get_primary_group( struct token *token );
extern int token_sid_present( struct token *token, const SID *sid, int deny);
+extern struct token *get_token_from_handle( obj_handle_t handle, unsigned int access );
+extern int token_is_primary( struct token *token );
static inline const ACE_HEADER *ace_next( const ACE_HEADER *ace )
{
diff --git a/server/token.c b/server/token.c
index 1c1d49989b3..2f466aa1b25 100644
--- a/server/token.c
+++ b/server/token.c
@@ -843,6 +843,12 @@ int token_assign_label( struct token *token, PSID label )
return ret;
}
+struct token *get_token_from_handle( obj_handle_t handle, unsigned int access )
+{
+ return (struct token *)get_handle_obj( current->process, handle,
+ access, &token_ops );
+}
+
struct token *token_create_admin( void )
{
struct token *token = NULL;
@@ -1269,6 +1275,11 @@ const SID *token_get_primary_group( struct token *token )
return token->primary_group;
}
+int token_is_primary( struct token *token )
+{
+ return token->primary;
+}
+
int check_object_access(struct object *obj, unsigned int *access)
{
GENERIC_MAPPING mapping;
--
2.27.0

View File

@@ -1,6 +1,5 @@
Fixes: [40613] Basic implementation for token integrity levels and UAC handling
Fixes: [39262] Run explorer.exe as unevaluated process
Depends: advapi32-CreateRestrictedToken
Depends: Staging
# Broken due to ntdll.so <- ntdll.dll imports. This isn't particularly difficult
# to fix, but it was already broken for some more obscure reason, and the whole

View File

@@ -1,23 +1,23 @@
From 19683a27eaaed9c23635e9b5fa768a6c120a2ace Mon Sep 17 00:00:00 2001
From 9bdd47614e24f12a292c18bdc9d81e55744b6e5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 17 Jan 2016 01:11:46 +0100
Subject: [PATCH] iertutil: Add dll and add stub for ordinal 811.
---
configure.ac | 1 +
dlls/iertutil/Makefile.in | 4 +
dlls/iertutil/iertutil.spec | 521 ++++++++++++++++++++++++++++++++++++++++++++
dlls/iertutil/main.c | 48 ++++
4 files changed, 574 insertions(+)
dlls/iertutil/Makefile.in | 6 +
dlls/iertutil/iertutil.spec | 521 ++++++++++++++++++++++++++++++++++++
dlls/iertutil/main.c | 31 +++
4 files changed, 559 insertions(+)
create mode 100644 dlls/iertutil/Makefile.in
create mode 100644 dlls/iertutil/iertutil.spec
create mode 100644 dlls/iertutil/main.c
diff --git a/configure.ac b/configure.ac
index 5c97c1c..d70dcea 100644
index caff5d1fe52..91b95b8e7b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3286,6 +3286,7 @@ WINE_CONFIG_MAKEFILE(dlls/icmp)
@@ -3342,6 +3342,7 @@ WINE_CONFIG_MAKEFILE(dlls/icmp)
WINE_CONFIG_MAKEFILE(dlls/ieframe)
WINE_CONFIG_MAKEFILE(dlls/ieframe/tests)
WINE_CONFIG_MAKEFILE(dlls/ieproxy)
@@ -27,17 +27,19 @@ index 5c97c1c..d70dcea 100644
WINE_CONFIG_MAKEFILE(dlls/imagehlp)
diff --git a/dlls/iertutil/Makefile.in b/dlls/iertutil/Makefile.in
new file mode 100644
index 0000000..268026e
index 00000000000..47f9d228812
--- /dev/null
+++ b/dlls/iertutil/Makefile.in
@@ -0,0 +1,4 @@
@@ -0,0 +1,6 @@
+MODULE = iertutil.dll
+
+EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
+
+C_SRCS = \
+ main.c
diff --git a/dlls/iertutil/iertutil.spec b/dlls/iertutil/iertutil.spec
new file mode 100644
index 0000000..a13779b
index 00000000000..a13779bebbd
--- /dev/null
+++ b/dlls/iertutil/iertutil.spec
@@ -0,0 +1,521 @@
@@ -564,10 +566,10 @@ index 0000000..a13779b
+@ stub UriFromHostAndScheme
diff --git a/dlls/iertutil/main.c b/dlls/iertutil/main.c
new file mode 100644
index 0000000..2b993a4
index 00000000000..4e5e9f086b3
--- /dev/null
+++ b/dlls/iertutil/main.c
@@ -0,0 +1,48 @@
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2016 Michael Müller
+ *
@@ -586,7 +588,6 @@ index 0000000..2b993a4
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+#include <stdarg.h>
+
+#include "windef.h"
@@ -595,27 +596,11 @@ index 0000000..2b993a4
+
+WINE_DEFAULT_DEBUG_CHANNEL(iertutil);
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
+{
+ TRACE("(%p, %u, %p)\n", instance, reason, reserved);
+
+ switch (reason)
+ {
+ case DLL_WINE_PREATTACH:
+ return FALSE; /* prefer native version */
+ case DLL_PROCESS_ATTACH:
+ DisableThreadLibraryCalls(instance);
+ break;
+ }
+
+ return TRUE;
+}
+
+BOOL WINAPI IERTUTIL_811(void *unknown)
+{
+ FIXME("(%p): stub\n", unknown);
+ return FALSE;
+}
--
1.9.1
2.20.1

View File

@@ -1,4 +1,4 @@
From 21b4b65eadc9e39008ccadc48307fcfea05a24fb Mon Sep 17 00:00:00 2001
From 0e65ed108eb8bab24668f9a58c5757a3ad36104f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 12 Apr 2016 01:02:34 +0200
Subject: [PATCH] uiautomationcore: Add dll and stub some functions.
@@ -9,7 +9,7 @@ Subject: [PATCH] uiautomationcore: Add dll and stub some functions.
2 files changed, 48 insertions(+), 6 deletions(-)
diff --git a/dlls/uiautomationcore/Makefile.in b/dlls/uiautomationcore/Makefile.in
index b6edec5f6a9..bf2204d5ab4 100644
index 5c4acb232a4..412f1dbbe19 100644
--- a/dlls/uiautomationcore/Makefile.in
+++ b/dlls/uiautomationcore/Makefile.in
@@ -1,5 +1,6 @@
@@ -17,10 +17,10 @@ index b6edec5f6a9..bf2204d5ab4 100644
IMPORTLIB = uiautomationcore
+IMPORTS = uuid
EXTRADLLFLAGS = -mno-cygwin
EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
diff --git a/dlls/uiautomationcore/uia_main.c b/dlls/uiautomationcore/uia_main.c
index f0d8247724d..b9c24b4b963 100644
index 42014af6035..61e165d83c0 100644
--- a/dlls/uiautomationcore/uia_main.c
+++ b/dlls/uiautomationcore/uia_main.c
@@ -1,4 +1,5 @@
@@ -29,7 +29,7 @@ index f0d8247724d..b9c24b4b963 100644
* Copyright 2017 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
@@ -16,6 +17,7 @@
@@ -16,18 +17,58 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
@@ -37,9 +37,8 @@ index f0d8247724d..b9c24b4b963 100644
#include "uiautomation.h"
#include "wine/debug.h"
@@ -37,12 +39,51 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, void *lpv)
return TRUE;
}
WINE_DEFAULT_DEBUG_CHANNEL(uiautomation);
+static HRESULT WINAPI dummy_QueryInterface(IUnknown *iface, REFIID iid, void **ppv)
+{
@@ -90,7 +89,7 @@ index f0d8247724d..b9c24b4b963 100644
return FALSE;
}
@@ -51,8 +92,8 @@ BOOL WINAPI UiaClientsAreListening(void)
@@ -36,8 +77,8 @@ BOOL WINAPI UiaClientsAreListening(void)
*/
HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value)
{
@@ -101,7 +100,7 @@ index f0d8247724d..b9c24b4b963 100644
return S_OK;
}
@@ -61,8 +102,8 @@ HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value)
@@ -46,8 +87,8 @@ HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value)
*/
HRESULT WINAPI UiaGetReservedNotSupportedValue(IUnknown **value)
{
@@ -112,7 +111,7 @@ index f0d8247724d..b9c24b4b963 100644
return S_OK;
}
@@ -81,7 +122,7 @@ int WINAPI UiaLookupId(enum AutomationIdentifierType type, const GUID *guid)
@@ -66,7 +107,7 @@ int WINAPI UiaLookupId(enum AutomationIdentifierType type, const GUID *guid)
LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wParam,
LPARAM lParam, IRawElementProviderSimple *elprov)
{
@@ -122,5 +121,5 @@ index f0d8247724d..b9c24b4b963 100644
}
--
2.17.1
2.20.1

View File

@@ -0,0 +1,346 @@
From 3478a4e41c07a66e7e913c54bcf5ad52e16a8fee Mon Sep 17 00:00:00 2001
From: Derek Lesho <dlesho@codeweavers.com>
Date: Fri, 2 Oct 2020 11:29:24 -0500
Subject: [PATCH] bcrypt: Allow multiple backends to coexist.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
---
dlls/bcrypt/Makefile.in | 3 +-
dlls/bcrypt/bcrypt_internal.h | 3 +
dlls/bcrypt/gnutls.c | 32 ++++--
dlls/bcrypt/macos.c | 18 ++-
dlls/bcrypt/unixlib.c | 211 ++++++++++++++++++++++++++++++++++
5 files changed, 252 insertions(+), 15 deletions(-)
create mode 100644 dlls/bcrypt/unixlib.c
diff --git a/dlls/bcrypt/Makefile.in b/dlls/bcrypt/Makefile.in
index 24803fb2d7cb..46a20d473dd7 100644
--- a/dlls/bcrypt/Makefile.in
+++ b/dlls/bcrypt/Makefile.in
@@ -11,6 +11,7 @@ C_SRCS = \
macos.c \
md2.c \
sha256.c \
- sha512.c
+ sha512.c \
+ unixlib.c
RC_SRCS = version.rc
diff --git a/dlls/bcrypt/bcrypt_internal.h b/dlls/bcrypt/bcrypt_internal.h
index eb1361115093..3c7110d05f84 100644
--- a/dlls/bcrypt/bcrypt_internal.h
+++ b/dlls/bcrypt/bcrypt_internal.h
@@ -218,4 +218,7 @@ struct key_funcs
NTSTATUS (CDECL *key_import_rsa)( struct key *, UCHAR *, ULONG );
};
+struct key_funcs *gnutls_lib_init(DWORD reason);
+struct key_funcs *macos_lib_init(DWORD reason);
+
#endif /* __BCRYPT_INTERNAL_H */
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
index c065ac31fba3..9490ea8612a8 100644
--- a/dlls/bcrypt/gnutls.c
+++ b/dlls/bcrypt/gnutls.c
@@ -371,9 +371,12 @@ fail:
static void gnutls_uninitialize(void)
{
- pgnutls_global_deinit();
- dlclose( libgnutls_handle );
- libgnutls_handle = NULL;
+ if (libgnutls_handle)
+ {
+ pgnutls_global_deinit();
+ dlclose( libgnutls_handle );
+ libgnutls_handle = NULL;
+ }
}
struct buffer
@@ -1949,19 +1952,28 @@ static const struct key_funcs key_funcs =
key_import_rsa
};
-NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
+struct key_funcs * gnutls_lib_init( DWORD reason )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
- if (!gnutls_initialize()) return STATUS_DLL_NOT_FOUND;
- *(const struct key_funcs **)ptr_out = &key_funcs;
- break;
+ if (!gnutls_initialize()) return NULL;
+ return &key_funcs;
case DLL_PROCESS_DETACH:
gnutls_uninitialize();
- break;
}
- return STATUS_SUCCESS;
+ return NULL;
}
-#endif /* HAVE_GNUTLS_CIPHER_INIT */
+#else /* HAVE_GNUTLS_CIPHER_INIT */
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+
+struct key_funcs * gnutls_lib_init( DWORD reason )
+{
+ return NULL;
+}
+#endif
diff --git a/dlls/bcrypt/macos.c b/dlls/bcrypt/macos.c
index 44906519cef0..2a88aec8362c 100644
--- a/dlls/bcrypt/macos.c
+++ b/dlls/bcrypt/macos.c
@@ -302,11 +302,21 @@ static const struct key_funcs key_funcs =
key_import_rsa
};
-NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
+struct key_funcs * macos_lib_init( DWORD reason )
{
- if (reason != DLL_PROCESS_ATTACH) return STATUS_SUCCESS;
- *(const struct key_funcs **)ptr_out = &key_funcs;
- return STATUS_SUCCESS;
+ if (reason != DLL_PROCESS_ATTACH) return NULL;
+ return &key_funcs;
}
+#else
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winternl.h"
+
+struct key_funcs * macos_lib_init( DWORD reason )
+{
+ return NULL;
+}
#endif
diff --git a/dlls/bcrypt/unixlib.c b/dlls/bcrypt/unixlib.c
new file mode 100644
index 000000000000..9cbb25f5740c
--- /dev/null
+++ b/dlls/bcrypt/unixlib.c
@@ -0,0 +1,211 @@
+#if 0
+#pragma makedep unix
+#endif
+
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdarg.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "ntsecapi.h"
+#include "bcrypt.h"
+
+#include "bcrypt_internal.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+#if defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 || defined(HAVE_GNUTLS_CIPHER_INIT)
+WINE_DEFAULT_DEBUG_CHANNEL(bcrypt);
+
+static NTSTATUS CDECL key_set_property( struct key *key, const WCHAR *prop, UCHAR *value, ULONG size, ULONG flags )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_symmetric_init( struct key *key )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static void CDECL key_symmetric_vector_reset( struct key *key )
+{
+ FIXME( "not implemented\n" );
+}
+
+static NTSTATUS CDECL key_symmetric_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_symmetric_encrypt( struct key *key, const UCHAR *input, ULONG input_len, UCHAR *output, ULONG output_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_symmetric_decrypt( struct key *key, const UCHAR *input, ULONG input_len, UCHAR *output, ULONG output_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_symmetric_get_tag( struct key *key, UCHAR *tag, ULONG len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static void CDECL key_symmetric_destroy( struct key *key )
+{
+ FIXME( "not implemented\n" );
+}
+
+static NTSTATUS CDECL key_asymmetric_init( struct key *key )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_asymmetric_sign( struct key *key, void *padding, UCHAR *input, ULONG input_len, UCHAR *output,
+ ULONG output_len, ULONG *ret_len, ULONG flags )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_asymmetric_verify( struct key *key, void *padding, UCHAR *hash, ULONG hash_len,
+ UCHAR *signature, ULONG signature_len, DWORD flags )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_export_dsa_capi( struct key *key, UCHAR *buf, ULONG len, ULONG *ret_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_export_ecc( struct key *key, UCHAR *output, ULONG len, ULONG *ret_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_import_dsa_capi( struct key *key, UCHAR *buf, ULONG len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_import_ecc( struct key *key, UCHAR *input, ULONG len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_asymmetric_generate( struct key *key )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_asymmetric_duplicate( struct key *key_orig, struct key *key_copy )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static void CDECL key_asymmetric_destroy( struct key *key )
+{
+ FIXME( "not implemented\n" );
+}
+
+static NTSTATUS CDECL key_asymmetric_decrypt( struct key *key, UCHAR *input, ULONG input_len,
+ UCHAR *output, ULONG *output_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS CDECL key_import_rsa( struct key *key, UCHAR *input, ULONG input_len )
+{
+ FIXME( "not implemented\n" );
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+static struct key_funcs key_funcs =
+{
+ key_set_property,
+ key_symmetric_init,
+ key_symmetric_vector_reset,
+ key_symmetric_set_auth_data,
+ key_symmetric_encrypt,
+ key_symmetric_decrypt,
+ key_symmetric_get_tag,
+ key_symmetric_destroy,
+ key_asymmetric_init,
+ key_asymmetric_generate,
+ key_asymmetric_decrypt,
+ key_asymmetric_duplicate,
+ key_asymmetric_sign,
+ key_asymmetric_verify,
+ key_asymmetric_destroy,
+ key_export_dsa_capi,
+ key_export_ecc,
+ key_import_dsa_capi,
+ key_import_ecc,
+ key_import_rsa,
+};
+
+NTSTATUS CDECL __wine_init_unix_lib( HMODULE module, DWORD reason, const void *ptr_in, void *ptr_out )
+{
+ struct key_funcs *gnutls_funcs = gnutls_lib_init(reason);
+ struct key_funcs *macos_funcs = macos_lib_init(reason);
+
+ if (reason == DLL_PROCESS_ATTACH)
+ {
+#define RESOLVE_FUNC(name) \
+ if (macos_funcs && macos_funcs->key_##name) \
+ key_funcs.key_##name = macos_funcs->key_##name; \
+ if (gnutls_funcs && gnutls_funcs->key_##name) \
+ key_funcs.key_##name = gnutls_funcs->key_##name;
+
+ RESOLVE_FUNC(set_property)
+ RESOLVE_FUNC(symmetric_init)
+ RESOLVE_FUNC(symmetric_vector_reset)
+ RESOLVE_FUNC(symmetric_set_auth_data)
+ RESOLVE_FUNC(symmetric_encrypt)
+ RESOLVE_FUNC(symmetric_decrypt)
+ RESOLVE_FUNC(symmetric_get_tag)
+ RESOLVE_FUNC(symmetric_destroy)
+ RESOLVE_FUNC(asymmetric_init)
+ RESOLVE_FUNC(asymmetric_generate)
+ RESOLVE_FUNC(asymmetric_decrypt)
+ RESOLVE_FUNC(asymmetric_duplicate)
+ RESOLVE_FUNC(asymmetric_sign)
+ RESOLVE_FUNC(asymmetric_verify)
+ RESOLVE_FUNC(asymmetric_destroy)
+ RESOLVE_FUNC(export_dsa_capi)
+ RESOLVE_FUNC(export_ecc)
+ RESOLVE_FUNC(import_dsa_capi)
+ RESOLVE_FUNC(import_ecc)
+ RESOLVE_FUNC(import_rsa)
+
+#undef RESOLVE_FUNC
+
+ *(struct key_funcs **)ptr_out = &key_funcs;
+ }
+
+ return STATUS_SUCCESS;
+}
+
+#endif
--
2.29.2

Some files were not shown because too many files have changed in this diff Show More