+ uid_t cr_ruid; /* real user id */
+ uid_t cr_svuid; /* saved user id */
+ short cr_ngroups; /* number of groups in advisory list */
+ gid_t cr_groups[NGROUPS]; /* advisory group list */
+ gid_t cr_rgid; /* real group id */
+ gid_t cr_svgid; /* saved group id */
+ uid_t cr_gmuid; /* UID for group membership purposes */
+ int cr_flags; /* flags on credential */
+} cr_posix;
+ struct label *cr_label; /* MAC label */
+ /*
+ * NOTE: If anything else (besides the flags)
+ * added after the label, you must change
+ * kauth_cred_find().
+ */
+ struct au_session cr_audit; /* user auditing data */
+};
+#ifndef _KAUTH_CRED_T
+#define _KAUTH_CRED_T
+typedef struct ucred *kauth_cred_t;
+typedef struct posix_cred *posix_cred_t;
+#endif /* !_KAUTH_CRED_T */
+
+/*
+ * Credential flags that can be set on a credential
+ */
+#define CRF_NOMEMBERD 0x00000001 /* memberd opt out by setgroups() */
+#define CRF_MAC_ENFORCE 0x00000002 /* force entry through MAC Framework */
+ /* also forces credential cache miss */
+
+/*
+ * This is the external representation of struct ucred.
+ */
+struct xucred {
+ u_int cr_version; /* structure layout version */
+ uid_t cr_uid; /* effective user id */
+ short cr_ngroups; /* number of advisory groups */
+ gid_t cr_groups[NGROUPS]; /* advisory group list */