mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:33:01 +00:00
- Remove the hack implemenation of LookupPrivilegeValueW.
- Don't check for load driver privilege yet. - Don't try to acquire load driver privilege in Services. svn path=/trunk/; revision=9103
This commit is contained in:
parent
95182ed8f5
commit
d24371eaec
3 changed files with 7 additions and 60 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: misc.c,v 1.13 2004/04/11 19:21:43 navaraf Exp $
|
/* $Id: misc.c,v 1.14 2004/04/12 15:22:52 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -421,47 +421,13 @@ LookupPrivilegeValueA (LPCSTR lpSystemName,
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* LookupPrivilegeValueW EXPORTED
|
* LookupPrivilegeValueW EXPORTED
|
||||||
*
|
*
|
||||||
* @implemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
LookupPrivilegeValueW (LPCWSTR lpSystemName,
|
LookupPrivilegeValueW (LPCWSTR lpSystemName,
|
||||||
LPCWSTR lpName,
|
LPCWSTR lpName,
|
||||||
PLUID lpLuid)
|
PLUID lpLuid)
|
||||||
{
|
{
|
||||||
static LPCWSTR DefaultPrivilegeNames[] =
|
|
||||||
{
|
|
||||||
NULL, NULL,
|
|
||||||
L"SeCreateTokenPrivilege", L"SeAssignPrimaryTokenPrivilege",
|
|
||||||
L"SeLockMemoryPrivilege", L"SeIncreaseQuotaPrivilege",
|
|
||||||
L"SeMachineAccountPrivilege", L"SeTcbPrivilege",
|
|
||||||
L"SeSecurityPrivilege", L"SeTakeOwnershipPrivilege",
|
|
||||||
L"SeLoadDriverPrivilege", L"SeSystemProfilePrivilege",
|
|
||||||
L"SeSystemtimePrivilege", L"SeProfileSingleProcessPrivilege",
|
|
||||||
L"SeIncreaseBasePriorityPrivilege", L"SeCreatePagefilePrivilege",
|
|
||||||
L"SeCreatePermanentPrivilege", L"SeBackupPrivilege",
|
|
||||||
L"SeRestorePrivilege", L"SeShutdownPrivilege",
|
|
||||||
L"SeDebugPrivilege", L"SeAuditPrivilege",
|
|
||||||
L"SeSystemEnvironmentPrivilege", L"SeChangeNotifyPrivilege",
|
|
||||||
L"SeRemoteShutdownPrivilege",
|
|
||||||
};
|
|
||||||
static unsigned DefaultPrivilegeCount =
|
|
||||||
sizeof(DefaultPrivilegeNames) / sizeof(DefaultPrivilegeNames[0]);
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < DefaultPrivilegeCount; i++)
|
|
||||||
{
|
|
||||||
if (!DefaultPrivilegeNames[i] ||
|
|
||||||
lstrcmpW(DefaultPrivilegeNames[i], lpName))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
lpLuid->LowPart = i;
|
|
||||||
lpLuid->HighPart = 0;
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: driver.c,v 1.44 2004/04/11 15:31:21 jfilby Exp $
|
/* $Id: driver.c,v 1.45 2004/04/12 15:22:53 navaraf Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -1514,11 +1514,14 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
|
||||||
* Check security privileges
|
* Check security privileges
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* FIXME: Uncomment when privileges will be correctly implemented. */
|
||||||
|
#if 0
|
||||||
if (!SeSinglePrivilegeCheck(SeLoadDriverPrivilege, KeGetPreviousMode()))
|
if (!SeSinglePrivilegeCheck(SeLoadDriverPrivilege, KeGetPreviousMode()))
|
||||||
{
|
{
|
||||||
DPRINT("Privilege not held\n");
|
DPRINT("Privilege not held\n");
|
||||||
return STATUS_PRIVILEGE_NOT_HELD;
|
return STATUS_PRIVILEGE_NOT_HELD;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
RtlInitUnicodeString(&ImagePath, NULL);
|
RtlInitUnicodeString(&ImagePath, NULL);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: services.c,v 1.15 2004/04/11 16:10:05 jfilby Exp $
|
/* $Id: services.c,v 1.16 2004/04/12 15:22:53 navaraf Exp $
|
||||||
*
|
*
|
||||||
* service control manager
|
* service control manager
|
||||||
*
|
*
|
||||||
|
@ -243,25 +243,6 @@ BOOL StartScmNamedPipeThreadListener(void)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID FASTCALL
|
|
||||||
AcquireLoadDriverPrivilege(VOID)
|
|
||||||
{
|
|
||||||
HANDLE hToken;
|
|
||||||
TOKEN_PRIVILEGES tkp;
|
|
||||||
|
|
||||||
/* Get a token for this process. */
|
|
||||||
if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
|
|
||||||
/* Get the LUID for the debug privilege. */
|
|
||||||
LookupPrivilegeValue(NULL, SE_LOAD_DRIVER_NAME, &tkp.Privileges[0].Luid);
|
|
||||||
|
|
||||||
tkp.PrivilegeCount = 1; /* one privilege to set */
|
|
||||||
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
|
|
||||||
|
|
||||||
/* Get the debug privilege for this process. */
|
|
||||||
AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int STDCALL
|
int STDCALL
|
||||||
WinMain(HINSTANCE hInstance,
|
WinMain(HINSTANCE hInstance,
|
||||||
HINSTANCE hPrevInstance,
|
HINSTANCE hPrevInstance,
|
||||||
|
@ -274,9 +255,6 @@ WinMain(HINSTANCE hInstance,
|
||||||
|
|
||||||
DPRINT("SERVICES: Service Control Manager\n");
|
DPRINT("SERVICES: Service Control Manager\n");
|
||||||
|
|
||||||
/* Acquire privileges to load drivers */
|
|
||||||
AcquireLoadDriverPrivilege();
|
|
||||||
|
|
||||||
/* Create start event */
|
/* Create start event */
|
||||||
if (!ScmCreateStartEvent(&hScmStartEvent))
|
if (!ScmCreateStartEvent(&hScmStartEvent))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue