Rebase against d0f2361170d140ad2510bb26ad187d30fd1c1afa.

This commit is contained in:
Sebastian Lackner 2017-10-27 23:42:26 +02:00
parent a9ee89f869
commit a44a43769b
4 changed files with 53 additions and 53 deletions

View File

@ -1,4 +1,4 @@
From 9709db4e722195a70c5950b78b445c71eac495af Mon Sep 17 00:00:00 2001
From 2993a76ec1711bb3ea1e889289f8d129f17ae2a3 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: server: Implement support for creating processes using a token.
@ -14,10 +14,10 @@ Subject: server: Implement support for creating processes using a token.
7 files changed, 59 insertions(+), 21 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index cacdcb3b621..3ae9d175a79 100644
index c3dcd1349b3..69a026d5441 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2064,7 +2064,7 @@ static NTSTATUS create_struct_sd(PSECURITY_DESCRIPTOR nt_sd, struct security_des
@@ -2051,7 +2051,7 @@ static NTSTATUS create_struct_sd(PSECURITY_DESCRIPTOR nt_sd, struct security_des
* Create a new process. If hFile is a valid handle we have an exe
* file, otherwise it is a Winelib app.
*/
@ -26,7 +26,7 @@ index cacdcb3b621..3ae9d175a79 100644
LPCWSTR cur_dir, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
BOOL inherit, DWORD flags, LPSTARTUPINFOW startup,
LPPROCESS_INFORMATION info, LPCSTR unixdir,
@@ -2210,6 +2210,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW
@@ -2197,6 +2197,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW
req->info_size = startup_info_size;
req->env_size = (env_end - env) * sizeof(WCHAR);
req->process_sd_size = process_sd_size;
@ -34,7 +34,7 @@ index cacdcb3b621..3ae9d175a79 100644
wine_server_add_data( req, startup_info, startup_info_size );
wine_server_add_data( req, env, (env_end - env) * sizeof(WCHAR) );
@@ -2310,7 +2311,7 @@ error:
@@ -2297,7 +2298,7 @@ error:
*
* Create a new VDM process for a 16-bit or DOS application.
*/
@ -43,7 +43,7 @@ index cacdcb3b621..3ae9d175a79 100644
LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
BOOL inherit, DWORD flags, LPSTARTUPINFOW startup,
LPPROCESS_INFORMATION info, LPCSTR unixdir,
@@ -2334,7 +2335,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L
@@ -2321,7 +2322,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L
return FALSE;
}
sprintfW(new_cmd_line, argsW, winevdmW, buffer, cmd_line);
@ -52,7 +52,7 @@ index cacdcb3b621..3ae9d175a79 100644
flags, startup, info, unixdir, binary_info, exec_only );
HeapFree( GetProcessHeap(), 0, new_cmd_line );
return ret;
@@ -2346,7 +2347,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L
@@ -2333,7 +2334,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L
*
* Create a new cmd shell process for a .BAT file.
*/
@ -61,7 +61,7 @@ index cacdcb3b621..3ae9d175a79 100644
LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
BOOL inherit, DWORD flags, LPSTARTUPINFOW startup,
LPPROCESS_INFORMATION info )
@@ -2371,8 +2372,8 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L
@@ -2358,8 +2359,8 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L
strcpyW( newcmdline, comspec );
strcatW( newcmdline, slashcW );
strcatW( newcmdline, cmd_line );
@ -72,7 +72,7 @@ index cacdcb3b621..3ae9d175a79 100644
HeapFree( GetProcessHeap(), 0, newcmdline );
return ret;
}
@@ -2482,7 +2483,9 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
@@ -2469,7 +2470,9 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
TRACE("app %s cmdline %s\n", debugstr_w(app_name), debugstr_w(cmd_line) );
@ -83,10 +83,10 @@ index cacdcb3b621..3ae9d175a79 100644
if (new_token) FIXME("No support for returning created process token\n");
if (!(tidy_cmdline = get_file_name( app_name, cmd_line, name, sizeof(name)/sizeof(WCHAR),
@@ -2540,20 +2543,20 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
@@ -2527,20 +2530,20 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32,
binary_info.res_start, binary_info.res_end, binary_info.arch,
(binary_info.flags & BINARY_FLAG_FAKEDLL) ? ", fakedll" : "" );
wine_dbgstr_longlong(binary_info.res_start), wine_dbgstr_longlong(binary_info.res_end),
binary_info.arch, (binary_info.flags & BINARY_FLAG_FAKEDLL) ? ", fakedll" : "" );
- retv = create_process( hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
+ retv = create_process( token, hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
inherit, flags, startup_info, info, unixdir, &binary_info, FALSE );
@ -107,7 +107,7 @@ index cacdcb3b621..3ae9d175a79 100644
inherit, flags, startup_info, info, unixdir, &binary_info, FALSE );
break;
case BINARY_UNKNOWN:
@@ -2565,7 +2568,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
@@ -2552,7 +2555,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
TRACE( "starting %s as DOS binary\n", debugstr_w(name) );
binary_info.type = BINARY_DOS;
binary_info.arch = IMAGE_FILE_MACHINE_I386;
@ -116,7 +116,7 @@ index cacdcb3b621..3ae9d175a79 100644
inherit, flags, startup_info, info, unixdir,
&binary_info, FALSE );
break;
@@ -2573,7 +2576,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
@@ -2560,7 +2563,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
if (!strcmpiW( p, batW ) || !strcmpiW( p, cmdW ) )
{
TRACE( "starting %s as batch binary\n", debugstr_w(name) );
@ -125,10 +125,10 @@ index cacdcb3b621..3ae9d175a79 100644
inherit, flags, startup_info, info );
break;
}
@@ -2692,12 +2695,12 @@ static void exec_process( LPCWSTR name )
TRACE( "starting %s as Win%d binary (%p-%p, arch %04x)\n",
@@ -2680,12 +2683,12 @@ static void exec_process( LPCWSTR name )
debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32,
binary_info.res_start, binary_info.res_end, binary_info.arch );
wine_dbgstr_longlong(binary_info.res_start), wine_dbgstr_longlong(binary_info.res_end),
binary_info.arch );
- create_process( hFile, name, GetCommandLineW(), NULL, NULL, NULL, NULL,
+ create_process( NULL, hFile, name, GetCommandLineW(), NULL, NULL, NULL, NULL,
FALSE, 0, &startup_info, &info, NULL, &binary_info, TRUE );
@ -140,7 +140,7 @@ index cacdcb3b621..3ae9d175a79 100644
FALSE, 0, &startup_info, &info, NULL, &binary_info, TRUE );
break;
case BINARY_UNKNOWN:
@@ -2711,7 +2714,7 @@ static void exec_process( LPCWSTR name )
@@ -2699,7 +2702,7 @@ static void exec_process( LPCWSTR name )
case BINARY_WIN16:
case BINARY_DOS:
TRACE( "starting %s as Win16/DOS binary\n", debugstr_w(name) );
@ -150,10 +150,10 @@ index cacdcb3b621..3ae9d175a79 100644
break;
default:
diff --git a/server/process.c b/server/process.c
index 74675d343b4..ef2452fb8fb 100644
index 81cea2f1baa..7d2206f2744 100644
--- a/server/process.c
+++ b/server/process.c
@@ -501,7 +501,7 @@ static void start_sigkill_timer( struct process *process )
@@ -496,7 +496,7 @@ static void start_sigkill_timer( struct process *process )
/* create a new process and its main thread */
/* if the function fails the fd is closed */
@ -162,7 +162,7 @@ index 74675d343b4..ef2452fb8fb 100644
{
struct process *process;
struct thread *thread = NULL;
@@ -571,7 +571,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
@@ -567,7 +567,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
: 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 */
@ -171,7 +171,7 @@ index 74675d343b4..ef2452fb8fb 100644
process->affinity = parent->affinity;
}
if (!process->handles || !process->token) goto error;
@@ -1160,6 +1160,7 @@ DECL_HANDLER(new_process)
@@ -1147,6 +1147,7 @@ DECL_HANDLER(new_process)
struct startup_info *info;
struct thread *thread;
struct process *process;
@ -179,7 +179,7 @@ index 74675d343b4..ef2452fb8fb 100644
struct process *parent = current->process;
int socket_fd = thread_get_inflight_fd( current, req->socket_fd );
const struct security_descriptor *process_sd = NULL, *thread_sd = NULL;
@@ -1195,9 +1196,27 @@ DECL_HANDLER(new_process)
@@ -1182,9 +1183,27 @@ DECL_HANDLER(new_process)
return;
}
@ -208,7 +208,7 @@ index 74675d343b4..ef2452fb8fb 100644
return;
}
@@ -1205,6 +1224,7 @@ DECL_HANDLER(new_process)
@@ -1192,6 +1211,7 @@ DECL_HANDLER(new_process)
if (!(info = alloc_object( &startup_info_ops )))
{
close( socket_fd );
@ -216,7 +216,7 @@ index 74675d343b4..ef2452fb8fb 100644
return;
}
info->exe_file = NULL;
@@ -1287,7 +1307,7 @@ DECL_HANDLER(new_process)
@@ -1274,7 +1294,7 @@ DECL_HANDLER(new_process)
}
}
@ -225,7 +225,7 @@ index 74675d343b4..ef2452fb8fb 100644
process = thread->process;
process->startup_info = (struct startup_info *)grab_object( info );
@@ -1369,6 +1389,7 @@ DECL_HANDLER(new_process)
@@ -1356,6 +1376,7 @@ DECL_HANDLER(new_process)
}
done:
@ -234,10 +234,10 @@ index 74675d343b4..ef2452fb8fb 100644
}
diff --git a/server/process.h b/server/process.h
index 262eb59627b..fcb45d8d676 100644
index 78e88ec350a..313c36ab241 100644
--- a/server/process.h
+++ b/server/process.h
@@ -115,7 +115,7 @@ struct process_snapshot
@@ -114,7 +114,7 @@ struct process_snapshot
extern unsigned int alloc_ptid( void *ptr );
extern void free_ptid( unsigned int id );
extern void *get_ptid_entry( unsigned int id );
@ -247,10 +247,10 @@ index 262eb59627b..fcb45d8d676 100644
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 e5b598259f7..7106cdb6f04 100644
index 1ea129fec08..95513fef6c3 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -767,6 +767,7 @@ struct rawinput_device
@@ -739,6 +739,7 @@ struct rawinput_device
data_size_t info_size; /* size of startup info */
data_size_t env_size; /* size of the environment */
data_size_t process_sd_size;/* size of the process security descriptor */
@ -259,10 +259,10 @@ index e5b598259f7..7106cdb6f04 100644
VARARG(env,unicode_str,env_size); /* environment for new process */
VARARG(process_sd,security_descriptor,process_sd_size); /* security descriptor to set on the process */
diff --git a/server/request.c b/server/request.c
index 83e608917f8..23760cdeb98 100644
index 6120bc550ff..a648c306496 100644
--- a/server/request.c
+++ b/server/request.c
@@ -571,7 +571,7 @@ static void master_socket_poll_event( struct fd *fd, int event )
@@ -570,7 +570,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 );
@ -285,10 +285,10 @@ index 21e90ccf23f..32dfe5f8db9 100644
static inline const ACE_HEADER *ace_next( const ACE_HEADER *ace )
{
diff --git a/server/token.c b/server/token.c
index 385ea3bbfda..c507294b49d 100644
index 49e84362a83..f6b6165d7a9 100644
--- a/server/token.c
+++ b/server/token.c
@@ -851,6 +851,12 @@ int token_assign_label( struct token *token, PSID label )
@@ -843,6 +843,12 @@ int token_assign_label( struct token *token, PSID label )
return ret;
}
@ -301,7 +301,7 @@ index 385ea3bbfda..c507294b49d 100644
struct token *token_create_admin( void )
{
struct token *token = NULL;
@@ -1278,6 +1284,11 @@ const SID *token_get_primary_group( struct token *token )
@@ -1269,6 +1275,11 @@ const SID *token_get_primary_group( struct token *token )
return token->primary_group;
}
@ -314,5 +314,5 @@ index 385ea3bbfda..c507294b49d 100644
{
GENERIC_MAPPING mapping;
--
2.13.1
2.14.2

View File

@ -1,4 +1,4 @@
From 09b4c584ce6017ae0887edf18d989807c40bec4e Mon Sep 17 00:00:00 2001
From 700f06e65a7f0aa474d40ad238138866e2c51ca0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 18 Oct 2015 03:27:41 +0200
Subject: mpr: Return correct error code for non network paths and
@ -14,7 +14,7 @@ Signed-off-by: Michael Müller <michael@fds-team.de>
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/dlls/mpr/tests/mpr.c b/dlls/mpr/tests/mpr.c
index 364ac2cc601..19097b8a286 100644
index a6af1b57f8d..1b16369d514 100644
--- a/dlls/mpr/tests/mpr.c
+++ b/dlls/mpr/tests/mpr.c
@@ -101,25 +101,23 @@ static void test_WNetGetRemoteName(void)
@ -37,7 +37,7 @@ index 364ac2cc601..19097b8a286 100644
- todo_wine{
if(drive_type == DRIVE_REMOTE)
+ todo_wine
ok(ret == WN_BAD_VALUE, "WNetGetUniversalNameA failed: %08x\n", ret);
ok(ret == WN_BAD_VALUE || ret == WN_MORE_DATA, "WNetGetUniversalNameA failed: %08x\n", ret);
else
ok(ret == WN_NOT_CONNECTED || ret == WN_NO_NET_OR_BAD_PATH,
"(%s) WNetGetUniversalNameA gave wrong error: %u\n", driveA, ret);
@ -52,7 +52,7 @@ index 364ac2cc601..19097b8a286 100644
- todo_wine {
if(drive_type == DRIVE_REMOTE)
+ todo_wine
ok(ret == WN_BAD_POINTER, "WNetGetUniversalNameA failed: %08x\n", ret);
ok(ret == WN_BAD_POINTER || ret == WN_BAD_VALUE, "WNetGetUniversalNameA failed: %08x\n", ret);
else
ok(ret == WN_NOT_CONNECTED || ret == WN_BAD_VALUE,
"(%s) WNetGetUniversalNameA gave wrong error: %u\n", driveA, ret);
@ -61,10 +61,10 @@ index 364ac2cc601..19097b8a286 100644
fail_size = sizeof(driveA) / sizeof(char) - 1;
ret = WNetGetUniversalNameA(driveA, REMOTE_NAME_INFO_LEVEL,
diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c
index cbbc1bdfb04..1514d014e8b 100644
index 7b24693e0e8..78759ecb152 100644
--- a/dlls/mpr/wnet.c
+++ b/dlls/mpr/wnet.c
@@ -2345,7 +2345,7 @@ DWORD WINAPI WNetGetUniversalNameA ( LPCSTR lpLocalPath, DWORD dwInfoLevel,
@@ -2348,7 +2348,7 @@ DWORD WINAPI WNetGetUniversalNameA ( LPCSTR lpLocalPath, DWORD dwInfoLevel,
break;
}
case REMOTE_NAME_INFO_LEVEL:
@ -74,5 +74,5 @@ index cbbc1bdfb04..1514d014e8b 100644
default:
--
2.13.1
2.14.2

View File

@ -1,4 +1,4 @@
From 246ebe70f4b1ffb5a41098045c0a29be6055d7dd Mon Sep 17 00:00:00 2001
From 314e990c95edd137695f81edb0ce138615cd11b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Mon, 26 Jun 2017 16:18:09 +0200
Subject: msi: Create dummy thread to initialize COM for custom actions.
@ -8,7 +8,7 @@ Subject: msi: Create dummy thread to initialize COM for custom actions.
1 file changed, 48 insertions(+)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 24ada643035..178e3949ee2 100644
index 58a831e7e63..e440ee77fd9 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -160,6 +160,13 @@ static const WCHAR szWriteEnvironmentStrings[] =
@ -25,7 +25,7 @@ index 24ada643035..178e3949ee2 100644
static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
{
WCHAR query[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
@@ -7946,6 +7953,42 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq)
@@ -7968,6 +7975,42 @@ static UINT ACTION_PerformActionSequence(MSIPACKAGE *package, UINT seq)
return rc;
}
@ -68,15 +68,15 @@ index 24ada643035..178e3949ee2 100644
/****************************************************
* TOP level entry points
*****************************************************/
@@ -7956,6 +7999,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
@@ -7978,6 +8021,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
static const WCHAR szDisableRollback[] = {'D','I','S','A','B','L','E','R','O','L','L','B','A','C','K',0};
static const WCHAR szAction[] = {'A','C','T','I','O','N',0};
WCHAR *reinstall, *remove, *patch, *productcode, *action;
WCHAR *reinstall = NULL, *productcode, *action;
+ struct dummy_thread thread_info = {NULL, NULL, NULL};
UINT rc;
DWORD len = 0;
@@ -8023,6 +8067,8 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
@@ -8034,6 +8078,8 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
msi_adjust_privilege_properties( package );
msi_set_context( package );
@ -85,15 +85,15 @@ index 24ada643035..178e3949ee2 100644
productcode = msi_dup_property( package->db, szProductCode );
if (strcmpiW( productcode, package->ProductCode ))
{
@@ -8059,6 +8105,8 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
@@ -8070,6 +8116,8 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
/* finish up running custom actions */
ACTION_FinishCustomActions(package);
+ stop_dummy_thread(&thread_info);
+
if (package->need_rollback && !reinstall)
if (package->need_rollback && !(reinstall = msi_dup_property( package->db, szReinstall )))
{
WARN("installation failed, running rollback script\n");
--
2.14.1
2.14.2

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "c14a16b08911d1695e42b75c60436ace9f42ea01"
echo "d0f2361170d140ad2510bb26ad187d30fd1c1afa"
}
# Show version information