Cygwin: don't return valid acl entry type for unknown SID
cygpsid::get_id neglects to set the type to 0 (ACL_UNDEFINED_TAG in POSIX speak) if the SID can not be translated into a valid uid or gid. This in turn leads to incorrect handling of uid/gid -1 entries. Fix this by setting type to 0 if the id is unknown. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
6706b19a97
commit
fcfcc288c4
|
@ -169,10 +169,16 @@ cygpsid::get_id (BOOL search_grp, int *type, cyg_ldap *pldap)
|
|||
}
|
||||
else if ((pw = internal_getpwsid (*this, pldap)))
|
||||
id = pw->pw_uid;
|
||||
if (id != ILLEGAL_UID && type)
|
||||
*type = USER;
|
||||
if (id != ILLEGAL_UID)
|
||||
{
|
||||
if (type)
|
||||
*type = USER;
|
||||
return id;
|
||||
}
|
||||
}
|
||||
return id;
|
||||
if (type)
|
||||
*type = 0; /* undefined type */
|
||||
return ILLEGAL_UID;
|
||||
}
|
||||
|
||||
PWCHAR
|
||||
|
|
Loading…
Reference in New Issue