Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2012 15:21:10 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244267 - in head/sys: conf security/audit
Message-ID:  <201212151521.qBFFLAVt086110@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rwatson
Date: Sat Dec 15 15:21:09 2012
New Revision: 244267
URL: http://svnweb.freebsd.org/changeset/base/244267

Log:
  Four .c files from OpenBSM are used, in modified form, by the kernel to
  implement the BSM audit trail format.  Rename the kernel versions of the
  files to match the userspace filenames so that it's easier to work out
  what they correspond to, and therefore ensure they are kept in-sync.
  
  Obtained from:	TrustedBSD Project

Added:
  head/sys/security/audit/bsm_domain.c
     - copied unchanged from r244254, head/sys/security/audit/audit_bsm_domain.c
  head/sys/security/audit/bsm_errno.c
     - copied unchanged from r244254, head/sys/security/audit/audit_bsm_errno.c
  head/sys/security/audit/bsm_fcntl.c
     - copied unchanged from r244254, head/sys/security/audit/audit_bsm_fcntl.c
  head/sys/security/audit/bsm_socket_type.c
     - copied unchanged from r244254, head/sys/security/audit/audit_bsm_socket_type.c
  head/sys/security/audit/bsm_token.c
     - copied unchanged from r244254, head/sys/security/audit/audit_bsm_token.c
Deleted:
  head/sys/security/audit/audit_bsm_domain.c
  head/sys/security/audit/audit_bsm_errno.c
  head/sys/security/audit/audit_bsm_fcntl.c
  head/sys/security/audit/audit_bsm_socket_type.c
  head/sys/security/audit/audit_bsm_token.c
Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Dec 15 15:01:46 2012	(r244266)
+++ head/sys/conf/files	Sat Dec 15 15:21:09 2012	(r244267)
@@ -3531,16 +3531,16 @@ rpc/rpcsec_gss/svc_rpcsec_gss.c	optional
 security/audit/audit.c		optional audit
 security/audit/audit_arg.c	optional audit
 security/audit/audit_bsm.c	optional audit
-security/audit/audit_bsm_domain.c	optional audit
-security/audit/audit_bsm_errno.c	optional audit
-security/audit/audit_bsm_fcntl.c	optional audit
 security/audit/audit_bsm_klib.c	optional audit
-security/audit/audit_bsm_socket_type.c	optional audit
-security/audit/audit_bsm_token.c	optional audit
 security/audit/audit_pipe.c	optional audit
 security/audit/audit_syscalls.c	standard
 security/audit/audit_trigger.c	optional audit
 security/audit/audit_worker.c	optional audit
+security/audit/bsm_domain.c	optional audit
+security/audit/bsm_errno.c	optional audit
+security/audit/bsm_fcntl.c	optional audit
+security/audit/bsm_socket_type.c	optional audit
+security/audit/bsm_token.c	optional audit
 security/mac/mac_atalk.c	optional mac netatalk
 security/mac/mac_audit.c	optional mac audit
 security/mac/mac_cred.c		optional mac

Copied: head/sys/security/audit/bsm_domain.c (from r244254, head/sys/security/audit/audit_bsm_domain.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/security/audit/bsm_domain.c	Sat Dec 15 15:21:09 2012	(r244267, copy of r244254, head/sys/security/audit/audit_bsm_domain.c)
@@ -0,0 +1,495 @@
+/*-
+ * 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. 
+ *
+ * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_domain.c#3
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <security/audit/audit.h>
+
+#include <bsm/audit_domain.h>
+#include <bsm/audit_record.h>
+
+struct bsm_domain {
+	u_short	bd_bsm_domain;
+	int	bd_local_domain;
+};
+
+#define	PF_NO_LOCAL_MAPPING	-600
+
+static const struct bsm_domain bsm_domains[] = {
+	{ BSM_PF_UNSPEC, PF_UNSPEC },
+	{ BSM_PF_LOCAL, PF_LOCAL },
+	{ BSM_PF_INET, PF_INET },
+	{ BSM_PF_IMPLINK,
+#ifdef PF_IMPLINK
+	PF_IMPLINK
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_PUP,
+#ifdef PF_PUP
+	PF_PUP
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_CHAOS,
+#ifdef PF_CHAOS
+	PF_CHAOS
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_NS,
+#ifdef PF_NS
+	PF_NS
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_NBS,
+#ifdef PF_NBS
+	PF_NBS
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ECMA,
+#ifdef PF_ECMA
+	PF_ECMA
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_DATAKIT,
+#ifdef PF_DATAKIT
+	PF_DATAKIT
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_CCITT,
+#ifdef PF_CCITT
+	PF_CCITT
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_SNA, PF_SNA },
+	{ BSM_PF_DECnet, PF_DECnet },
+	{ BSM_PF_DLI,
+#ifdef PF_DLI
+	PF_DLI
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_LAT,
+#ifdef PF_LAT
+	PF_LAT
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_HYLINK,
+#ifdef PF_HYLINK
+	PF_HYLINK
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_APPLETALK, PF_APPLETALK },
+	{ BSM_PF_NIT,
+#ifdef PF_NIT
+	PF_NIT
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_802,
+#ifdef PF_802
+	PF_802
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_OSI,
+#ifdef PF_OSI
+	PF_OSI
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_X25,
+#ifdef PF_X25
+	PF_X25
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_OSINET,
+#ifdef PF_OSINET
+	PF_OSINET
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_GOSIP,
+#ifdef PF_GOSIP
+	PF_GOSIP
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_IPX, PF_IPX },
+	{ BSM_PF_ROUTE, PF_ROUTE },
+	{ BSM_PF_LINK,
+#ifdef PF_LINK
+	PF_LINK
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_INET6, PF_INET6 },
+	{ BSM_PF_KEY, PF_KEY },
+	{ BSM_PF_NCA,
+#ifdef PF_NCA
+	PF_NCA
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_POLICY,
+#ifdef PF_POLICY
+	PF_POLICY
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_INET_OFFLOAD,
+#ifdef PF_INET_OFFLOAD
+	PF_INET_OFFLOAD
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_NETBIOS,
+#ifdef PF_NETBIOS
+	PF_NETBIOS
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ISO,
+#ifdef PF_ISO
+	PF_ISO
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_XTP,
+#ifdef PF_XTP
+	PF_XTP
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_COIP,
+#ifdef PF_COIP
+	PF_COIP
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_CNT,
+#ifdef PF_CNT
+	PF_CNT
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_RTIP,
+#ifdef PF_RTIP
+	PF_RTIP
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_SIP,
+#ifdef PF_SIP
+	PF_SIP
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_PIP,
+#ifdef PF_PIP
+	PF_PIP
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ISDN,
+#ifdef PF_ISDN
+	PF_ISDN
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_E164,
+#ifdef PF_E164
+	PF_E164
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_NATM,
+#ifdef PF_NATM
+	PF_NATM
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ATM,
+#ifdef PF_ATM
+	PF_ATM
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_NETGRAPH,
+#ifdef PF_NETGRAPH
+	PF_NETGRAPH
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_SLOW,
+#ifdef PF_SLOW
+	PF_SLOW
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_SCLUSTER,
+#ifdef PF_SCLUSTER
+	PF_SCLUSTER
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ARP,
+#ifdef PF_ARP
+	PF_ARP
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_BLUETOOTH,
+#ifdef PF_BLUETOOTH
+	PF_BLUETOOTH
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_AX25,
+#ifdef PF_AX25
+	PF_AX25
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ROSE,
+#ifdef PF_ROSE
+	PF_ROSE
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_NETBEUI,
+#ifdef PF_NETBEUI
+	PF_NETBEUI
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_SECURITY,
+#ifdef PF_SECURITY
+	PF_SECURITY
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_PACKET,
+#ifdef PF_PACKET
+	PF_PACKET
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ASH,
+#ifdef PF_ASH
+	PF_ASH
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ECONET,
+#ifdef PF_ECONET
+	PF_ECONET
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_ATMSVC,
+#ifdef PF_ATMSVC
+	PF_ATMSVC
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_IRDA,
+#ifdef PF_IRDA
+	PF_IRDA
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_PPPOX,
+#ifdef PF_PPPOX
+	PF_PPPOX
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_WANPIPE,
+#ifdef PF_WANPIPE
+	PF_WANPIPE
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_LLC,
+#ifdef PF_LLC
+	PF_LLC
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_CAN,
+#ifdef PF_CAN
+	PF_CAN
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_TIPC,
+#ifdef PF_TIPC
+	PF_TIPC
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_IUCV,
+#ifdef PF_IUCV
+	PF_IUCV
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_RXRPC,
+#ifdef PF_RXRPC
+	PF_RXRPC
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+	{ BSM_PF_PHONET,
+#ifdef PF_PHONET
+	PF_PHONET
+#else
+	PF_NO_LOCAL_MAPPING
+#endif
+	},
+};
+static const int bsm_domains_count = sizeof(bsm_domains) /
+	    sizeof(bsm_domains[0]);
+
+static const struct bsm_domain *
+bsm_lookup_local_domain(int local_domain)
+{
+	int i;
+
+	for (i = 0; i < bsm_domains_count; i++) {
+		if (bsm_domains[i].bd_local_domain == local_domain)
+			return (&bsm_domains[i]);
+	}
+	return (NULL);
+}
+
+u_short
+au_domain_to_bsm(int local_domain)
+{
+	const struct bsm_domain *bstp;
+
+	bstp = bsm_lookup_local_domain(local_domain);
+	if (bstp == NULL)
+		return (BSM_PF_UNKNOWN);
+	return (bstp->bd_bsm_domain);
+}
+
+static const struct bsm_domain *
+bsm_lookup_bsm_domain(u_short bsm_domain)
+{
+	int i;
+
+	for (i = 0; i < bsm_domains_count; i++) {
+		if (bsm_domains[i].bd_bsm_domain == bsm_domain)
+			return (&bsm_domains[i]);
+	}
+	return (NULL);
+}
+
+int
+au_bsm_to_domain(u_short bsm_domain, int *local_domainp)
+{
+	const struct bsm_domain *bstp;
+
+	bstp = bsm_lookup_bsm_domain(bsm_domain);
+	if (bstp == NULL || bstp->bd_local_domain)
+		return (-1);
+	*local_domainp = bstp->bd_local_domain;
+	return (0);
+}

Copied: head/sys/security/audit/bsm_errno.c (from r244254, head/sys/security/audit/audit_bsm_errno.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/security/audit/bsm_errno.c	Sat Dec 15 15:21:09 2012	(r244267, copy of r244254, head/sys/security/audit/audit_bsm_errno.c)
@@ -0,0 +1,775 @@
+/*-
+ * 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. 
+ *
+ * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/param.h>
+
+#include <security/audit/audit.h>
+
+#include <bsm/audit_errno.h>
+#include <bsm/audit_record.h>
+
+#include <sys/errno.h>
+
+/*
+ * Different operating systems use different numeric constants for different
+ * error numbers, and sometimes error numbers don't exist in more than one
+ * operating system.  These routines convert between BSM and local error
+ * number spaces, subject to the above realities.  BSM error numbers are
+ * stored in a single 8-bit character, so don't have a byte order.
+ *
+ * Don't include string definitions when this code is compiled into a kernel.
+ */
+struct bsm_errno {
+	int		 be_bsm_errno;
+	int		 be_local_errno;
+#if !defined(KERNEL) && !defined(_KERNEL)
+	const char	*be_strerror;
+#endif
+};
+
+#define	ERRNO_NO_LOCAL_MAPPING	-600
+
+#if !defined(KERNEL) && !defined(_KERNEL)
+#define	ES(x)	x
+#else
+#define	ES(x)
+#endif
+
+/*
+ * Mapping table -- please maintain in numeric sorted order with respect to
+ * the BSM constant.  Today we do a linear lookup, but could switch to a
+ * binary search if it makes sense.  We only ifdef errors that aren't
+ * generally available, but it does make the table a lot more ugly.
+ *
+ * XXXRW: It would be nice to have a similar ordered table mapping to BSM
+ * constant from local constant, but the order of local constants varies by
+ * OS.  Really we need to build that table at compile-time but don't do that
+ * yet.
+ *
+ * XXXRW: We currently embed English-language error strings here, but should
+ * support catalogues; these are only used if the OS doesn't have an error
+ * string using strerror(3).
+ */
+static const struct bsm_errno bsm_errnos[] = {
+	{ BSM_ERRNO_ESUCCESS, 0, ES("Success") },
+	{ BSM_ERRNO_EPERM, EPERM, ES("Operation not permitted") },
+	{ BSM_ERRNO_ENOENT, ENOENT, ES("No such file or directory") },
+	{ BSM_ERRNO_ESRCH, ESRCH, ES("No such process") },
+	{ BSM_ERRNO_EINTR, EINTR, ES("Interrupted system call") },
+	{ BSM_ERRNO_EIO, EIO, ES("Input/output error") },
+	{ BSM_ERRNO_ENXIO, ENXIO, ES("Device not configured") },
+	{ BSM_ERRNO_E2BIG, E2BIG, ES("Argument list too long") },
+	{ BSM_ERRNO_ENOEXEC, ENOEXEC, ES("Exec format error") },
+	{ BSM_ERRNO_EBADF, EBADF, ES("Bad file descriptor") },
+	{ BSM_ERRNO_ECHILD, ECHILD, ES("No child processes") },
+	{ BSM_ERRNO_EAGAIN, EAGAIN, ES("Resource temporarily unavailable") },
+	{ BSM_ERRNO_ENOMEM, ENOMEM, ES("Cannot allocate memory") },
+	{ BSM_ERRNO_EACCES, EACCES, ES("Permission denied") },
+	{ BSM_ERRNO_EFAULT, EFAULT, ES("Bad address") },
+	{ BSM_ERRNO_ENOTBLK, ENOTBLK, ES("Block device required") },
+	{ BSM_ERRNO_EBUSY, EBUSY, ES("Device busy") },
+	{ BSM_ERRNO_EEXIST, EEXIST, ES("File exists") },
+	{ BSM_ERRNO_EXDEV, EXDEV, ES("Cross-device link") },
+	{ BSM_ERRNO_ENODEV, ENODEV, ES("Operation not supported by device") },
+	{ BSM_ERRNO_ENOTDIR, ENOTDIR, ES("Not a directory") },
+	{ BSM_ERRNO_EISDIR, EISDIR, ES("Is a directory") },
+	{ BSM_ERRNO_EINVAL, EINVAL, ES("Invalid argument") },
+	{ BSM_ERRNO_ENFILE, ENFILE, ES("Too many open files in system") },
+	{ BSM_ERRNO_EMFILE, EMFILE, ES("Too many open files") },
+	{ BSM_ERRNO_ENOTTY, ENOTTY, ES("Inappropriate ioctl for device") },
+	{ BSM_ERRNO_ETXTBSY, ETXTBSY, ES("Text file busy") },
+	{ BSM_ERRNO_EFBIG, EFBIG, ES("File too large") },
+	{ BSM_ERRNO_ENOSPC, ENOSPC, ES("No space left on device") },
+	{ BSM_ERRNO_ESPIPE, ESPIPE, ES("Illegal seek") },
+	{ BSM_ERRNO_EROFS, EROFS, ES("Read-only file system") },
+	{ BSM_ERRNO_EMLINK, EMLINK, ES("Too many links") },
+	{ BSM_ERRNO_EPIPE, EPIPE, ES("Broken pipe") },
+	{ BSM_ERRNO_EDOM, EDOM, ES("Numerical argument out of domain") },
+	{ BSM_ERRNO_ERANGE, ERANGE, ES("Result too large") },
+	{ BSM_ERRNO_ENOMSG, ENOMSG, ES("No message of desired type") },
+	{ BSM_ERRNO_EIDRM, EIDRM, ES("Identifier removed") },
+	{ BSM_ERRNO_ECHRNG,
+#ifdef ECHRNG
+	ECHRNG,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Channel number out of range") },
+	{ BSM_ERRNO_EL2NSYNC,
+#ifdef EL2NSYNC
+	EL2NSYNC,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Level 2 not synchronized") },
+	{ BSM_ERRNO_EL3HLT,
+#ifdef EL3HLT
+	EL3HLT,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Level 3 halted") },
+	{ BSM_ERRNO_EL3RST,
+#ifdef EL3RST
+	EL3RST,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Level 3 reset") },
+	{ BSM_ERRNO_ELNRNG,
+#ifdef ELNRNG
+	ELNRNG,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Link number out of range") },
+	{ BSM_ERRNO_EUNATCH,
+#ifdef EUNATCH
+	EUNATCH,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Protocol driver not attached") },
+	{ BSM_ERRNO_ENOCSI,
+#ifdef ENOCSI
+	ENOCSI,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("No CSI structure available") },
+	{ BSM_ERRNO_EL2HLT,
+#ifdef EL2HLT
+	EL2HLT,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Level 2 halted") },
+	{ BSM_ERRNO_EDEADLK, EDEADLK, ES("Resource deadlock avoided") },
+	{ BSM_ERRNO_ENOLCK, ENOLCK, ES("No locks available") },
+	{ BSM_ERRNO_ECANCELED, ECANCELED, ES("Operation canceled") },
+	{ BSM_ERRNO_ENOTSUP, ENOTSUP, ES("Operation not supported") },
+	{ BSM_ERRNO_EDQUOT, EDQUOT, ES("Disc quota exceeded") },
+	{ BSM_ERRNO_EBADE,
+#ifdef EBADE
+	EBADE,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Invalid exchange") },
+	{ BSM_ERRNO_EBADR,
+#ifdef EBADR
+	EBADR,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Invalid request descriptor") },
+	{ BSM_ERRNO_EXFULL,
+#ifdef EXFULL
+	EXFULL,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Exchange full") },
+	{ BSM_ERRNO_ENOANO,
+#ifdef ENOANO
+	ENOANO,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("No anode") },
+	{ BSM_ERRNO_EBADRQC,
+#ifdef EBADRQC
+	EBADRQC,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Invalid request descriptor") },
+	{ BSM_ERRNO_EBADSLT,
+#ifdef EBADSLT
+	EBADSLT,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Invalid slot") },
+	{ BSM_ERRNO_EDEADLOCK,
+#ifdef EDEADLOCK
+	EDEADLOCK,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Resource deadlock avoided") },
+	{ BSM_ERRNO_EBFONT,
+#ifdef EBFONT
+	EBFONT,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Bad font file format") },
+	{ BSM_ERRNO_EOWNERDEAD,
+#ifdef EOWNERDEAD
+	EOWNERDEAD,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Process died with the lock") },
+	{ BSM_ERRNO_ENOTRECOVERABLE,
+#ifdef ENOTRECOVERABLE
+	ENOTRECOVERABLE,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Lock is not recoverable") },
+	{ BSM_ERRNO_ENOSTR,
+#ifdef ENOSTR
+	ENOSTR,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Device not a stream") },
+	{ BSM_ERRNO_ENONET,
+#ifdef ENONET
+	ENONET,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Machine is not on the network") },
+	{ BSM_ERRNO_ENOPKG,
+#ifdef ENOPKG
+	ENOPKG,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Package not installed") },
+	{ BSM_ERRNO_EREMOTE, EREMOTE,
+	    ES("Too many levels of remote in path") },
+	{ BSM_ERRNO_ENOLINK,
+#ifdef ENOLINK
+	ENOLINK,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Link has been severed") },
+	{ BSM_ERRNO_EADV,
+#ifdef EADV
+	EADV,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Advertise error") },
+	{ BSM_ERRNO_ESRMNT,
+#ifdef ESRMNT
+	ESRMNT,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("srmount error") },
+	{ BSM_ERRNO_ECOMM,
+#ifdef ECOMM
+	ECOMM,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Communication error on send") },
+	{ BSM_ERRNO_EPROTO,
+#ifdef EPROTO
+	EPROTO,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Protocol error") },
+	{ BSM_ERRNO_ELOCKUNMAPPED,
+#ifdef ELOCKUNMAPPED
+	ELOCKUNMAPPED,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Locked lock was unmapped") },
+	{ BSM_ERRNO_ENOTACTIVE,
+#ifdef ENOTACTIVE
+	ENOTACTIVE,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Facility is not active") },
+	{ BSM_ERRNO_EMULTIHOP,
+#ifdef EMULTIHOP
+	EMULTIHOP,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Multihop attempted") },
+	{ BSM_ERRNO_EBADMSG,
+#ifdef EBADMSG
+	EBADMSG,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Bad message") },
+	{ BSM_ERRNO_ENAMETOOLONG, ENAMETOOLONG, ES("File name too long") },
+	{ BSM_ERRNO_EOVERFLOW, EOVERFLOW,
+	    ES("Value too large to be stored in data type") },
+	{ BSM_ERRNO_ENOTUNIQ,
+#ifdef ENOTUNIQ
+	ENOTUNIQ,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Given log name not unique") },
+	{ BSM_ERRNO_EBADFD,
+#ifdef EBADFD
+	EBADFD,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Given f.d. invalid for this operation") },
+	{ BSM_ERRNO_EREMCHG,
+#ifdef EREMCHG
+	EREMCHG,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Remote address changed") },
+	{ BSM_ERRNO_ELIBACC,
+#ifdef ELIBACC
+	ELIBACC,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Can't access a needed shared lib") },
+	{ BSM_ERRNO_ELIBBAD,
+#ifdef ELIBBAD
+	ELIBBAD,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Accessing a corrupted shared lib") },
+	{ BSM_ERRNO_ELIBSCN,
+#ifdef ELIBSCN
+	ELIBSCN,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES(".lib section in a.out corrupted") },
+	{ BSM_ERRNO_ELIBMAX,
+#ifdef ELIBMAX
+	ELIBMAX,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Attempting to link in too many libs") },
+	{ BSM_ERRNO_ELIBEXEC,
+#ifdef ELIBEXEC
+	ELIBEXEC,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Attempting to exec a shared library") },
+	{ BSM_ERRNO_EILSEQ, EILSEQ, ES("Illegal byte sequence") },
+	{ BSM_ERRNO_ENOSYS, ENOSYS, ES("Function not implemented") },
+	{ BSM_ERRNO_ELOOP, ELOOP, ES("Too many levels of symbolic links") },
+	{ BSM_ERRNO_ERESTART,
+#ifdef ERESTART
+	ERESTART,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Restart syscall") },
+	{ BSM_ERRNO_ESTRPIPE,
+#ifdef ESTRPIPE
+	ESTRPIPE,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("If pipe/FIFO, don't sleep in stream head") },
+	{ BSM_ERRNO_ENOTEMPTY, ENOTEMPTY, ES("Directory not empty") },
+	{ BSM_ERRNO_EUSERS, EUSERS, ES("Too many users") },
+	{ BSM_ERRNO_ENOTSOCK, ENOTSOCK,
+	    ES("Socket operation on non-socket") },
+	{ BSM_ERRNO_EDESTADDRREQ, EDESTADDRREQ,
+	    ES("Destination address required") },
+	{ BSM_ERRNO_EMSGSIZE, EMSGSIZE, ES("Message too long") },
+	{ BSM_ERRNO_EPROTOTYPE, EPROTOTYPE,
+	    ES("Protocol wrong type for socket") },
+	{ BSM_ERRNO_ENOPROTOOPT, ENOPROTOOPT, ES("Protocol not available") },
+	{ BSM_ERRNO_EPROTONOSUPPORT, EPROTONOSUPPORT,
+	    ES("Protocol not supported") },
+	{ BSM_ERRNO_ESOCKTNOSUPPORT, ESOCKTNOSUPPORT,
+	    ES("Socket type not supported") },
+	{ BSM_ERRNO_EOPNOTSUPP, EOPNOTSUPP, ES("Operation not supported") },
+	{ BSM_ERRNO_EPFNOSUPPORT, EPFNOSUPPORT,
+	    ES("Protocol family not supported") },
+	{ BSM_ERRNO_EAFNOSUPPORT, EAFNOSUPPORT,
+	    ES("Address family not supported by protocol family") },
+	{ BSM_ERRNO_EADDRINUSE, EADDRINUSE, ES("Address already in use") },
+	{ BSM_ERRNO_EADDRNOTAVAIL, EADDRNOTAVAIL,
+	    ES("Can't assign requested address") },
+	{ BSM_ERRNO_ENETDOWN, ENETDOWN, ES("Network is down") },
+	{ BSM_ERRNO_ENETRESET, ENETRESET,
+	    ES("Network dropped connection on reset") },
+	{ BSM_ERRNO_ECONNABORTED, ECONNABORTED,
+	    ES("Software caused connection abort") },
+	{ BSM_ERRNO_ECONNRESET, ECONNRESET, ES("Connection reset by peer") },
+	{ BSM_ERRNO_ENOBUFS, ENOBUFS, ES("No buffer space available") },
+	{ BSM_ERRNO_EISCONN, EISCONN, ES("Socket is already connected") },
+	{ BSM_ERRNO_ENOTCONN, ENOTCONN, ES("Socket is not connected") },
+	{ BSM_ERRNO_ESHUTDOWN, ESHUTDOWN,
+	    ES("Can't send after socket shutdown") },
+	{ BSM_ERRNO_ETOOMANYREFS, ETOOMANYREFS,
+	    ES("Too many references: can't splice") },
+	{ BSM_ERRNO_ETIMEDOUT, ETIMEDOUT, ES("Operation timed out") },
+	{ BSM_ERRNO_ECONNREFUSED, ECONNREFUSED, ES("Connection refused") },
+	{ BSM_ERRNO_EHOSTDOWN, EHOSTDOWN, ES("Host is down") },
+	{ BSM_ERRNO_EHOSTUNREACH, EHOSTUNREACH, ES("No route to host") },
+	{ BSM_ERRNO_EALREADY, EALREADY, ES("Operation already in progress") },
+	{ BSM_ERRNO_EINPROGRESS, EINPROGRESS,
+	    ES("Operation now in progress") },
+	{ BSM_ERRNO_ESTALE, ESTALE, ES("Stale NFS file handle") },
+	{ BSM_ERRNO_EPROCLIM,
+#ifdef EPROCLIM
+	EPROCLIM,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("Too many processes") },
+	{ BSM_ERRNO_EBADRPC,
+#ifdef EBADRPC
+	EBADRPC,
+#else
+	ERRNO_NO_LOCAL_MAPPING,
+#endif
+	ES("RPC struct is bad") },
+	{ BSM_ERRNO_ERPCMISMATCH,
+#ifdef ERPCMISMATCH
+	ERPCMISMATCH,
+#else

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212151521.qBFFLAVt086110>