Don't check inherit flags when checking access.

svn path=/trunk/; revision=28735
This commit is contained in:
Art Yerkes 2007-09-01 10:04:15 +00:00
parent 5498466cc2
commit 6b8a1ee32c

View file

@ -565,8 +565,11 @@ ObReferenceObjectByHandle(IN HANDLE Handle,
{
/* Get the granted access and validate it */
GrantedAccess = HandleEntry->GrantedAccess;
/* Inherit flags are not a kind of access right, they indicate
* the disposition of access rights. Therefore, they should not
* be considered. */
if ((AccessMode == KernelMode) ||
!(~GrantedAccess & DesiredAccess))
!((~GrantedAccess & DesiredAccess & ~VALID_INHERIT_FLAGS)))
{
/* Reference the object directly since we have its header */
InterlockedIncrement(&ObjectHeader->PointerCount);
@ -596,6 +599,7 @@ ObReferenceObjectByHandle(IN HANDLE Handle,
else
{
/* Requested access failed */
DPRINT("Rights not granted: %x\n", ~GrantedAccess & DesiredAccess);
Status = STATUS_ACCESS_DENIED;
}
}