Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
Description
The following test was failing in Windows Server 2003:
/* Test without privilege */
NtSetSystemInformation(SystemTimeAdjustmentInformation, &SetTimeInfo, sizeof(SetTimeInfo));
ok_ntstatus(Status, STATUS_PRIVILEGE_NOT_HELD);
The reason is that when the call to the NT function is performed, the process token has the SE_PRIVILEGE_ENABLED already set thanks to the GetPrivilege() previous call.
The Patch attached:
- Implements ResetPrivilege() which resets the SE_PRIVILEGE_ENABLED before performing the call.
- Fixes a token handle leak.