Bug 13176 - POSIX ACL support is broken on hpux and possibly other big-endian OSs
POSIX ACL support is broken on hpux and possibly other big-endian OSs
Status: ASSIGNED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules
4.7.3
IA64 HP-UX
: P5 major
: ---
Assigned To: Uri Simchoni
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-12-05 18:47 UTC by Uri Simchoni
Modified: 2017-12-07 07:58 UTC (History)
1 user (show)

See Also:


Attachments
proposed fix for master (3.91 KB, patch)
2017-12-05 19:10 UTC, Uri Simchoni
no flags Details
proposed fix for 4.5.x (3.91 KB, patch)
2017-12-05 19:10 UTC, Uri Simchoni
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uri Simchoni 2017-12-05 18:47:43 UTC
This was reported in https://lists.samba.org/archive/samba-technical/2016-November/117232.html , then in https://bugzilla.samba.org/show_bug.cgi?id=11490#c4 (but is not part of that original bug) and re-confirmed recently in https://lists.samba.org/archive/samba-technical/2017-November/124009.html

On big-endian systems, in which mode_t is defined to be a 16-bit value (BSD variants), POSIX ACL is broken, because it returns that all ACL entries have no permissions, preventing file access from any non-admin user.

Some pointer casting causes sys_acl_get_permset() function in SMBD code to return a pointer to a uint32_t field, which is later interpreted as a mode_t pointer. If mode_t is 16 bits and the system is little-endian, the code looks at the wrong bits.
Comment 1 Uri Simchoni 2017-12-05 18:48:21 UTC
On Linux mode_t is 32 bits.
Comment 2 Uri Simchoni 2017-12-05 19:10:19 UTC
Created attachment 13846 [details]
proposed fix for master
Comment 3 Uri Simchoni 2017-12-05 19:10:49 UTC
Created attachment 13847 [details]
proposed fix for 4.5.x