[SERVICES] Only services starting under the LocalSystem account can run interactively. Otherwise ignore the interactive flag.

This commit is contained in:
Hermès Bélusca-Maïto 2018-09-09 22:20:38 +02:00
parent cccf26da74
commit 419e014675
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -1672,14 +1672,6 @@ ScmStartUserModeService(PSERVICE Service,
StartupInfo.cb = sizeof(StartupInfo);
ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
/* Use the interactive desktop if the service is interactive */
if ((NoInteractiveServices == 0) &&
(Service->Status.dwServiceType & SERVICE_INTERACTIVE_PROCESS))
{
StartupInfo.dwFlags |= STARTF_INHERITDESKTOP;
StartupInfo.lpDesktop = L"WinSta0\\Default";
}
if (Service->lpImage->hToken)
{
/* User token: Run the service under the user account */
@ -1732,6 +1724,14 @@ ScmStartUserModeService(PSERVICE Service,
lpEnvironment = NULL;
}
/* Use the interactive desktop if the service is interactive */
if ((NoInteractiveServices == 0) &&
(Service->Status.dwServiceType & SERVICE_INTERACTIVE_PROCESS))
{
StartupInfo.dwFlags |= STARTF_INHERITDESKTOP;
StartupInfo.lpDesktop = L"WinSta0\\Default";
}
Result = CreateProcessW(NULL,
Service->lpImage->pszImagePath,
NULL,