Author: arty
Date: Sun Sep 9 16:21:22 2007
New Revision: 28973
URL:
http://svn.reactos.org/svn/reactos?rev=28973&view=rev
Log:
Mask values that control inheritability of the handle, and don't affect access.
Modified:
trunk/reactos/ntoskrnl/se/semgr.c
Modified: trunk/reactos/ntoskrnl/se/semgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/semgr.c?rev=28…
==============================================================================
--- trunk/reactos/ntoskrnl/se/semgr.c (original)
+++ trunk/reactos/ntoskrnl/se/semgr.c Sun Sep 9 16:21:22 2007
@@ -1035,7 +1035,8 @@
AccessMode))
{
CurrentAccess |= WRITE_OWNER;
- if (DesiredAccess == CurrentAccess)
+ if ((DesiredAccess & ~VALID_INHERIT_FLAGS) ==
+ (CurrentAccess & ~VALID_INHERIT_FLAGS))
{
if (SubjectContextLocked == FALSE)
{
@@ -1067,7 +1068,8 @@
if (Sid && SepSidInToken(Token, Sid))
{
CurrentAccess |= (READ_CONTROL | WRITE_DAC);
- if (DesiredAccess == CurrentAccess)
+ if ((DesiredAccess & ~VALID_INHERIT_FLAGS) ==
+ (CurrentAccess & ~VALID_INHERIT_FLAGS))
{
if (SubjectContextLocked == FALSE)
{
@@ -1145,7 +1147,8 @@
*AccessStatus = STATUS_SUCCESS;
return TRUE;
}
- else if (*GrantedAccess == DesiredAccess)
+ else if ((*GrantedAccess & ~VALID_INHERIT_FLAGS) ==
+ (DesiredAccess & ~VALID_INHERIT_FLAGS))
{
*AccessStatus = STATUS_SUCCESS;
return TRUE;