2 * Copyright (c) 2004 Apple Computer, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
14 * its contributors may be used to endorse or promote products derived
15 * from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
29 * $P4: //depot/projects/trustedbsd/openbsm/bsm/libbsm.h#21 $
36 * NB: definitions, etc., marked with "OpenSSH compatibility" were introduced
37 * solely to allow OpenSSH to compile; Darwin/Apple code should not use them.
43 #include <sys/types.h>
44 #include <sys/cdefs.h>
46 #include <inttypes.h> /* Required for audit.h. */
47 #include <time.h> /* Required for clock_t on Linux. */
49 #include <bsm/audit.h>
50 #include <bsm/audit_record.h>
55 #include <mach/mach.h> /* audit_token_t */
58 #define AU_PRS_SUCCESS 1
59 #define AU_PRS_FAILURE 2
60 #define AU_PRS_BOTH (AU_PRS_SUCCESS|AU_PRS_FAILURE)
62 #define AU_PRS_USECACHE 0
63 #define AU_PRS_REREAD 1
65 #define AUDIT_EVENT_FILE "/etc/security/audit_event"
66 #define AUDIT_CLASS_FILE "/etc/security/audit_class"
67 #define AUDIT_CONTROL_FILE "/etc/security/audit_control"
68 #define AUDIT_USER_FILE "/etc/security/audit_user"
70 #define DIR_CONTROL_ENTRY "dir"
71 #define MINFREE_CONTROL_ENTRY "minfree"
72 #define FLAGS_CONTROL_ENTRY "flags"
73 #define NA_CONTROL_ENTRY "naflags"
75 #define AU_CLASS_NAME_MAX 8
76 #define AU_CLASS_DESC_MAX 72
77 #define AU_EVENT_NAME_MAX 30
78 #define AU_EVENT_DESC_MAX 50
79 #define AU_USER_NAME_MAX 50
80 #define AU_LINE_MAX 256
81 #define MAX_AUDITSTRING_LEN 256
82 #define BSM_TEXTBUFSZ MAX_AUDITSTRING_LEN /* OpenSSH compatibility */
85 * These are referenced in Solaris 9 au_open(3BSM); values are guesses.
86 * Provided for OpenSSH compatibility.
88 #define AU_TO_NO_WRITE 0
98 typedef struct au_event_ent au_event_ent_t;
100 struct au_class_ent {
105 typedef struct au_class_ent au_class_ent_t;
112 typedef struct au_user_ent au_user_ent_t;
115 #define ADD_TO_MASK(m, c, sel) do { \
116 if (sel & AU_PRS_SUCCESS) \
117 (m)->am_success |= c; \
118 if (sel & AU_PRS_FAILURE) \
119 (m)->am_failure |= c; \
122 #define SUB_FROM_MASK(m, c, sel) do { \
123 if (sel & AU_PRS_SUCCESS) \
124 (m)->am_success &= ((m)->am_success ^ c); \
125 if (sel & AU_PRS_FAILURE) \
126 (m)->am_failure &= ((m)->am_failure ^ c); \
129 #define ADDMASK(m, v) do { \
130 (m)->am_success |= (v)->am_success; \
131 (m)->am_failure |= (v)->am_failure; \
134 #define SUBMASK(m, v) do { \
135 (m)->am_success &= ((m)->am_success ^ (v)->am_success); \
136 (m)->am_failure &= ((m)->am_failure ^ (v)->am_failure); \
142 * Internal representation of audit user in libnsl.
144 typedef struct au_user_str_s {
150 typedef struct au_tid32 {
155 typedef struct au_tid64 {
160 typedef struct au_tidaddr32 {
168 * argument value 4 bytes/8 bytes (32-bit/64-bit value)
169 * text length 2 bytes
170 * text N bytes + 1 terminating NULL byte
187 * how to print 1 byte
190 * data items (depends on basic unit)
200 * file access mode 4 bytes
201 * owner user ID 4 bytes
202 * owner group ID 4 bytes
203 * file system ID 4 bytes
205 * device 4 bytes/8 bytes (32-bit/64-bit)
227 * text count null-terminated string(s)
231 char *text[MAX_ARGS];
236 * text count null-terminated string(s)
245 * return value 4 bytes
253 * seconds of time 4 bytes
254 * milliseconds of time 4 bytes
255 * file name length 2 bytes
256 * file pathname N bytes + 1 terminating NULL byte
267 * number groups 2 bytes
268 * group list N * 4 bytes
272 u_int32_t list[BSM_MAX_GROUPS];
276 * record byte count 4 bytes
277 * version # 1 byte [2]
279 * event modifier 2 bytes
280 * seconds of time 4 bytes/8 bytes (32-bit/64-bit value)
281 * milliseconds of time 4 bytes/8 bytes (32-bit/64-bit value)
293 * record byte count 4 bytes
294 * version # 1 byte [2]
296 * event modifier 2 bytes
297 * address type/length 1 byte (XXX: actually, 4 bytes)
298 * machine address 4 bytes/16 bytes (IPv4/IPv6 address)
299 * seconds of time 4 bytes/8 bytes (32/64-bits)
300 * nanoseconds of time 4 bytes/8 bytes (32/64-bits)
334 * internet address 4 bytes
342 * internet address 16 bytes
350 * version and ihl 1 byte
351 * type of service 1 byte
358 * source address 4 bytes
359 * destination address 4 bytes
375 * object ID type 1 byte
384 * owner user ID 4 bytes
385 * owner group ID 4 bytes
386 * creator user ID 4 bytes
387 * creator group ID 4 bytes
388 * access mode 4 bytes
389 * slot sequence # 4 bytes
403 * port IP address 2 bytes
419 * path length 2 bytes
420 * path N bytes + 1 terminating NULL byte
429 * effective user ID 4 bytes
430 * effective group ID 4 bytes
431 * real user ID 4 bytes
432 * real group ID 4 bytes
436 * port ID 4 bytes/8 bytes (32-bit/64-bit value)
437 * machine address 4 bytes
463 * effective user ID 4 bytes
464 * effective group ID 4 bytes
465 * real user ID 4 bytes
466 * real group ID 4 bytes
470 * port ID 4 bytes/8 bytes (32-bit/64-bit value)
472 * machine address 16 bytes
486 * error status 1 byte
487 * return value 4 bytes/8 bytes (32-bit/64-bit value)
500 * sequence number 4 bytes
507 * socket type 2 bytes
509 * local Internet address 4 bytes
510 * remote port 2 bytes
511 * remote Internet address 4 bytes
522 * socket type 2 bytes
524 * address type/length 4 bytes
525 * local Internet address 4 bytes/16 bytes (IPv4/IPv6 address)
526 * remote port 4 bytes
527 * address type/length 4 bytes
528 * remote Internet address 4 bytes/16 bytes (IPv4/IPv6 address)
541 * socket family 2 bytes
543 * socket address 4 bytes/16 bytes (IPv4/IPv6 address)
552 * socket family 2 bytes
562 * effective user ID 4 bytes
563 * effective group ID 4 bytes
564 * real user ID 4 bytes
565 * real group ID 4 bytes
569 * port ID 4 bytes/8 bytes (32-bit/64-bit value)
570 * machine address 4 bytes
596 * effective user ID 4 bytes
597 * effective group ID 4 bytes
598 * real user ID 4 bytes
599 * real group ID 4 bytes
603 * port ID 4 bytes/8 bytes (32-bit/64-bit value)
605 * machine address 16 bytes
619 * text length 2 bytes
620 * text N bytes + 1 terminating NULL byte
641 * trailer magic number 2 bytes
642 * record byte count 4 bytes
659 au_execarg_t execarg;
660 au_execenv_t execenv;
665 au_header32_ex_t hdr32_ex;
667 au_header64_ex_t hdr64_ex;
669 au_inaddr_ex_t inaddr_ex;
672 au_ipcperm_t ipcperm;
678 au_proc32ex_t proc32_ex;
683 au_socket_ex32_t socket_ex32;
684 au_socketinet32_t sockinet32;
685 au_socketunix_t sockunix;
686 au_subject32_t subj32;
687 au_subject64_t subj64;
688 au_subject32ex_t subj32_ex;
691 au_invalid_t invalid;
693 } tt; /* The token is one of the above types */
696 typedef struct tokenstr tokenstr_t;
698 int audit_submit(short au_event, au_id_t auid,
699 char status, int reterr, const char *fmt, ...);
702 * Functions relating to querying audit class information.
704 void setauclass(void);
705 void endauclass(void);
706 struct au_class_ent *getauclassent(void);
707 struct au_class_ent *getauclassent_r(au_class_ent_t *class_int);
708 struct au_class_ent *getauclassnam(const char *name);
709 struct au_class_ent *getauclassnam_r(au_class_ent_t *class_int,
711 struct au_class_ent *getauclassnum(au_class_t class_number);
712 struct au_class_ent *getauclassnum_r(au_class_ent_t *class_int,
713 au_class_t class_number);
716 * Functions relating to querying audit control information.
720 int getacdir(char *name, int len);
721 int getacmin(int *min_val);
722 int getacflg(char *auditstr, int len);
723 int getacna(char *auditstr, int len);
724 int getauditflagsbin(char *auditstr, au_mask_t *masks);
725 int getauditflagschar(char *auditstr, au_mask_t *masks,
727 int au_preselect(au_event_t event, au_mask_t *mask_p,
731 * Functions relating to querying audit event information.
733 * XXXRW: getauevnonam() has no _r version?
735 void setauevent(void);
736 void endauevent(void);
737 struct au_event_ent *getauevent(void);
738 struct au_event_ent *getauevent_r(struct au_event_ent *e);
739 struct au_event_ent *getauevnam(const char *name);
740 struct au_event_ent *getauevnam_r(struct au_event_ent *e,
742 struct au_event_ent *getauevnum(au_event_t event_number);
743 struct au_event_ent *getauevnum_r(struct au_event_ent *e,
744 au_event_t event_number);
745 au_event_t *getauevnonam(const char *event_name);
746 au_event_t *getauevnonam_r(au_event_t *ev,
747 const char *event_name);
750 * Functions relating to querying audit user information.
752 void setauuser(void);
753 void endauuser(void);
754 struct au_user_ent *getauuserent(void);
755 struct au_user_ent *getauuserent_r(struct au_user_ent *u);
756 struct au_user_ent *getauusernam(const char *name);
757 struct au_user_ent *getauusernam_r(struct au_user_ent *u,
759 int au_user_mask(char *username, au_mask_t *mask_p);
760 int getfauditflags(au_mask_t *usremask,
761 au_mask_t *usrdmask, au_mask_t *lastmask);
764 * Functions for reading and printing records and tokens from audit trails.
766 int au_read_rec(FILE *fp, u_char **buf);
767 int au_fetch_tok(tokenstr_t *tok, u_char *buf, int len);
768 //XXX The following interface has different prototype from BSM
769 void au_print_tok(FILE *outfp, tokenstr_t *tok,
770 char *del, char raw, char sfrm);
774 #include <sys/appleapiopts.h>
776 /**************************************************************************
777 **************************************************************************
778 ** The following definitions, functions, etc., are NOT officially
779 ** supported: they may be changed or removed in the future. Do not use
780 ** them unless you are prepared to cope with that eventuality.
781 **************************************************************************
782 **************************************************************************/
784 #ifdef __APPLE_API_PRIVATE
785 #define __BSM_INTERNAL_NOTIFY_KEY "com.apple.audit.change"
786 #endif /* __APPLE_API_PRIVATE */
789 * au_get_state() return values
790 * XXX use AUC_* values directly instead (<bsm/audit.h>); AUDIT_OFF and
791 * AUDIT_ON are deprecated and WILL be removed.
793 #ifdef __APPLE_API_PRIVATE
794 #define AUDIT_OFF AUC_NOAUDIT
795 #define AUDIT_ON AUC_AUDITING
796 #endif /* __APPLE_API_PRIVATE */
797 #endif /* !__APPLE__ */
800 * Error return codes for audit_set_terminal_id(), audit_write() and its
801 * brethren. We have 255 (not including kAUNoErr) to play with.
803 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
807 kAUBadParamErr = -66049,
811 kAUMakeSubjectTokErr,
812 kAUWriteSubjectTokErr,
813 kAUWriteCallerTokErr,
815 kAUWriteReturnTokErr,
823 * Error return codes for au_get_state() and/or its private support
824 * functions. These codes are designed to be compatible with the
825 * NOTIFY_STATUS_* codes defined in <notify.h> but non-overlapping.
826 * Any changes to notify(3) may cause these values to change in future.
828 * AU_UNIMPL should never happen unless you've changed your system software
829 * without rebooting. Shame on you.
831 #ifdef __APPLE_API_PRIVATE
832 #define AU_UNIMPL NOTIFY_STATUS_FAILED + 1 /* audit unimplemented */
833 #endif /* __APPLE_API_PRIVATE */
834 #endif /* !__APPLE__ */
838 * XXX This prototype should be in audit_record.h
842 * @summary - au_free_token() deallocates a token_t created by any of
843 * the au_to_*() BSM API functions.
845 * The BSM API generally manages deallocation of token_t objects. However,
846 * if au_write() is passed a bad audit descriptor, the token_t * parameter
847 * will be left untouched. In that case, the caller can deallocate the
848 * token_t using au_free_token() if desired. This is, in fact, what
849 * audit_write() does, in keeping with the existing memory management model
852 * @param tok - A token_t * generated by one of the au_to_*() BSM API
853 * calls. For convenience, tok may be NULL, in which case
854 * au_free_token() returns immediately.
856 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
858 void au_free_token(token_t *tok);
861 * Lightweight check to determine if auditing is enabled. If a client
862 * wants to use this to govern whether an entire series of audit calls
863 * should be made--as in the common case of a caller building a set of
864 * tokens, then writing them--it should cache the audit status in a local
865 * variable. This call always returns the current state of auditing.
867 * @return - AUC_AUDITING or AUC_NOAUDIT if no error occurred.
868 * Otherwise the function can return any of the errno values defined for
869 * setaudit(2), or AU_UNIMPL if audit does not appear to be supported by
872 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
874 int au_get_state(void);
877 /* OpenSSH compatibility */
878 int cannot_audit(int);
882 * audit_set_terminal_id()
884 * @summary - audit_set_terminal_id() fills in an au_tid_t struct, which is
885 * used in audit session initialization by processes like /usr/bin/login.
887 * @param tid - A pointer to an au_tid_t struct.
889 * @return - kAUNoErr on success; kAUBadParamErr if tid is NULL, kAUStatErr
890 * or kAUSysctlErr if one of the underlying system calls fails (a message
891 * is sent to the system log in those cases).
893 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
895 int audit_set_terminal_id(au_tid_t *tid);
898 * BEGIN au_write() WRAPPERS
900 * The following calls all wrap the existing BSM API. They use the
901 * provided subject information, if any, to construct the subject token
902 * required for every log message. They use the provided return/error
903 * value(s), if any, to construct the success/failure indication required
904 * for every log message. They only permit one "miscellaneous" token,
905 * which should contain the event-specific logging information mandated by
908 * All these calls assume the caller has previously determined that
909 * auditing is enabled by calling au_get_state().
915 * @summary - audit_write() is the basis for the other audit_write_*()
916 * calls. Performs a basic write of an audit record (subject, additional
917 * info, success/failure). Note that this call only permits logging one
918 * caller-specified token; clients needing to log more flexibly must use
919 * the existing BSM API (au_open(), et al.) directly.
921 * Note on memory management: audit_write() guarantees that the token_t *s
922 * passed to it will be deallocated whether or not the underlying write to
923 * the audit log succeeded. This addresses an inconsistency in the
924 * underlying BSM API in which token_t *s are usually but not always
927 * @param event_code - The code for the event being logged. This should
928 * be one of the AUE_ values in /usr/include/bsm/audit_uevents.h.
930 * @param subject - A token_t * generated by au_to_subject(),
931 * au_to_subject32(), au_to_subject64(), or au_to_me(). If no subject is
932 * required, subject should be NULL.
934 * @param misctok - A token_t * generated by one of the au_to_*() BSM API
935 * calls. This should correspond to the additional information required by
936 * CAPP for the event being audited. If no additional information is
937 * required, misctok should be NULL.
939 * @param retval - The return value to be logged for this event. This
940 * should be 0 (zero) for success, otherwise the value is event-specific.
942 * @param errcode - Any error code associated with the return value (e.g.,
943 * errno or h_errno). If there was no error, errcode should be 0 (zero).
945 * @return - The status of the call: 0 (zero) on success, else one of the
946 * kAU*Err values defined above.
948 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
950 int audit_write(short event_code, token_t *subject, token_t *misctok,
951 char retval, int errcode);
954 * audit_write_success()
956 * @summary - audit_write_success() records an auditable event that did not
957 * encounter an error. The interface is designed to require as little
958 * direct use of the au_to_*() API as possible. It builds a subject token
959 * from the information passed in and uses that to invoke audit_write().
960 * A subject, as defined by CAPP, is a process acting on the user's behalf.
962 * If the subject information is the same as the current process, use
963 * au_write_success_self().
965 * @param event_code - The code for the event being logged. This should
966 * be one of the AUE_ values in /usr/include/bsm/audit_uevents.h.
968 * @param misctok - A token_t * generated by one of the au_to_*() BSM API
969 * calls. This should correspond to the additional information required by
970 * CAPP for the event being audited. If no additional information is
971 * required, misctok should be NULL.
973 * @param auid - The subject's audit ID.
975 * @param euid - The subject's effective user ID.
977 * @param egid - The subject's effective group ID.
979 * @param ruid - The subject's real user ID.
981 * @param rgid - The subject's real group ID.
983 * @param pid - The subject's process ID.
985 * @param sid - The subject's session ID.
987 * @param tid - The subject's terminal ID.
989 * @return - The status of the call: 0 (zero) on success, else one of the
990 * kAU*Err values defined above.
992 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
994 int audit_write_success(short event_code, token_t *misctok, au_id_t auid,
995 uid_t euid, gid_t egid, uid_t ruid, gid_t rgid, pid_t pid,
996 au_asid_t sid, au_tid_t *tid);
999 * audit_write_success_self()
1001 * @summary - Similar to audit_write_success(), but used when the subject
1002 * (process) is owned and operated by the auditable user him/herself.
1004 * @param event_code - The code for the event being logged. This should
1005 * be one of the AUE_ values in /usr/include/bsm/audit_uevents.h.
1007 * @param misctok - A token_t * generated by one of the au_to_*() BSM API
1008 * calls. This should correspond to the additional information required by
1009 * CAPP for the event being audited. If no additional information is
1010 * required, misctok should be NULL.
1012 * @return - The status of the call: 0 (zero) on success, else one of the
1013 * kAU*Err values defined above.
1015 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
1017 int audit_write_success_self(short event_code, token_t *misctok);
1020 * audit_write_failure()
1022 * @summary - audit_write_failure() records an auditable event that
1023 * encountered an error. The interface is designed to require as little
1024 * direct use of the au_to_*() API as possible. It builds a subject token
1025 * from the information passed in and uses that to invoke audit_write().
1026 * A subject, as defined by CAPP, is a process acting on the user's behalf.
1028 * If the subject information is the same as the current process, use
1029 * au_write_failure_self().
1031 * @param event_code - The code for the event being logged. This should
1032 * be one of the AUE_ values in /usr/include/bsm/audit_uevents.h.
1034 * @param errmsg - A text message providing additional information about
1035 * the event being audited.
1037 * @param errret - A numerical value providing additional information about
1038 * the error. This is intended to store the value of errno or h_errno if
1039 * it's relevant. This can be 0 (zero) if no additional information is
1042 * @param auid - The subject's audit ID.
1044 * @param euid - The subject's effective user ID.
1046 * @param egid - The subject's effective group ID.
1048 * @param ruid - The subject's real user ID.
1050 * @param rgid - The subject's real group ID.
1052 * @param pid - The subject's process ID.
1054 * @param sid - The subject's session ID.
1056 * @param tid - The subject's terminal ID.
1058 * @return - The status of the call: 0 (zero) on success, else one of the
1059 * kAU*Err values defined above.
1061 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
1063 int audit_write_failure(short event_code, char *errmsg, int errret,
1064 au_id_t auid, uid_t euid, gid_t egid, uid_t ruid, gid_t rgid,
1065 pid_t pid, au_asid_t sid, au_tid_t *tid);
1068 * audit_write_failure_self()
1070 * @summary - Similar to audit_write_failure(), but used when the subject
1071 * (process) is owned and operated by the auditable user him/herself.
1073 * @param event_code - The code for the event being logged. This should
1074 * be one of the AUE_ values in /usr/include/bsm/audit_uevents.h.
1076 * @param errmsg - A text message providing additional information about
1077 * the event being audited.
1079 * @param errret - A numerical value providing additional information about
1080 * the error. This is intended to store the value of errno or h_errno if
1081 * it's relevant. This can be 0 (zero) if no additional information is
1084 * @return - The status of the call: 0 (zero) on success, else one of the
1085 * kAU*Err values defined above.
1087 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
1089 int audit_write_failure_self(short event_code, char *errmsg, int errret);
1092 * audit_write_failure_na()
1094 * @summary - audit_write_failure_na() records errors during login. Such
1095 * errors are implicitly non-attributable (i.e., not ascribable to any user).
1097 * @param event_code - The code for the event being logged. This should
1098 * be one of the AUE_ values in /usr/include/bsm/audit_uevents.h.
1100 * @param errmsg - A text message providing additional information about
1101 * the event being audited.
1103 * @param errret - A numerical value providing additional information about
1104 * the error. This is intended to store the value of errno or h_errno if
1105 * it's relevant. This can be 0 (zero) if no additional information is
1108 * @param euid - The subject's effective user ID.
1110 * @param egid - The subject's effective group ID.
1112 * @param pid - The subject's process ID.
1114 * @param tid - The subject's terminal ID.
1116 * @return - The status of the call: 0 (zero) on success, else one of the
1117 * kAU*Err values defined above.
1119 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
1121 int audit_write_failure_na(short event_code, char *errmsg, int errret,
1122 uid_t euid, gid_t egid, pid_t pid, au_tid_t *tid);
1124 /* END au_write() WRAPPERS */
1128 * audit_token_to_au32()
1130 * @summary - Extract information from an audit_token_t, used to identify
1131 * Mach tasks and senders of Mach messages as subjects to the audit system.
1132 * audit_tokent_to_au32() is the only method that should be used to parse
1133 * an audit_token_t, since its internal representation may change over
1134 * time. A pointer parameter may be NULL if that information is not
1137 * @param atoken - the audit token containing the desired information
1139 * @param auidp - Pointer to a uid_t; on return will be set to the task or
1140 * sender's audit user ID
1142 * @param euidp - Pointer to a uid_t; on return will be set to the task or
1143 * sender's effective user ID
1145 * @param egidp - Pointer to a gid_t; on return will be set to the task or
1146 * sender's effective group ID
1148 * @param ruidp - Pointer to a uid_t; on return will be set to the task or
1149 * sender's real user ID
1151 * @param rgidp - Pointer to a gid_t; on return will be set to the task or
1152 * sender's real group ID
1154 * @param pidp - Pointer to a pid_t; on return will be set to the task or
1155 * sender's process ID
1157 * @param asidp - Pointer to an au_asid_t; on return will be set to the
1158 * task or sender's audit session ID
1160 * @param tidp - Pointer to an au_tid_t; on return will be set to the task
1161 * or sender's terminal ID
1163 * XXXRW: In Apple's bsm-8, these are marked __APPLE_API_PRIVATE.
1165 void audit_token_to_au32(
1166 audit_token_t atoken,
1175 #endif /* !__APPLE__ */
1179 #endif /* !_LIBBSM_H_ */