mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:43:02 +00:00
[SERVICES] Grant ReactOS Setup component SYSTEM access
ReactOS Setup is an integral component that is part of the operating system responsible for the installation of ROS during 2nd installation stage. The situation with current master branch is like this -- the Services component always tries to create the process on behalf of the logged in user with its own security context. That user doesn't have the privileges and access rights like SYSTEM thus the Services component tries to create the process but it fails to do so because of lacking of required access right, TOKEN_DUPLICATE, in order for the calling thread to impersonate as self.
This commit is contained in:
parent
cd1070dfc4
commit
f340524ea4
3 changed files with 26 additions and 1 deletions
|
@ -370,7 +370,7 @@ ScmLogonService(
|
||||||
DPRINT("ScmLogonService(%p %p)\n", pService, pImage);
|
DPRINT("ScmLogonService(%p %p)\n", pService, pImage);
|
||||||
DPRINT("Service %S\n", pService->lpServiceName);
|
DPRINT("Service %S\n", pService->lpServiceName);
|
||||||
|
|
||||||
if (ScmIsLocalSystemAccount(pImage->pszAccountName) || ScmLiveSetup)
|
if (ScmIsLocalSystemAccount(pImage->pszAccountName) || ScmLiveSetup || ScmSetupInProgress)
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
|
|
||||||
/* Get the user and domain names */
|
/* Get the user and domain names */
|
||||||
|
|
|
@ -28,6 +28,7 @@ int WINAPI RegisterServicesProcess(DWORD ServicesProcessId);
|
||||||
BOOL ScmInitialize = FALSE;
|
BOOL ScmInitialize = FALSE;
|
||||||
BOOL ScmShutdown = FALSE;
|
BOOL ScmShutdown = FALSE;
|
||||||
BOOL ScmLiveSetup = FALSE;
|
BOOL ScmLiveSetup = FALSE;
|
||||||
|
BOOL ScmSetupInProgress = FALSE;
|
||||||
static HANDLE hScmShutdownEvent = NULL;
|
static HANDLE hScmShutdownEvent = NULL;
|
||||||
static HANDLE hScmSecurityServicesEvent = NULL;
|
static HANDLE hScmSecurityServicesEvent = NULL;
|
||||||
|
|
||||||
|
@ -55,6 +56,7 @@ CheckForLiveCD(VOID)
|
||||||
WCHAR CommandLine[MAX_PATH];
|
WCHAR CommandLine[MAX_PATH];
|
||||||
HKEY hSetupKey;
|
HKEY hSetupKey;
|
||||||
DWORD dwSetupType;
|
DWORD dwSetupType;
|
||||||
|
DWORD dwSetupInProgress;
|
||||||
DWORD dwType;
|
DWORD dwType;
|
||||||
DWORD dwSize;
|
DWORD dwSize;
|
||||||
DWORD dwError;
|
DWORD dwError;
|
||||||
|
@ -107,6 +109,28 @@ CheckForLiveCD(VOID)
|
||||||
ScmLiveSetup = TRUE;
|
ScmLiveSetup = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Read the SystemSetupInProgress value */
|
||||||
|
dwSize = sizeof(DWORD);
|
||||||
|
dwError = RegQueryValueExW(hSetupKey,
|
||||||
|
L"SystemSetupInProgress",
|
||||||
|
NULL,
|
||||||
|
&dwType,
|
||||||
|
(LPBYTE)&dwSetupInProgress,
|
||||||
|
&dwSize);
|
||||||
|
if (dwError != ERROR_SUCCESS ||
|
||||||
|
dwType != REG_DWORD ||
|
||||||
|
dwSize != sizeof(DWORD) ||
|
||||||
|
dwSetupType == 0)
|
||||||
|
{
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dwSetupInProgress == 1)
|
||||||
|
{
|
||||||
|
DPRINT1("ReactOS Setup currently in progress!\n");
|
||||||
|
ScmSetupInProgress = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
RegCloseKey(hSetupKey);
|
RegCloseKey(hSetupKey);
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,7 @@ extern LIST_ENTRY ImageListHead;
|
||||||
extern BOOL ScmInitialize;
|
extern BOOL ScmInitialize;
|
||||||
extern BOOL ScmShutdown;
|
extern BOOL ScmShutdown;
|
||||||
extern BOOL ScmLiveSetup;
|
extern BOOL ScmLiveSetup;
|
||||||
|
extern BOOL ScmSetupInProgress;
|
||||||
extern PSECURITY_DESCRIPTOR pPipeSD;
|
extern PSECURITY_DESCRIPTOR pPipeSD;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue