#include <sys/kauth.h>
sys/kauth.h
NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
support for mandatory and extensible security protections. This notice
is included in support of clause 2.2 (b) of the Apple Public License,
Version 2.0.
structntsid_t
| u_int8_t | sid_kind | |
| u_int8_t | sid_authcount | |
| u_int8_t[6] | sid_authority | |
| u_int32_t[16] | sid_authorities |
typedefntsid_t
typedef struct ntsid_t ntsid_t;
macroKAUTH_NTSID_MAX_AUTHORITIES
#define KAUTH_NTSID_MAX_AUTHORITIES 16
macro_NTSID_T
#define _NTSID_T
macroKAUTH_NTSID_SIZE
#define KAUTH_NTSID_SIZE(_s) (KAUTH_NTSID_HDRSIZE + ((_s)->sid_authcount * sizeof(u_int32_t)))
structkauth_identity_extlookup
External lookup message payload; this structure is shared between the
kernel group membership resolver, and the user space group membership
resolver daemon, and is use to communicate resolution requests from the
kernel to user space, and the result of that request from user space to
the kernel.
| u_int32_t | el_seqno | request sequence number |
| u_int32_t | el_result | lookup result |
| u_int32_t | el_flags | |
| __darwin_pid_t | el_info_pid | request on behalf of PID |
| u_int64_t | el_extend | extension field |
| u_int32_t | el_info_reserved_1 | reserved (APPLE) |
| uid_t | el_uid | user ID |
| guid_t | el_uguid | user GUID |
| u_int32_t | el_uguid_valid | TTL on translation result (seconds) |
| ntsid_t | el_usid | user NT SID |
| u_int32_t | el_usid_valid | TTL on translation result (seconds) |
| gid_t | el_gid | group ID |
| guid_t | el_gguid | group GUID |
| u_int32_t | el_gguid_valid | TTL on translation result (seconds) |
| ntsid_t | el_gsid | group SID |
| u_int32_t | el_gsid_valid | TTL on translation result (seconds) |
| u_int32_t | el_member_valid | TTL on group lookup result |
| u_int32_t | el_sup_grp_cnt | count of supplemental groups up to NGROUPS |
| gid_t[16] | el_sup_groups | supplemental group list |
macroKAUTH_EXTLOOKUP_VALID_UID
#define KAUTH_EXTLOOKUP_VALID_UID (1<<0)
macroKAUTH_EXTLOOKUP_VALID_UGUID
#define KAUTH_EXTLOOKUP_VALID_UGUID (1<<1)
macroKAUTH_EXTLOOKUP_VALID_USID
#define KAUTH_EXTLOOKUP_VALID_USID (1<<2)
macroKAUTH_EXTLOOKUP_VALID_GID
#define KAUTH_EXTLOOKUP_VALID_GID (1<<3)
macroKAUTH_EXTLOOKUP_VALID_GGUID
#define KAUTH_EXTLOOKUP_VALID_GGUID (1<<4)
macroKAUTH_EXTLOOKUP_VALID_GSID
#define KAUTH_EXTLOOKUP_VALID_GSID (1<<5)
macroKAUTH_EXTLOOKUP_WANT_UID
#define KAUTH_EXTLOOKUP_WANT_UID (1<<6)
macroKAUTH_EXTLOOKUP_WANT_UGUID
#define KAUTH_EXTLOOKUP_WANT_UGUID (1<<7)
macroKAUTH_EXTLOOKUP_WANT_USID
#define KAUTH_EXTLOOKUP_WANT_USID (1<<8)
macroKAUTH_EXTLOOKUP_WANT_GID
#define KAUTH_EXTLOOKUP_WANT_GID (1<<9)
macroKAUTH_EXTLOOKUP_WANT_GGUID
#define KAUTH_EXTLOOKUP_WANT_GGUID (1<<10)
macroKAUTH_EXTLOOKUP_WANT_GSID
#define KAUTH_EXTLOOKUP_WANT_GSID (1<<11)
macroKAUTH_EXTLOOKUP_WANT_MEMBERSHIP
#define KAUTH_EXTLOOKUP_WANT_MEMBERSHIP (1<<12)
macroKAUTH_EXTLOOKUP_VALID_MEMBERSHIP
#define KAUTH_EXTLOOKUP_VALID_MEMBERSHIP (1<<13)
macroKAUTH_EXTLOOKUP_ISMEMBER
#define KAUTH_EXTLOOKUP_ISMEMBER (1<<14)
macroKAUTH_EXTLOOKUP_VALID_PWNAM
#define KAUTH_EXTLOOKUP_VALID_PWNAM (1<<15)
macroKAUTH_EXTLOOKUP_WANT_PWNAM
#define KAUTH_EXTLOOKUP_WANT_PWNAM (1<<16)
macroKAUTH_EXTLOOKUP_VALID_GRNAM
#define KAUTH_EXTLOOKUP_VALID_GRNAM (1<<17)
macroKAUTH_EXTLOOKUP_WANT_GRNAM
#define KAUTH_EXTLOOKUP_WANT_GRNAM (1<<18)
macroKAUTH_EXTLOOKUP_VALID_SUPGRPS
#define KAUTH_EXTLOOKUP_VALID_SUPGRPS (1<<19)
macroKAUTH_EXTLOOKUP_WANT_SUPGRPS
#define KAUTH_EXTLOOKUP_WANT_SUPGRPS (1<<20)
structkauth_cache_sizes
| u_int32_t | kcs_group_size | |
| u_int32_t | kcs_id_size |
macroKAUTH_EXTLOOKUP_REGISTER
#define KAUTH_EXTLOOKUP_REGISTER (0)
macroKAUTH_EXTLOOKUP_RESULT
#define KAUTH_EXTLOOKUP_RESULT (1<<0)
macroKAUTH_EXTLOOKUP_WORKER
#define KAUTH_EXTLOOKUP_WORKER (1<<1)
macroKAUTH_EXTLOOKUP_DEREGISTER
#define KAUTH_EXTLOOKUP_DEREGISTER (1<<2)
macroKAUTH_GET_CACHE_SIZES
#define KAUTH_GET_CACHE_SIZES (1<<3)
macroKAUTH_SET_CACHE_SIZES
#define KAUTH_SET_CACHE_SIZES (1<<4)
macroKAUTH_CLEAR_CACHES
#define KAUTH_CLEAR_CACHES (1<<5)
macroIDENTITYSVC_ENTITLEMENT
#define IDENTITYSVC_ENTITLEMENT "com.apple.private.identitysvc"
typedefkauth_ace_rights_t
typedef u_int32_t kauth_ace_rights_t
structkauth_ace
Access Control List Entry (ACE)
| guid_t | ace_applicable | |
| u_int32_t | ace_flags | |
| kauth_ace_rights_t | ace_rights | scope specific |
macroKAUTH_ACE_KINDMASK
#define KAUTH_ACE_KINDMASK 0xf
macroKAUTH_ACE_PERMIT
#define KAUTH_ACE_PERMIT 1
macroKAUTH_ACE_DENY
#define KAUTH_ACE_DENY 2
macroKAUTH_ACE_INHERITED
#define KAUTH_ACE_INHERITED (1<<4)
macroKAUTH_ACE_FILE_INHERIT
#define KAUTH_ACE_FILE_INHERIT (1<<5)
macroKAUTH_ACE_DIRECTORY_INHERIT
#define KAUTH_ACE_DIRECTORY_INHERIT (1<<6)
macroKAUTH_ACE_LIMIT_INHERIT
#define KAUTH_ACE_LIMIT_INHERIT (1<<7)
macroKAUTH_ACE_ONLY_INHERIT
#define KAUTH_ACE_ONLY_INHERIT (1<<8)
macroKAUTH_ACE_INHERIT_CONTROL_FLAGS
All flag bits controlling ACE inheritance
#define KAUTH_ACE_INHERIT_CONTROL_FLAGS (KAUTH_ACE_FILE_INHERIT | KAUTH_ACE_DIRECTORY_INHERIT | KAUTH_ACE_LIMIT_INHERIT | KAUTH_ACE_ONLY_INHERIT)
macroKAUTH_ACE_GENERIC_ALL
These rights are never tested, but may be present in an ACL
#define KAUTH_ACE_GENERIC_ALL (1<<21)
macroKAUTH_ACE_GENERIC_EXECUTE
#define KAUTH_ACE_GENERIC_EXECUTE (1<<22)
macroKAUTH_ACE_GENERIC_WRITE
#define KAUTH_ACE_GENERIC_WRITE (1<<23)
macroKAUTH_ACE_GENERIC_READ
#define KAUTH_ACE_GENERIC_READ (1<<24)
macro_KAUTH_ACE
#define _KAUTH_ACE
typedefkauth_ace_t
typedef struct kauth_ace *kauth_ace_t
structkauth_acl
Access Control List
| u_int32_t | acl_entrycount | |
| u_int32_t | acl_flags | |
| struct kauth_ace[1] | acl_ace |
macroKAUTH_ACL_MAX_ENTRIES
XXX this value needs to be raised - 3893388
#define KAUTH_ACL_MAX_ENTRIES 128
macroKAUTH_ACL_FLAGS_PRIVATE
The low 16 bits of the flags field are reserved for filesystem
internal use and must be preserved by all APIs. This includes
round-tripping flags through user-space interfaces.
#define KAUTH_ACL_FLAGS_PRIVATE (0xffff)
macroKAUTH_ACL_DEFER_INHERIT
inheritance will be deferred until the first rename operation
#define KAUTH_ACL_DEFER_INHERIT (1<<16)
macroKAUTH_ACL_NO_INHERIT
this ACL must not be overwritten as part of an inheritance operation
#define KAUTH_ACL_NO_INHERIT (1<<17)
macroKAUTH_FILESEC_NOACL
acl_entrycount that tells us the ACL is not valid
#define KAUTH_FILESEC_NOACL ((u_int32_t)(-1))
macroKAUTH_ACL_SIZE
If the acl_entrycount field is KAUTH_FILESEC_NOACL, then the size is the
same as a kauth_acl structure; the intent is to put an actual entrycount of
KAUTH_FILESEC_NOACL on disk to distinguish a kauth_filesec_t with an empty
entry (Windows treats this as "deny all") from one that merely indicates a
file group and/or owner guid values.
#define KAUTH_ACL_SIZE(c) (__offsetof(struct kauth_acl, acl_ace) + ((u_int32_t)(c) != KAUTH_FILESEC_NOACL ? ((c) * sizeof(struct kauth_ace)) : 0))
macroKAUTH_ACL_COPYSIZE
#define KAUTH_ACL_COPYSIZE(p) KAUTH_ACL_SIZE((p)->acl_entrycount)
macro_KAUTH_ACL
#define _KAUTH_ACL
typedefkauth_acl_t
typedef struct kauth_acl *kauth_acl_t
structkauth_filesec
File Security information
| u_int32_t | fsec_magic | |
| guid_t | fsec_owner | |
| guid_t | fsec_group | |
| struct kauth_acl | fsec_acl |
macroKAUTH_FILESEC_MAGIC
#define KAUTH_FILESEC_MAGIC 0x012cc16d
macrofsec_flags
#define fsec_flags fsec_acl.acl_flags
macrofsec_ace
#define fsec_ace fsec_acl.acl_ace
macroKAUTH_FILESEC_FLAGS_PRIVATE
#define KAUTH_FILESEC_FLAGS_PRIVATE KAUTH_ACL_FLAGS_PRIVATE
macroKAUTH_FILESEC_DEFER_INHERIT
#define KAUTH_FILESEC_DEFER_INHERIT KAUTH_ACL_DEFER_INHERIT
macroKAUTH_FILESEC_NO_INHERIT
#define KAUTH_FILESEC_NO_INHERIT KAUTH_ACL_NO_INHERIT
macroKAUTH_FILESEC_NONE
#define KAUTH_FILESEC_NONE ((kauth_filesec_t)0)
macroKAUTH_FILESEC_WANTED
#define KAUTH_FILESEC_WANTED ((kauth_filesec_t)1)
macro_KAUTH_FILESEC
#define _KAUTH_FILESEC
typedefkauth_filesec_t
typedef struct kauth_filesec *kauth_filesec_t
macroKAUTH_FILESEC_SIZE
#define KAUTH_FILESEC_SIZE(c) (__offsetof(struct kauth_filesec, fsec_acl) + __offsetof(struct kauth_acl, acl_ace) + (c) * sizeof(struct kauth_ace))
macroKAUTH_FILESEC_COPYSIZE
#define KAUTH_FILESEC_COPYSIZE(p) KAUTH_FILESEC_SIZE(((p)->fsec_entrycount == KAUTH_FILESEC_NOACL) ? 0 : (p)->fsec_entrycount)
macroKAUTH_FILESEC_COUNT
#define KAUTH_FILESEC_COUNT(s) (((s) - KAUTH_FILESEC_SIZE(0)) / sizeof(struct kauth_ace))
macroKAUTH_FILESEC_VALID
#define KAUTH_FILESEC_VALID(s) ((s) >= KAUTH_FILESEC_SIZE(0) && (((s) - KAUTH_FILESEC_SIZE(0)) % sizeof(struct kauth_ace)) == 0)
macroKAUTH_FILESEC_XATTR
#define KAUTH_FILESEC_XATTR "com.apple.system.Security"
macroKAUTH_ENDIAN_HOST
Allowable first arguments to kauth_filesec_acl_setendian()
#define KAUTH_ENDIAN_HOST 0x00000001
set host endianness
macroKAUTH_VNODE_READ_DATA
#define KAUTH_VNODE_READ_DATA (1U<<1)
macroKAUTH_VNODE_LIST_DIRECTORY
#define KAUTH_VNODE_LIST_DIRECTORY KAUTH_VNODE_READ_DATA
macroKAUTH_VNODE_WRITE_DATA
#define KAUTH_VNODE_WRITE_DATA (1U<<2)
macroKAUTH_VNODE_ADD_FILE
#define KAUTH_VNODE_ADD_FILE KAUTH_VNODE_WRITE_DATA
macroKAUTH_VNODE_EXECUTE
#define KAUTH_VNODE_EXECUTE (1U<<3)
macroKAUTH_VNODE_SEARCH
#define KAUTH_VNODE_SEARCH KAUTH_VNODE_EXECUTE
macroKAUTH_VNODE_DELETE
#define KAUTH_VNODE_DELETE (1U<<4)
macroKAUTH_VNODE_APPEND_DATA
#define KAUTH_VNODE_APPEND_DATA (1U<<5)
macroKAUTH_VNODE_ADD_SUBDIRECTORY
#define KAUTH_VNODE_ADD_SUBDIRECTORY KAUTH_VNODE_APPEND_DATA
macroKAUTH_VNODE_DELETE_CHILD
#define KAUTH_VNODE_DELETE_CHILD (1U<<6)
macroKAUTH_VNODE_READ_ATTRIBUTES
#define KAUTH_VNODE_READ_ATTRIBUTES (1U<<7)
macroKAUTH_VNODE_WRITE_ATTRIBUTES
#define KAUTH_VNODE_WRITE_ATTRIBUTES (1U<<8)
macroKAUTH_VNODE_READ_EXTATTRIBUTES
#define KAUTH_VNODE_READ_EXTATTRIBUTES (1U<<9)
macroKAUTH_VNODE_WRITE_EXTATTRIBUTES
#define KAUTH_VNODE_WRITE_EXTATTRIBUTES (1U<<10)
macroKAUTH_VNODE_READ_SECURITY
#define KAUTH_VNODE_READ_SECURITY (1U<<11)
macroKAUTH_VNODE_WRITE_SECURITY
#define KAUTH_VNODE_WRITE_SECURITY (1U<<12)
macroKAUTH_VNODE_TAKE_OWNERSHIP
#define KAUTH_VNODE_TAKE_OWNERSHIP (1U<<13)
macroKAUTH_VNODE_CHANGE_OWNER
backwards compatibility only
#define KAUTH_VNODE_CHANGE_OWNER KAUTH_VNODE_TAKE_OWNERSHIP
macroKAUTH_VNODE_SYNCHRONIZE
For Windows interoperability only
#define KAUTH_VNODE_SYNCHRONIZE (1U<<20)
macroKAUTH_VNODE_LINKTARGET
Actions not expressed as rights bits
Authorizes the vnode as the target of a hard link.
#define KAUTH_VNODE_LINKTARGET (1U<<25)
macroKAUTH_VNODE_CHECKIMMUTABLE
Indicates that other steps have been taken to authorise the action,
but authorisation should be denied for immutable objects.
#define KAUTH_VNODE_CHECKIMMUTABLE (1U<<26)
macroKAUTH_VNODE_ACCESS
Action modifiers
The KAUTH_VNODE_ACCESS bit is passed to the callback if the authorisation
request in progress is advisory, rather than authoritative. Listeners
performing consequential work (i.e. not strictly checking authorisation)
may test this flag to avoid performing unnecessary work.
This bit will never be present in an ACE.
#define KAUTH_VNODE_ACCESS (1U<<31)
macroKAUTH_VNODE_NOIMMUTABLE
The KAUTH_VNODE_NOIMMUTABLE bit is passed to the callback along with the
KAUTH_VNODE_WRITE_SECURITY bit (and no others) to indicate that the
caller wishes to change one or more of the immutable flags, and the
state of these flags should not be considered when authorizing the request.
The system immutable flags are only ignored when the system securelevel
is low enough to allow their removal.
#define KAUTH_VNODE_NOIMMUTABLE (1U<<30)
macroKAUTH_VNODE_SEARCHBYANYONE
fake right that is composed by the following...
vnode must have search for owner, group and world allowed
plus there must be no deny modes present for SEARCH... this fake
right is used by the fast lookup path to avoid checking
for an exact match on the last credential to lookup
the component being acted on
#define KAUTH_VNODE_SEARCHBYANYONE (1U<<29)
macroKAUTH_INVALIDATE_CACHED_RIGHTS
when passed as an 'action' to "vnode_uncache_authorized_actions"
it indicates that all of the cached authorizations for that
vnode should be invalidated
#define KAUTH_INVALIDATE_CACHED_RIGHTS ((kauth_action_t)~0)
macroKAUTH_VNODE_GENERIC_READ_BITS
The expansions of the GENERIC bits at evaluation time
#define KAUTH_VNODE_GENERIC_READ_BITS (KAUTH_VNODE_READ_DATA | KAUTH_VNODE_READ_ATTRIBUTES | KAUTH_VNODE_READ_EXTATTRIBUTES | KAUTH_VNODE_READ_SECURITY)
macroKAUTH_VNODE_GENERIC_WRITE_BITS
#define KAUTH_VNODE_GENERIC_WRITE_BITS (KAUTH_VNODE_WRITE_DATA | KAUTH_VNODE_APPEND_DATA | KAUTH_VNODE_DELETE | KAUTH_VNODE_DELETE_CHILD | KAUTH_VNODE_WRITE_ATTRIBUTES | KAUTH_VNODE_WRITE_EXTATTRIBUTES | KAUTH_VNODE_WRITE_SECURITY)
macroKAUTH_VNODE_GENERIC_EXECUTE_BITS
#define KAUTH_VNODE_GENERIC_EXECUTE_BITS (KAUTH_VNODE_EXECUTE)
macroKAUTH_VNODE_GENERIC_ALL_BITS
#define KAUTH_VNODE_GENERIC_ALL_BITS (KAUTH_VNODE_GENERIC_READ_BITS | KAUTH_VNODE_GENERIC_WRITE_BITS | KAUTH_VNODE_GENERIC_EXECUTE_BITS)
macroKAUTH_VNODE_WRITE_RIGHTS
Some sets of bits, defined here for convenience.
#define KAUTH_VNODE_WRITE_RIGHTS (KAUTH_VNODE_ADD_FILE | KAUTH_VNODE_ADD_SUBDIRECTORY | KAUTH_VNODE_DELETE_CHILD | KAUTH_VNODE_WRITE_DATA | KAUTH_VNODE_APPEND_DATA | KAUTH_VNODE_DELETE | KAUTH_VNODE_WRITE_ATTRIBUTES | KAUTH_VNODE_WRITE_EXTATTRIBUTES | KAUTH_VNODE_WRITE_SECURITY | KAUTH_VNODE_TAKE_OWNERSHIP | KAUTH_VNODE_LINKTARGET | KAUTH_VNODE_CHECKIMMUTABLE)