mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fix bug in RtlpAddKnownAce() that caused it to place the SID in the wrong location.
Teach RtlpAddKnownAce() some status values other than STATUS_UNSUCCESSFUL. (Patch by Joseph Galbraith) svn path=/trunk/; revision=3089
This commit is contained in:
parent
b6b3e3f14e
commit
fd874ecc14
2 changed files with 64 additions and 64 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: acl.c,v 1.4 2002/06/07 22:59:19 ekohl Exp $
|
||||
/* $Id: acl.c,v 1.5 2002/06/15 10:08:46 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -105,12 +105,12 @@ RtlpAddKnownAce(PACL Acl,
|
|||
|
||||
if (!RtlValidSid(Sid))
|
||||
{
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
return(STATUS_INVALID_SID);
|
||||
}
|
||||
if (Acl->AclRevision > 3 ||
|
||||
Revision > 3)
|
||||
{
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
return(STATUS_UNKNOWN_REVISION);
|
||||
}
|
||||
if (Revision < Acl->AclRevision)
|
||||
{
|
||||
|
@ -118,7 +118,7 @@ RtlpAddKnownAce(PACL Acl,
|
|||
}
|
||||
if (!RtlFirstFreeAce(Acl, &Ace))
|
||||
{
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
return(STATUS_BUFFER_TOO_SMALL);
|
||||
}
|
||||
if (Ace == NULL)
|
||||
{
|
||||
|
@ -127,13 +127,13 @@ RtlpAddKnownAce(PACL Acl,
|
|||
if (((PVOID)Ace + RtlLengthSid(Sid) + sizeof(ACE)) >=
|
||||
((PVOID)Acl + Acl->AclSize))
|
||||
{
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
return(STATUS_BUFFER_TOO_SMALL);
|
||||
}
|
||||
Ace->Header.AceFlags = 0;
|
||||
Ace->Header.AceType = Type;
|
||||
Ace->Header.AceSize = RtlLengthSid(Sid) + sizeof(ACE);
|
||||
Ace->Header.AccessMask = AccessMask;
|
||||
RtlCopySid(RtlLengthSid(Sid), (PSID)Ace + 1, Sid);
|
||||
RtlCopySid(RtlLengthSid(Sid), (PSID)(Ace + 1), Sid);
|
||||
Acl->AceCount++;
|
||||
Acl->AclRevision = Revision;
|
||||
return(STATUS_SUCCESS);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: acl.c,v 1.6 2002/06/07 22:59:42 ekohl Exp $
|
||||
/* $Id: acl.c,v 1.7 2002/06/15 10:09:17 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -183,12 +183,12 @@ RtlpAddKnownAce(PACL Acl,
|
|||
|
||||
if (!RtlValidSid(Sid))
|
||||
{
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
return(STATUS_INVALID_SID);
|
||||
}
|
||||
if (Acl->AclRevision > 3 ||
|
||||
Revision > 3)
|
||||
{
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
return(STATUS_UNKNOWN_REVISION);
|
||||
}
|
||||
if (Revision < Acl->AclRevision)
|
||||
{
|
||||
|
@ -196,7 +196,7 @@ RtlpAddKnownAce(PACL Acl,
|
|||
}
|
||||
if (!RtlFirstFreeAce(Acl, &Ace))
|
||||
{
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
return(STATUS_BUFFER_TOO_SMALL);
|
||||
}
|
||||
if (Ace == NULL)
|
||||
{
|
||||
|
@ -205,13 +205,13 @@ RtlpAddKnownAce(PACL Acl,
|
|||
if (((PVOID)Ace + RtlLengthSid(Sid) + sizeof(ACE)) >=
|
||||
((PVOID)Acl + Acl->AclSize))
|
||||
{
|
||||
return(STATUS_UNSUCCESSFUL);
|
||||
return(STATUS_BUFFER_TOO_SMALL);
|
||||
}
|
||||
Ace->Header.AceFlags = 0;
|
||||
Ace->Header.AceType = Type;
|
||||
Ace->Header.AceSize = RtlLengthSid(Sid) + sizeof(ACE);
|
||||
Ace->Header.AccessMask = AccessMask;
|
||||
RtlCopySid(RtlLengthSid(Sid), (PSID)Ace + 1, Sid);
|
||||
RtlCopySid(RtlLengthSid(Sid), (PSID)(Ace + 1), Sid);
|
||||
Acl->AceCount++;
|
||||
Acl->AclRevision = Revision;
|
||||
return(STATUS_SUCCESS);
|
||||
|
|
Loading…
Reference in a new issue