X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib%2Fsecurity_descriptor.h;h=0355fd2c2717b2d2969d7ee43f95f04e62a3b461;hb=90f1e04a2a143876a4413577b25db60b5ba0fe97;hp=524ec4a67a03301c75fc84b723a7c18a9ea2a72d;hpb=f7bfb336d6accbaf4e3cc2ac55617c67dd1a6098;p=wimlib diff --git a/include/wimlib/security_descriptor.h b/include/wimlib/security_descriptor.h index 524ec4a6..0355fd2c 100644 --- a/include/wimlib/security_descriptor.h +++ b/include/wimlib/security_descriptor.h @@ -1,8 +1,21 @@ /* - * security_descriptor.h + * security_descriptor.h - declarations for Windows security descriptor format * - * The author dedicates this file to the public domain. - * You can do whatever you want with this file. + * The following copying information applies to this specific source code file: + * + * Written in 2013-2015 by Eric Biggers + * + * To the extent possible under law, the author(s) have dedicated all copyright + * and related and neighboring rights to this software to the public domain + * worldwide via the Creative Commons Zero 1.0 Universal Public Domain + * Dedication (the "CC0"). + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the CC0 for more details. + * + * You should have received a copy of the CC0 along with this software; if not + * see . */ #ifndef _WIMLIB_SECURITY_DESCRIPTOR_H @@ -55,6 +68,41 @@ typedef struct { #define wimlib_SE_RM_CONTROL_VALID 0x4000 #define wimlib_SE_SELF_RELATIVE 0x8000 +/* Windows NT security identifier (user or group) */ +typedef struct { + + u8 revision; + u8 sub_authority_count; + + /* Identifies the authority that issued the SID */ + u8 identifier_authority[6]; + + le32 sub_authority[]; +} _packed_attribute wimlib_SID; + +/* Header of a Windows NT access control list */ +typedef struct { + /* ACL_REVISION or ACL_REVISION_DS */ + u8 revision; + + /* padding */ + u8 sbz1; + + /* Total size of the ACL, including all access control entries */ + le16 acl_size; + + /* Number of access control entry structures that follow the ACL + * structure */ + le16 ace_count; + + /* padding */ + le16 sbz2; +} _packed_attribute wimlib_ACL; + +#define wimlib_ACCESS_ALLOWED_ACE_TYPE 0 +#define wimlib_ACCESS_DENIED_ACE_TYPE 1 +#define wimlib_SYSTEM_AUDIT_ACE_TYPE 2 + /* Header of a Windows NT access control entry */ typedef struct { /* Type of ACE */ @@ -71,53 +119,21 @@ typedef struct { typedef struct { wimlib_ACE_HEADER hdr; le32 mask; - le32 sid_start; + wimlib_SID sid; } _packed_attribute wimlib_ACCESS_ALLOWED_ACE; /* Windows NT access control entry to deny rights to a user or group */ typedef struct { wimlib_ACE_HEADER hdr; le32 mask; - le32 sid_start; + wimlib_SID sid; } _packed_attribute wimlib_ACCESS_DENIED_ACE; /* Windows NT access control entry to audit access to the object */ typedef struct { wimlib_ACE_HEADER hdr; le32 mask; - le32 sid_start; + wimlib_SID sid; } _packed_attribute wimlib_SYSTEM_AUDIT_ACE; - -/* Header of a Windows NT access control list */ -typedef struct { - /* ACL_REVISION or ACL_REVISION_DS */ - u8 revision; - - /* padding */ - u8 sbz1; - - /* Total size of the ACL, including all access control entries */ - le16 acl_size; - - /* Number of access control entry structures that follow the ACL - * structure */ - le16 ace_count; - - /* padding */ - le16 sbz2; -} _packed_attribute wimlib_ACL; - -/* Windows NT security identifier (user or group) */ -typedef struct { - - u8 revision; - u8 sub_authority_count; - - /* Identifies the authority that issued the SID */ - u8 identifier_authority[6]; - - le32 sub_authority[]; -} _packed_attribute wimlib_SID; - -#endif +#endif /* _WIMLIB_SECURITY_DESCRIPTOR_H */