From ac804f0d7f5a93ff2710e213d9213ad9960a15d6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 7 Sep 2012 15:49:47 +1000 Subject: smbd-posix_acls: Use a IDL union to store the ACL entry This is a clearer, long-term-stable structure we can hash without risking it changing. Andrew Bartlett --- librpc/idl/smb_acl.idl | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'librpc') diff --git a/librpc/idl/smb_acl.idl b/librpc/idl/smb_acl.idl index 7f672996b0..2904c3afa4 100644 --- a/librpc/idl/smb_acl.idl +++ b/librpc/idl/smb_acl.idl @@ -40,18 +40,34 @@ interface smb_acl SMB_ACL_OTHER = 5, SMB_ACL_MASK = 6 } smb_acl_tag_t; - + typedef struct { - smb_acl_tag_t a_type; - mode_t a_perm; uid_t uid; + } smb_acl_user; + + typedef struct { gid_t gid; + } smb_acl_group; + + typedef [switch_type(uint16)] union { + [case (SMB_ACL_USER)] smb_acl_user user; + [case (SMB_ACL_USER_OBJ)]; + [case (SMB_ACL_GROUP)] smb_acl_group group; + [case (SMB_ACL_GROUP_OBJ)]; + [case (SMB_ACL_OTHER)]; + [case (SMB_ACL_MASK)]; + } smb_acl_entry_info; + + typedef struct { + smb_acl_tag_t a_type; + [switch_is(a_type)] smb_acl_entry_info info; + mode_t a_perm; } smb_acl_entry; [public] typedef struct { - int size; + [value(0)] int size; int count; - int next; + [value(0)] int next; [size_is(count)] smb_acl_entry acl[*]; } smb_acl_t; -- cgit