]> sourceware.org Git - newlib-cygwin.git/commitdiff
Fix invalid acl_entry_t on 32-bit Cygwin
authorDavid Allsopp <david.allsopp@metastack.com>
Thu, 9 Jul 2020 19:17:03 +0000 (20:17 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 10 Jul 2020 08:29:47 +0000 (10:29 +0200)
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>
winsup/cygwin/release/3.1.7 [new file with mode: 0644]
winsup/cygwin/sec_posixacl.h

diff --git a/winsup/cygwin/release/3.1.7 b/winsup/cygwin/release/3.1.7
new file mode 100644 (file)
index 0000000..6ce316f
--- /dev/null
@@ -0,0 +1,4 @@
+Bug Fixes:
+----------
+
+- Fix acl_get_* functions in 32-bit Cygwin (pointer sign extension)
index a3790a52b2fd0ba4795ae473039acd7a52492547..0f9e7bde3e6f9118ac32dd3ff3c6ea8acad1ff32 100644 (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)))
 
This page took 0.033908 seconds and 5 git commands to generate.