[Midnightbsd-cvs] src [8508] trunk/sys: merge in sys bsm changes.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Sep 18 18:49:32 EDT 2016
Revision: 8508
http://svnweb.midnightbsd.org/src/?rev=8508
Author: laffer1
Date: 2016-09-18 18:49:32 -0400 (Sun, 18 Sep 2016)
Log Message:
-----------
merge in sys bsm changes.
Modified Paths:
--------------
trunk/sys/bsm/audit_errno.h
trunk/sys/bsm/audit_internal.h
trunk/sys/bsm/audit_record.h
trunk/sys/security/audit/audit_bsm_errno.c
trunk/sys/security/audit/audit_bsm_token.c
Modified: trunk/sys/bsm/audit_errno.h
===================================================================
--- trunk/sys/bsm/audit_errno.h 2016-09-18 22:48:16 UTC (rev 8507)
+++ trunk/sys/bsm/audit_errno.h 2016-09-18 22:49:32 UTC (rev 8508)
@@ -26,7 +26,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#5
+ * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#7
* $FreeBSD$
*/
Modified: trunk/sys/bsm/audit_internal.h
===================================================================
--- trunk/sys/bsm/audit_internal.h 2016-09-18 22:48:16 UTC (rev 8507)
+++ trunk/sys/bsm/audit_internal.h 2016-09-18 22:49:32 UTC (rev 8508)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/bsm/audit_internal.h,v 1.5 2012/03/31 03:08:56 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*
* Copyright (c) 2005 Apple Inc.
* Copyright (c) 2005 SPARTA, Inc.
@@ -16,7 +16,7 @@
* 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 Computer, Inc. ("Apple") nor the names of
+ * 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.
*
@@ -33,7 +33,7 @@
*
* P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_internal.h#18
* $FreeBSD: src/sys/bsm/audit_internal.h,v 1.8 2007/07/22 12:28:12 rwatson Exp $
- * $MidnightBSD: src/sys/bsm/audit_internal.h,v 1.5 2012/03/31 03:08:56 laffer1 Exp $
+ * $MidnightBSD$
*/
#ifndef _AUDIT_INTERNAL_H
Modified: trunk/sys/bsm/audit_record.h
===================================================================
--- trunk/sys/bsm/audit_record.h 2016-09-18 22:48:16 UTC (rev 8507)
+++ trunk/sys/bsm/audit_record.h 2016-09-18 22:49:32 UTC (rev 8508)
@@ -1,4 +1,4 @@
-/* $MidnightBSD: src/sys/bsm/audit_record.h,v 1.5 2012/03/31 03:08:56 laffer1 Exp $ */
+/* $MidnightBSD$ */
/*
* Copyright (c) 2005 Apple Inc.
* All rights reserved.
@@ -29,7 +29,7 @@
*
* P4: //depot/projects/trustedbsd/audit3/sys/bsm/audit_record.h#26
* $FreeBSD: src/sys/bsm/audit_record.h,v 1.10 2007/07/22 12:28:13 rwatson Exp $
- * $MidnightBSD: src/sys/bsm/audit_record.h,v 1.5 2012/03/31 03:08:56 laffer1 Exp $
+ * $MidnightBSD$
*/
#ifndef _BSM_AUDIT_RECORD_H_
@@ -236,6 +236,7 @@
token_t *au_to_iport(uint16_t iport);
token_t *au_to_opaque(const char *data, uint16_t bytes);
token_t *au_to_path(const char *path);
+token_t *au_to_privset(char *privtypestr, char *privstr);
token_t *au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid);
token_t *au_to_process32(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
@@ -281,6 +282,7 @@
token_t *au_to_text(const char *text);
token_t *au_to_kevent(struct kevent *kev);
token_t *au_to_trailer(int rec_size);
+token_t *au_to_upriv(char sorf, char *priv);
token_t *au_to_zonename(const char *zonename);
/*
Modified: trunk/sys/security/audit/audit_bsm_errno.c
===================================================================
--- trunk/sys/security/audit/audit_bsm_errno.c 2016-09-18 22:48:16 UTC (rev 8507)
+++ trunk/sys/security/audit/audit_bsm_errno.c 2016-09-18 22:49:32 UTC (rev 8508)
@@ -26,7 +26,7 @@
* 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#18
+ * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22
*/
#include <sys/cdefs.h>
@@ -494,7 +494,7 @@
#ifdef EPROCUNAVAIL
EPROCUNAVAIL,
#else
- ERRNO_NO_LOCAL_MAPPING
+ ERRNO_NO_LOCAL_MAPPING,
#endif
ES("Bad procedure for program") },
{ BSM_ERRNO_EFTYPE,
@@ -666,7 +666,7 @@
#endif
ES("Required key not available") },
{ BSM_ERRNO_EKEYEXPIRED,
-#ifdef EKEEXPIRED
+#ifdef EKEYEXPIRED
EKEYEXPIRED,
#else
ERRNO_NO_LOCAL_MAPPING,
@@ -680,7 +680,7 @@
#endif
ES("Key has been revoked") },
{ BSM_ERRNO_EKEYREJECTED,
-#ifdef EKEREJECTED
+#ifdef EKEYREJECTED
EKEYREJECTED,
#else
ERRNO_NO_LOCAL_MAPPING,
Modified: trunk/sys/security/audit/audit_bsm_token.c
===================================================================
--- trunk/sys/security/audit/audit_bsm_token.c 2016-09-18 22:48:16 UTC (rev 8507)
+++ trunk/sys/security/audit/audit_bsm_token.c 2016-09-18 22:49:32 UTC (rev 8508)
@@ -30,7 +30,7 @@
* 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_token.c#93
+ * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#99
*/
#include <sys/cdefs.h>
@@ -68,6 +68,57 @@
/*
* token ID 1 byte
+ * success/failure 1 byte
+ * privstrlen 2 bytes
+ * privstr N bytes + 1 (\0 byte)
+ */
+token_t *
+au_to_upriv(char sorf, char *priv)
+{
+ u_int16_t textlen;
+ u_char *dptr;
+ token_t *t;
+
+ textlen = strlen(priv) + 1;
+ GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_char) +
+ sizeof(u_int16_t) + textlen);
+
+ ADD_U_CHAR(dptr, AUT_UPRIV);
+ ADD_U_CHAR(dptr, sorf);
+ ADD_U_INT16(dptr, textlen);
+ ADD_STRING(dptr, priv, textlen);
+ return (t);
+}
+
+/*
+ * token ID 1 byte
+ * privtstrlen 2 bytes
+ * privtstr N bytes + 1
+ * privstrlen 2 bytes
+ * privstr N bytes + 1
+ */
+token_t *
+au_to_privset(char *privtypestr, char *privstr)
+{
+ u_int16_t type_len, priv_len;
+ u_char *dptr;
+ token_t *t;
+
+ type_len = strlen(privtypestr) + 1;
+ priv_len = strlen(privstr) + 1;
+ GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) +
+ sizeof(u_int16_t) + type_len + priv_len);
+
+ ADD_U_CHAR(dptr, AUT_PRIV);
+ ADD_U_INT16(dptr, type_len);
+ ADD_STRING(dptr, privtypestr, type_len);
+ ADD_U_INT16(dptr, priv_len);
+ ADD_STRING(dptr, privstr, priv_len);
+ return (t);
+}
+
+/*
+ * token ID 1 byte
* argument # 1 byte
* argument value 4 bytes/8 bytes (32-bit/64-bit value)
* text length 2 bytes
@@ -1204,9 +1255,9 @@
auinfo.ai_asid, &auinfo.ai_termid));
} else {
/* getaudit_addr(2) failed for some other reason. */
- return (NULL);
+ return (NULL);
}
- }
+ }
return (au_to_subject32_ex(aia.ai_auid, geteuid(), getegid(), getuid(),
getgid(), getpid(), aia.ai_asid, &aia.ai_termid));
@@ -1438,7 +1489,7 @@
ADD_U_INT32(dptr, tm.tv_sec);
ADD_U_INT32(dptr, timems); /* We need time in ms. */
- return (t);
+ return (t);
}
token_t *
More information about the Midnightbsd-cvs
mailing list