[NTOSKRNL]
authorEric Kohl <eric.kohl@reactos.org>
Tue, 23 Mar 2010 21:53:19 +0000 (21:53 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Tue, 23 Mar 2010 21:53:19 +0000 (21:53 +0000)
Fail if you query a primary token for its impersonation level.

svn path=/trunk/; revision=46370

reactos/ntoskrnl/se/token.c

index 44481d6..8f73312 100644 (file)
@@ -1347,6 +1347,14 @@ NtQueryInformationToken(IN HANDLE TokenHandle,
                 PSECURITY_IMPERSONATION_LEVEL sil = (PSECURITY_IMPERSONATION_LEVEL)TokenInformation;
                 
                 DPRINT("NtQueryInformationToken(TokenImpersonationLevel)\n");
+
+                /* Fail if the token is not an impersonation token */
+                if (Token->TokenType != TokenImpersonation)
+                {
+                    Status = STATUS_INVALID_INFO_CLASS;
+                    break;
+                }
+
                 RequiredLength = sizeof(SECURITY_IMPERSONATION_LEVEL);
                 
                 _SEH2_TRY