git: df6aeb413f51 - main - Merge OpenBSM 1.2-alpha6
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 14 Nov 2026 16:19:49 UTC
The branch main has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=df6aeb413f5144617d3f001ab07feec2ba0417be
commit df6aeb413f5144617d3f001ab07feec2ba0417be
Merge: 931a5d8866bc 2682ca6d4123
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-11-14 16:16:50 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-11-14 16:16:50 +0000
Merge OpenBSM 1.2-alpha6
Most of the changes already existed in FreeBSD.
Sponsored by: Klara, Inc.
Sponsored by: Qualys, Inc.
contrib/openbsm/.gitignore | 19 +++
contrib/openbsm/.travis.yml | 62 +++++++--
contrib/openbsm/CREDITS | 1 +
contrib/openbsm/INSTALL | 6 +
contrib/openbsm/LICENSE | 2 +-
contrib/openbsm/NEWS | 29 ++++
contrib/openbsm/README | 21 +--
contrib/openbsm/README.md | 1 +
contrib/openbsm/VERSION | 2 +-
contrib/openbsm/bin/auditd/audit_warn.c | 9 +-
contrib/openbsm/bin/auditd/auditd.c | 2 +-
contrib/openbsm/bin/auditd/auditd.h | 1 +
contrib/openbsm/bin/auditd/auditd_darwin.c | 6 +
contrib/openbsm/bin/auditd/auditd_fbsd.c | 17 +++
contrib/openbsm/bin/auditdistd/auditdistd.8 | 2 +-
contrib/openbsm/bin/auditdistd/auditdistd.conf.5 | 6 +-
contrib/openbsm/bin/auditdistd/pjdlog.c | 1 -
contrib/openbsm/bin/auditdistd/pjdlog.h | 1 -
contrib/openbsm/bin/auditdistd/proto_common.c | 1 -
contrib/openbsm/bin/auditdistd/proto_tcp.c | 1 -
contrib/openbsm/bin/auditdistd/sandbox.c | 8 ++
contrib/openbsm/bin/auditdistd/synch.h | 2 +
contrib/openbsm/bin/auditreduce/auditreduce.1 | 2 +-
contrib/openbsm/bin/praudit/praudit.1 | 2 +-
contrib/openbsm/bin/praudit/praudit.c | 12 ++
contrib/openbsm/bsm/libbsm.h | 36 +++++
contrib/openbsm/compat/uuid.h | 52 +++++++
contrib/openbsm/compat/uuid_stream.h | 80 +++++++++++
contrib/openbsm/compat/uuid_to_string.h | 64 +++++++++
contrib/openbsm/config/config.guess | 0
contrib/openbsm/config/config.h | 11 +-
contrib/openbsm/config/config.h.in | 3 +
contrib/openbsm/config/config.sub | 0
contrib/openbsm/config/depcomp | 0
contrib/openbsm/config/install-sh | 0
contrib/openbsm/config/missing | 0
contrib/openbsm/configure | 24 ++--
contrib/openbsm/configure.ac | 6 +-
contrib/openbsm/libauditd/auditd_lib.c | 2 +-
contrib/openbsm/libbsm/au_domain.3 | 2 +-
contrib/openbsm/libbsm/au_errno.3 | 2 +-
contrib/openbsm/libbsm/au_fcntl_cmd.3 | 2 +-
contrib/openbsm/libbsm/au_socket_type.3 | 2 +-
contrib/openbsm/libbsm/au_token.3 | 8 +-
contrib/openbsm/libbsm/bsm_class.c | 3 +
contrib/openbsm/libbsm/bsm_domain.c | 2 +-
contrib/openbsm/libbsm/bsm_errno.c | 2 +-
contrib/openbsm/libbsm/bsm_io.c | 168 ++++++++++++++++++++++-
contrib/openbsm/libbsm/bsm_socket_type.c | 2 +-
contrib/openbsm/libbsm/bsm_token.c | 84 +++++++++++-
contrib/openbsm/libbsm/bsm_wrappers.c | 37 ++---
contrib/openbsm/man/audit.log.5 | 42 +++++-
contrib/openbsm/man/getaudit.2 | 3 +-
contrib/openbsm/sys/bsm/audit.h | 8 ++
contrib/openbsm/sys/bsm/audit_domain.h | 2 +-
contrib/openbsm/sys/bsm/audit_errno.h | 3 +-
contrib/openbsm/sys/bsm/audit_fcntl.h | 6 +-
contrib/openbsm/sys/bsm/audit_kevents.h | 19 +++
contrib/openbsm/sys/bsm/audit_record.h | 22 ++-
contrib/openbsm/sys/bsm/audit_socket_type.h | 2 +-
contrib/openbsm/test/bsm/generate.c | 77 ++++++++++-
contrib/openbsm/test/reference/arg_uuid_record | Bin 0 -> 65 bytes
contrib/openbsm/test/reference/arg_uuid_token | Bin 0 -> 40 bytes
contrib/openbsm/test/reference/ret_uuid_record | Bin 0 -> 65 bytes
contrib/openbsm/test/reference/ret_uuid_token | Bin 0 -> 40 bytes
sys/bsm/audit.h | 12 +-
sys/bsm/audit_domain.h | 2 +-
sys/bsm/audit_errno.h | 3 +-
sys/bsm/audit_fcntl.h | 6 +-
sys/bsm/audit_kevents.h | 12 ++
sys/bsm/audit_record.h | 22 ++-
sys/bsm/audit_socket_type.h | 2 +-
72 files changed, 933 insertions(+), 118 deletions(-)
diff --cc contrib/openbsm/.gitignore
index 000000000000,000000000000..66e3e422b93d
new file mode 100644
--- /dev/null
+++ b/contrib/openbsm/.gitignore
@@@ -1,0 -1,0 +1,19 @@@
++*.o
++*.lo
++Makefile
++.deps
++.libs
++bin/auditdistd/auditdistd
++bin/auditdistd/parse.c
++bin/auditdistd/parse.h
++bin/auditdistd/token.c
++bin/auditfilterd/auditfilterd
++bin/auditreduce/auditreduce
++bin/praudit/praudit
++config.log
++config.status
++config/config.h
++config/stamp-h1
++libbsm/libbsm.la
++libtool
++modules/auditfilter_noop/auditfilter_noop.la
diff --cc contrib/openbsm/README.md
index 000000000000,000000000000..100b93820ade
new file mode 120000
--- /dev/null
+++ b/contrib/openbsm/README.md
@@@ -1,0 -1,0 +1,1 @@@
++README
diff --cc contrib/openbsm/compat/uuid.h
index 000000000000,462d9a3cbbd6..462d9a3cbbd6
mode 000000,100644..100644
--- a/contrib/openbsm/compat/uuid.h
+++ b/contrib/openbsm/compat/uuid.h
diff --cc contrib/openbsm/compat/uuid_stream.h
index 000000000000,d95ba84b10df..d95ba84b10df
mode 000000,100644..100644
--- a/contrib/openbsm/compat/uuid_stream.h
+++ b/contrib/openbsm/compat/uuid_stream.h
diff --cc contrib/openbsm/compat/uuid_to_string.h
index 000000000000,11f735ee7133..11f735ee7133
mode 000000,100644..100644
--- a/contrib/openbsm/compat/uuid_to_string.h
+++ b/contrib/openbsm/compat/uuid_to_string.h
diff --cc contrib/openbsm/config/config.guess
index 0e30d56e94e0,0e30d56e94e0..0e30d56e94e0
mode 100644,100755..100755
--- a/contrib/openbsm/config/config.guess
+++ b/contrib/openbsm/config/config.guess
diff --cc contrib/openbsm/config/config.h
index 9adafc1552fb,000000000000..a9243a5893ab
mode 100644,000000..100644
--- a/contrib/openbsm/config/config.h
+++ b/contrib/openbsm/config/config.h
@@@ -1,310 -1,0 +1,313 @@@
+/* config/config.h. Generated from config.h.in by configure. */
+/* config/config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
+
+/* Define to 1 if you have the `arc4random' function. */
+#define HAVE_ARC4RANDOM 1
+
+/* Define to 1 if you have the `arc4random_buf' function. */
+#define HAVE_ARC4RANDOM_BUF 1
+
+/* Define if audit system calls present */
+#define HAVE_AUDIT_SYSCALLS /**/
+
+/* Define to 1 if you have the `bzero' function. */
+#define HAVE_BZERO 1
+
++/* Define to 1 if you have the <capsicum_helpers.h> header file. */
++#define HAVE_CAPSICUM_HELPERS_H 1
++
+/* Define to 1 if you have the `cap_enter' function. */
+#define HAVE_CAP_ENTER 1
+
+/* Define to 1 if your system has a working `chown' function. */
+#define HAVE_CHOWN 1
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#define HAVE_CLOCK_GETTIME 1
+
+/* Define to 1 if you have the `closefrom' function. */
+#define HAVE_CLOSEFROM 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <endian.h> header file. */
- /* #undef HAVE_ENDIAN_H */
++#define HAVE_ENDIAN_H 1
+
+/* Define to 1 if you have the `faccessat' function. */
+#define HAVE_FACCESSAT 1
+
+/* Define to 1 if you have the `fdopendir' function. */
+#define HAVE_FDOPENDIR 1
+
+/* Define to 1 if you have the `fork' function. */
+#define HAVE_FORK 1
+
+/* Define to 1 if you have the `fstatat' function. */
+#define HAVE_FSTATAT 1
+
+/* Define to 1 if you have the `ftruncate' function. */
+#define HAVE_FTRUNCATE 1
+
+/* Define if queue.h includes LIST_FIRST */
+#define HAVE_FULL_QUEUE_H /**/
+
+/* Define to 1 if you have the `getresgid' function. */
+#define HAVE_GETRESGID 1
+
+/* Define to 1 if you have the `getresuid' function. */
+#define HAVE_GETRESUID 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#define HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the `inet_ntoa' function. */
+#define HAVE_INET_NTOA 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define if ipc_perm._key instead of key */
+/* #undef HAVE_IPC_PERM__KEY */
+
+/* Define if ipc_perm._seq instead of seq */
+/* #undef HAVE_IPC_PERM__SEQ */
+
+/* Define if ipc_perm.__key instead of key */
+/* #undef HAVE_IPC_PERM___KEY */
+
+/* Define if ipc_perm.__seq instead of seq */
+/* #undef HAVE_IPC_PERM___SEQ */
+
+/* Define to 1 if you have the `jail' function. */
+#define HAVE_JAIL 1
+
+/* Define to 1 if you have the `kqueue' function. */
+#define HAVE_KQUEUE 1
+
+/* Define to 1 if you have the <machine/endian.h> header file. */
+#define HAVE_MACHINE_ENDIAN_H 1
+
+/* Define to 1 if you have the <mach/mach.h> header file. */
+/* #undef HAVE_MACH_MACH_H */
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+ to 0 otherwise. */
+#define HAVE_MALLOC 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
+
+/* Define to 1 if you have the `openat' function. */
+#define HAVE_OPENAT 1
+
+/* Define to 1 if you have the <printf.h> header file. */
+#define HAVE_PRINTF_H 1
+
+/* Define to 1 if you have the `pthread_condattr_setclock' function. */
+#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
+
+/* Define to 1 if you have the `pthread_cond_timedwait_relative_np' function.
+ */
+/* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
+
+/* Define to 1 if you have the `pthread_mutex_lock' function. */
+#define HAVE_PTHREAD_MUTEX_LOCK 1
+
+/* Define to 1 if you have the <pthread_np.h> header file. */
+#define HAVE_PTHREAD_NP_H 1
+
+/* Define to 1 if you have the `renameat' function. */
+#define HAVE_RENAMEAT 1
+
+/* Define to 1 if you have the `setproctitle' function. */
+#define HAVE_SETPROCTITLE 1
+
+/* Define to 1 if you have the `sigtimedwait' function. */
+#define HAVE_SIGTIMEDWAIT 1
+
+/* Define if sockaddr_storage.ss_len field exists */
+#define HAVE_SOCKADDR_STORAGE_SS_LEN /**/
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+/* #undef HAVE_STAT_EMPTY_STRING_BUG */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strchr' function. */
+#define HAVE_STRCHR 1
+
+/* Define to 1 if you have the `strerror' function. */
+#define HAVE_STRERROR 1
+
+/* Define to 1 if you have the `strftime' function. */
+#define HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strlcat' function. */
+#define HAVE_STRLCAT 1
+
+/* Define to 1 if you have the `strlcpy' function. */
+#define HAVE_STRLCPY 1
+
+/* Define to 1 if you have the `strndup' function. */
+#define HAVE_STRNDUP 1
+
+/* Define to 1 if you have the `strrchr' function. */
+#define HAVE_STRRCHR 1
+
+/* Define to 1 if you have the `strstr' function. */
+#define HAVE_STRSTR 1
+
+/* Define to 1 if you have the `strtol' function. */
+#define HAVE_STRTOL 1
+
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
+
+/* Define to 1 if `st_rdev' is a member of `struct stat'. */
+#define HAVE_STRUCT_STAT_ST_RDEV 1
+
+/* Define to 1 if you have the <sys/endian.h> header file. */
+#define HAVE_SYS_ENDIAN_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#define HAVE_SYS_WAIT_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `unlinkat' function. */
+#define HAVE_UNLINKAT 1
+
+/* Define to 1 if you have the `vfork' function. */
+#define HAVE_VFORK 1
+
+/* Define to 1 if you have the <vfork.h> header file. */
+/* #undef HAVE_VFORK_H */
+
+/* Define to 1 if you have the `vis' function. */
+#define HAVE_VIS 1
+
+/* Define to 1 if `fork' works. */
+#define HAVE_WORKING_FORK 1
+
+/* Define to 1 if `vfork' works. */
+#define HAVE_WORKING_VFORK 1
+
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+ slash. */
+#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+#define PACKAGE "OpenBSM"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "trustedbsd-audit@TrustedBSD.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "OpenBSM"
+
+/* Define to the full name and version of this package. */
- #define PACKAGE_STRING "OpenBSM 1.2-alpha5"
++#define PACKAGE_STRING "OpenBSM 1.2-alpha6"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "openbsm"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
- #define PACKAGE_VERSION "1.2-alpha5"
++#define PACKAGE_VERSION "1.2-alpha6"
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define if compat/endian_enc.h is required */
+/* #undef USE_COMPAT_ENDIAN_ENC_H */
+
+/* Define if compat/endian.h is required */
+/* #undef USE_COMPAT_ENDIAN_H */
+
+/* Define if endian.h should be included */
+/* #undef USE_ENDIAN_H */
+
+/* Define if machine/endian.h should be included */
+/* #undef USE_MACHINE_ENDIAN_H */
+
+/* Define if uses Mach IPC for Triggers messages */
+/* #undef USE_MACH_IPC */
+
+/* Define to use native include files */
+/* #undef USE_NATIVE_INCLUDES */
+
+/* Define if sys/endian.h should be included */
+#define USE_SYS_ENDIAN_H /**/
+
+/* Version number of package */
- #define VERSION "1.2-alpha5"
++#define VERSION "1.2-alpha6"
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+#define YYTEXT_POINTER 1
+
+/* Use extended API on platforms that require it */
+#define _GNU_SOURCE /**/
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef gid_t */
+
+/* Define to rpl_malloc if the replacement function should be used. */
+/* #undef malloc */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef uid_t */
+
+/* Define as `fork' if `vfork' does not work. */
+/* #undef vfork */
diff --cc contrib/openbsm/config/config.sub
index 9d7f73390549,9d7f73390549..9d7f73390549
mode 100644,100755..100755
--- a/contrib/openbsm/config/config.sub
+++ b/contrib/openbsm/config/config.sub
diff --cc contrib/openbsm/config/depcomp
index fc98710e2a1d,000000000000..fc98710e2a1d
mode 100644,000000..100755
--- a/contrib/openbsm/config/depcomp
+++ b/contrib/openbsm/config/depcomp
diff --cc contrib/openbsm/config/install-sh
index 4d4a9519eaf8,4d4a9519eaf8..4d4a9519eaf8
mode 100644,100755..100755
--- a/contrib/openbsm/config/install-sh
+++ b/contrib/openbsm/config/install-sh
diff --cc contrib/openbsm/config/missing
index f62bbae306c7,000000000000..f62bbae306c7
mode 100644,000000..100755
--- a/contrib/openbsm/config/missing
+++ b/contrib/openbsm/config/missing
diff --cc contrib/openbsm/sys/bsm/audit.h
index 26ac4cbf7584,000000000000..cae785f592ca
mode 100644,000000..100644
--- a/contrib/openbsm/sys/bsm/audit.h
+++ b/contrib/openbsm/sys/bsm/audit.h
@@@ -1,343 -1,0 +1,351 @@@
+/*-
+ * Copyright (c) 2005-2009 Apple Inc.
+ * Copyright (c) 2016 Robert N. M. Watson
+ * All rights reserved.
+ *
+ * Portions of this software were developed by BAE Systems, the University of
+ * Cambridge Computer Laboratory, and Memorial University under DARPA/AFRL
+ * contract FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent
+ * Computing (TC) research program.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _BSM_AUDIT_H
+#define _BSM_AUDIT_H
+
+#include <sys/param.h>
+#include <sys/types.h>
+
+#define AUDIT_RECORD_MAGIC 0x828a0f1b
+#define MAX_AUDIT_RECORDS 20
+#define MAXAUDITDATA (0x8000 - 1)
+#define MAX_AUDIT_RECORD_SIZE MAXAUDITDATA
+#define MIN_AUDIT_FILE_SIZE (512 * 1024)
+
+/*
+ * Minimum number of free blocks on the filesystem containing the audit
+ * log necessary to avoid a hard log rotation. DO NOT SET THIS VALUE TO 0
+ * as the kernel does an unsigned compare, plus we want to leave a few blocks
+ * free so userspace can terminate the log, etc.
+ */
+#define AUDIT_HARD_LIMIT_FREE_BLOCKS 4
+
+/*
+ * Triggers for the audit daemon.
+ */
+#define AUDIT_TRIGGER_MIN 1
+#define AUDIT_TRIGGER_LOW_SPACE 1 /* Below low watermark. */
+#define AUDIT_TRIGGER_ROTATE_KERNEL 2 /* Kernel requests rotate. */
+#define AUDIT_TRIGGER_READ_FILE 3 /* Re-read config file. */
+#define AUDIT_TRIGGER_CLOSE_AND_DIE 4 /* Terminate audit. */
+#define AUDIT_TRIGGER_NO_SPACE 5 /* Below min free space. */
+#define AUDIT_TRIGGER_ROTATE_USER 6 /* User requests rotate. */
+#define AUDIT_TRIGGER_INITIALIZE 7 /* User initialize of auditd. */
+#define AUDIT_TRIGGER_EXPIRE_TRAILS 8 /* User expiration of trails. */
+#define AUDIT_TRIGGER_MAX 8
+
+/*
+ * The special device filename (FreeBSD).
+ */
+#define AUDITDEV_FILENAME "audit"
+#define AUDIT_TRIGGER_FILE ("/dev/" AUDITDEV_FILENAME)
+
+/*
+ * Pre-defined audit IDs
+ */
+#define AU_DEFAUDITID (uid_t)(-1)
+#define AU_DEFAUDITSID 0
+#define AU_ASSIGN_ASID -1
+
+/*
+ * IPC types.
+ */
+#define AT_IPC_MSG ((u_char)1) /* Message IPC id. */
+#define AT_IPC_SEM ((u_char)2) /* Semaphore IPC id. */
+#define AT_IPC_SHM ((u_char)3) /* Shared mem IPC id. */
+
+/*
+ * Audit conditions.
+ */
+#define AUC_UNSET 0
+#define AUC_AUDITING 1
+#define AUC_NOAUDIT 2
+#define AUC_DISABLED -1
+
+/*
+ * auditon(2) commands.
+ */
+#define A_OLDGETPOLICY 2
+#define A_OLDSETPOLICY 3
+#define A_GETKMASK 4
+#define A_SETKMASK 5
+#define A_OLDGETQCTRL 6
+#define A_OLDSETQCTRL 7
+#define A_GETCWD 8
+#define A_GETCAR 9
+#define A_GETSTAT 12
+#define A_SETSTAT 13
+#define A_SETUMASK 14
+#define A_SETSMASK 15
+#define A_OLDGETCOND 20
+#define A_OLDSETCOND 21
+#define A_GETCLASS 22
+#define A_SETCLASS 23
+#define A_GETPINFO 24
+#define A_SETPMASK 25
+#define A_SETFSIZE 26
+#define A_GETFSIZE 27
+#define A_GETPINFO_ADDR 28
+#define A_GETKAUDIT 29
+#define A_SETKAUDIT 30
+#define A_SENDTRIGGER 31
+#define A_GETSINFO_ADDR 32
+#define A_GETPOLICY 33
+#define A_SETPOLICY 34
+#define A_GETQCTRL 35
+#define A_SETQCTRL 36
+#define A_GETCOND 37
+#define A_SETCOND 38
+#define A_GETEVENT 39 /* Get audit event-to-name mapping. */
+#define A_SETEVENT 40 /* Set audit event-to-name mapping. */
+
+/*
+ * Audit policy controls.
+ */
+#define AUDIT_CNT 0x0001
+#define AUDIT_AHLT 0x0002
+#define AUDIT_ARGV 0x0004
+#define AUDIT_ARGE 0x0008
+#define AUDIT_SEQ 0x0010
+#define AUDIT_WINDATA 0x0020
+#define AUDIT_USER 0x0040
+#define AUDIT_GROUP 0x0080
+#define AUDIT_TRAIL 0x0100
+#define AUDIT_PATH 0x0200
+#define AUDIT_SCNT 0x0400
+#define AUDIT_PUBLIC 0x0800
+#define AUDIT_ZONENAME 0x1000
+#define AUDIT_PERZONE 0x2000
+
+/*
+ * Default audit queue control parameters.
+ */
+#define AQ_HIWATER 100
+#define AQ_MAXHIGH 10000
+#define AQ_LOWATER 10
+#define AQ_BUFSZ MAXAUDITDATA
+#define AQ_MAXBUFSZ 1048576
+
+/*
+ * Default minimum percentage free space on file system.
+ */
+#define AU_FS_MINFREE 20
+
+/*
+ * Type definitions used indicating the length of variable length addresses
+ * in tokens containing addresses, such as header fields.
+ */
+#define AU_IPv4 4
+#define AU_IPv6 16
+
+__BEGIN_DECLS
+
+typedef uid_t au_id_t;
+typedef pid_t au_asid_t;
+typedef u_int16_t au_event_t;
+typedef u_int16_t au_emod_t;
+typedef u_int32_t au_class_t;
+typedef u_int64_t au_asflgs_t __attribute__ ((aligned (8)));
+
+struct au_tid {
++#ifdef __FreeBSD__
++ u_int32_t port;
++#else
+ dev_t port;
++#endif
+ u_int32_t machine;
+};
+typedef struct au_tid au_tid_t;
+
+struct au_tid_addr {
++#ifdef __FreeBSD__
++ u_int32_t at_port;
++#else
+ dev_t at_port;
++#endif
+ u_int32_t at_type;
+ u_int32_t at_addr[4];
+};
+typedef struct au_tid_addr au_tid_addr_t;
+
+struct au_mask {
+ unsigned int am_success; /* Success bits. */
+ unsigned int am_failure; /* Failure bits. */
+};
+typedef struct au_mask au_mask_t;
+
+struct auditinfo {
+ au_id_t ai_auid; /* Audit user ID. */
+ au_mask_t ai_mask; /* Audit masks. */
+ au_tid_t ai_termid; /* Terminal ID. */
+ au_asid_t ai_asid; /* Audit session ID. */
+};
+typedef struct auditinfo auditinfo_t;
+
+struct auditinfo_addr {
+ au_id_t ai_auid; /* Audit user ID. */
+ au_mask_t ai_mask; /* Audit masks. */
+ au_tid_addr_t ai_termid; /* Terminal ID. */
+ au_asid_t ai_asid; /* Audit session ID. */
+ au_asflgs_t ai_flags; /* Audit session flags. */
+};
+typedef struct auditinfo_addr auditinfo_addr_t;
+
+struct auditpinfo {
+ pid_t ap_pid; /* ID of target process. */
+ au_id_t ap_auid; /* Audit user ID. */
+ au_mask_t ap_mask; /* Audit masks. */
+ au_tid_t ap_termid; /* Terminal ID. */
+ au_asid_t ap_asid; /* Audit session ID. */
+};
+typedef struct auditpinfo auditpinfo_t;
+
+struct auditpinfo_addr {
+ pid_t ap_pid; /* ID of target process. */
+ au_id_t ap_auid; /* Audit user ID. */
+ au_mask_t ap_mask; /* Audit masks. */
+ au_tid_addr_t ap_termid; /* Terminal ID. */
+ au_asid_t ap_asid; /* Audit session ID. */
+ au_asflgs_t ap_flags; /* Audit session flags. */
+};
+typedef struct auditpinfo_addr auditpinfo_addr_t;
+
+struct au_session {
+ auditinfo_addr_t *as_aia_p; /* Ptr to full audit info. */
+ au_mask_t as_mask; /* Process Audit Masks. */
+};
+typedef struct au_session au_session_t;
+
+/*
+ * Contents of token_t are opaque outside of libbsm.
+ */
+typedef struct au_token token_t;
+
+/*
+ * Kernel audit queue control parameters:
+ * Default: Maximum:
+ * aq_hiwater: AQ_HIWATER (100) AQ_MAXHIGH (10000)
+ * aq_lowater: AQ_LOWATER (10) <aq_hiwater
+ * aq_bufsz: AQ_BUFSZ (32767) AQ_MAXBUFSZ (1048576)
+ * aq_delay: 20 20000 (not used)
+ */
+struct au_qctrl {
+ int aq_hiwater; /* Max # of audit recs in queue when */
+ /* threads with new ARs get blocked. */
+
+ int aq_lowater; /* # of audit recs in queue when */
+ /* blocked threads get unblocked. */
+
+ int aq_bufsz; /* Max size of audit record for audit(2). */
+ int aq_delay; /* Queue delay (not used). */
+ int aq_minfree; /* Minimum filesystem percent free space. */
+};
+typedef struct au_qctrl au_qctrl_t;
+
+/*
+ * Structure for the audit statistics.
+ */
+struct audit_stat {
+ unsigned int as_version;
+ unsigned int as_numevent;
+ int as_generated;
+ int as_nonattrib;
+ int as_kernel;
+ int as_audit;
+ int as_auditctl;
+ int as_enqueue;
+ int as_written;
+ int as_wblocked;
+ int as_rblocked;
+ int as_dropped;
+ int as_totalsize;
+ unsigned int as_memused;
+};
+typedef struct audit_stat au_stat_t;
+
+/*
+ * Structure for the audit file statistics.
+ */
+struct audit_fstat {
+ u_int64_t af_filesz;
+ u_int64_t af_currsz;
+};
+typedef struct audit_fstat au_fstat_t;
+
+/*
+ * Audit to event class mapping.
+ */
+struct au_evclass_map {
+ au_event_t ec_number;
+ au_class_t ec_class;
+};
+typedef struct au_evclass_map au_evclass_map_t;
+
+/*
+ * Event-to-name mapping.
+ */
+#define EVNAMEMAP_NAME_SIZE 64
+struct au_evname_map {
+ au_event_t en_number;
+ char en_name[EVNAMEMAP_NAME_SIZE];
+};
+typedef struct au_evname_map au_evname_map_t;
+
+/*
+ * Audit system calls.
+ */
+#if !defined(_KERNEL) && !defined(KERNEL)
+int audit(const void *, int);
+int auditon(int, void *, int);
+int auditctl(const char *);
+int getauid(au_id_t *);
+int setauid(const au_id_t *);
+int getaudit(struct auditinfo *);
+int setaudit(const struct auditinfo *);
+int getaudit_addr(struct auditinfo_addr *, int);
+int setaudit_addr(const struct auditinfo_addr *, int);
+
+#ifdef __APPLE_API_PRIVATE
+#include <mach/port.h>
+mach_port_name_t audit_session_self(void);
+au_asid_t audit_session_join(mach_port_name_t port);
+#endif /* __APPLE_API_PRIVATE */
+
+#endif /* defined(_KERNEL) || defined(KERNEL) */
+
+__END_DECLS
+
+#endif /* !_BSM_AUDIT_H */
diff --cc contrib/openbsm/sys/bsm/audit_domain.h
index 373afa7b4bbc,000000000000..5839fa7d3fe1
mode 100644,000000..100644
--- a/contrib/openbsm/sys/bsm/audit_domain.h
+++ b/contrib/openbsm/sys/bsm/audit_domain.h
@@@ -1,112 -1,0 +1,112 @@@
+/*-
+ * Copyright (c) 2008 Apple Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
++ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _BSM_AUDIT_DOMAIN_H_
+#define _BSM_AUDIT_DOMAIN_H_
+
+/*
+ * BSM protocol domain constants - protocol domains defined in Solaris.
+ */
+#define BSM_PF_UNSPEC 0
+#define BSM_PF_LOCAL 1
+#define BSM_PF_INET 2
+#define BSM_PF_IMPLINK 3
+#define BSM_PF_PUP 4
+#define BSM_PF_CHAOS 5
+#define BSM_PF_NS 6
+#define BSM_PF_NBS 7 /* Solaris-specific. */
+#define BSM_PF_ECMA 8
+#define BSM_PF_DATAKIT 9
+#define BSM_PF_CCITT 10
+#define BSM_PF_SNA 11
+#define BSM_PF_DECnet 12
+#define BSM_PF_DLI 13
+#define BSM_PF_LAT 14
+#define BSM_PF_HYLINK 15
+#define BSM_PF_APPLETALK 16
+#define BSM_PF_NIT 17 /* Solaris-specific. */
+#define BSM_PF_802 18 /* Solaris-specific. */
+#define BSM_PF_OSI 19
+#define BSM_PF_X25 20 /* Solaris/Linux-specific. */
+#define BSM_PF_OSINET 21 /* Solaris-specific. */
+#define BSM_PF_GOSIP 22 /* Solaris-specific. */
+#define BSM_PF_IPX 23
+#define BSM_PF_ROUTE 24
+#define BSM_PF_LINK 25
+#define BSM_PF_INET6 26
+#define BSM_PF_KEY 27
+#define BSM_PF_NCA 28 /* Solaris-specific. */
+#define BSM_PF_POLICY 29 /* Solaris-specific. */
+#define BSM_PF_INET_OFFLOAD 30 /* Solaris-specific. */
+
+/*
+ * BSM protocol domain constants - protocol domains not defined in Solaris.
+ */
+#define BSM_PF_NETBIOS 500 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_ISO 501 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_XTP 502 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_COIP 503 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_CNT 504 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_RTIP 505 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_SIP 506 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_PIP 507 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_ISDN 508 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_E164 509 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_NATM 510 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_ATM 511 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_NETGRAPH 512 /* FreeBSD/Darwin-specific. */
+#define BSM_PF_SLOW 513 /* FreeBSD-specific. */
+#define BSM_PF_SCLUSTER 514 /* FreeBSD-specific. */
+#define BSM_PF_ARP 515 /* FreeBSD-specific. */
+#define BSM_PF_BLUETOOTH 516 /* FreeBSD-specific. */
+ /* 517: unallocated. */
+#define BSM_PF_AX25 518 /* Linux-specific. */
+#define BSM_PF_ROSE 519 /* Linux-specific. */
+#define BSM_PF_NETBEUI 520 /* Linux-specific. */
+#define BSM_PF_SECURITY 521 /* Linux-specific. */
+#define BSM_PF_PACKET 522 /* Linux-specific. */
+#define BSM_PF_ASH 523 /* Linux-specific. */
+#define BSM_PF_ECONET 524 /* Linux-specific. */
+#define BSM_PF_ATMSVC 525 /* Linux-specific. */
+#define BSM_PF_IRDA 526 /* Linux-specific. */
+#define BSM_PF_PPPOX 527 /* Linux-specific. */
+#define BSM_PF_WANPIPE 528 /* Linux-specific. */
+#define BSM_PF_LLC 529 /* Linux-specific. */
+#define BSM_PF_CAN 530 /* Linux-specific. */
+#define BSM_PF_TIPC 531 /* Linux-specific. */
+#define BSM_PF_IUCV 532 /* Linux-specific. */
+#define BSM_PF_RXRPC 533 /* Linux-specific. */
+#define BSM_PF_PHONET 534 /* Linux-specific. */
+
+/*
+ * Used when there is no mapping from a local to BSM protocol domain.
+ */
+#define BSM_PF_UNKNOWN 700 /* OpenBSM-specific. */
+
+#endif /* !_BSM_AUDIT_DOMAIN_H_ */
diff --cc contrib/openbsm/sys/bsm/audit_errno.h
index fc64726bbb23,000000000000..9f25a88ef044
mode 100644,000000..100644
--- a/contrib/openbsm/sys/bsm/audit_errno.h
+++ b/contrib/openbsm/sys/bsm/audit_errno.h
@@@ -1,215 -1,0 +1,216 @@@
+/*-
+ * Copyright (c) 2008 Apple Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
*** 1677 LINES SKIPPED ***