Fix invalid acl_entry_t on 32-bit Cygwin

If the acl_t struct was at or above 0x80000000 then the pointer was
sign-extended to 0xffff_ffff_8000_0000 and so the index was lost.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
This commit is contained in:
David Allsopp 2020-07-09 20:17:03 +01:00 committed by Corinna Vinschen
parent 462fcdb67f
commit acfc63b0cf
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Bug Fixes:
----------
- Fix acl_get_* functions in 32-bit Cygwin (pointer sign extension)

View File

@ -34,7 +34,7 @@ struct __acl_t
inline acl_entry_t
__to_entry (acl_t acl, uint16_t idx)
{
return ((uint64_t) idx << 48) | (uint64_t) acl;
return ((uint64_t) idx << 48) | (uint64_t) ((uintptr_t) acl);
}
#define __to_permset(a,i) ((acl_permset_t)__to_entry((a),(i)))