Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Oct 2008 14:25:12 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 150964 for review
Message-ID:  <200810041425.m94EPCjL029696@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=150964

Change 150964 by rwatson@rwatson_fledge on 2008/10/04 14:24:43

	Remove (and don't use) compatibility token constant names that were
	inherited from Darwin; always prefer the BSM token names (AUT_*).
	
	Synchronize our token type list to the BSM token type list -- add 
	one or two we didn't have, replace one that was in conflict, remove
	one or two Trusted Solaris ones that don't appear to be mainstream
	(and that we didn't implement anyway).

Affected files ...

.. //depot/projects/trustedbsd/openbsm/NEWS#7 edit
.. //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#28 edit
.. //depot/projects/trustedbsd/openbsm/bin/praudit/praudit.c#14 edit
.. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#70 edit
.. //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#2 edit

Differences ...

==== //depot/projects/trustedbsd/openbsm/NEWS#7 (text+ko) ====

@@ -15,6 +15,8 @@
   Submitted by Stacey Son.
 - Various strcpy()'s/strcat()'s have been changed to strlcpy()'s/strlcat()'s
   or asprintf().  Added compat/strlcpy.h for Linux.
+- Remove compatibility defines for old Darwin token constant names; now only
+  BSM token names are provided and used.
 
 OpenBSM 1.1 alpha 1
 
@@ -339,4 +341,4 @@
   to support reloading of kernel event table.
 - Allow comments in /etc/security configuration files.
 
-$P4: //depot/projects/trustedbsd/openbsm/NEWS#6 $
+$P4: //depot/projects/trustedbsd/openbsm/NEWS#7 $

==== //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#28 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2004 Apple Inc.
+ * Copyright (c) 2004-2008 Apple Inc.
  * All rights reserved.
  * 
  * Redistribution and use in source and binary forms, with or without
@@ -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/bin/auditreduce/auditreduce.c#27 $
+ * $P4: //depot/projects/trustedbsd/openbsm/bin/auditreduce/auditreduce.c#28 $
  */
 
 /* 
@@ -514,62 +514,39 @@
 			 * selection criteria.
 			 */
 			switch(tok.id) {
-			case AU_HEADER_32_TOKEN:
+			case AUT_HEADER32:
 					selected = select_hdr32(tok,
 					    &optchkd);
 					bcopy(&tok, &tok_hdr32_copy,
 					    sizeof(tok));
 					break;
 
-			case AU_PROCESS_32_TOKEN:
+			case AUT_PROCESS32:
 					selected = select_proc32(tok,
 					    &optchkd);
 					break;
 
-			case AU_SUBJECT_32_TOKEN:
+			case AUT_SUBJECT32:
 					selected = select_subj32(tok,
 					    &optchkd);
 					break;
 
-			case AU_IPC_TOKEN:
+			case AUT_IPC:
 					selected = select_ipcobj(
 					    tok.tt.ipc.type, tok.tt.ipc.id,
 					    &optchkd); 
 					break;
 
-			case AU_FILE_TOKEN:
-					selected = select_filepath(
-					    tok.tt.file.name, &optchkd);
-					break;
-
-			case AU_PATH_TOKEN:
+			case AUT_PATH:
 					selected = select_filepath(
 					    tok.tt.path.path, &optchkd);
 					break;	
 
-			case AU_RETURN_32_TOKEN:
+			case AUT_RETURN32:
 				selected = select_return32(tok,
 				    tok_hdr32_copy, &optchkd);
 				break;
 
-			/* 
-			 * The following tokens dont have any relevant
-			 * attributes that we can select upon.
-			 */
-			case AU_TRAILER_TOKEN:
-			case AU_ARG32_TOKEN:
-			case AU_ATTR32_TOKEN:
-			case AU_EXIT_TOKEN:
-			case AU_NEWGROUPS_TOKEN:
-			case AU_IN_ADDR_TOKEN:
-			case AU_IP_TOKEN:
-			case AU_IPCPERM_TOKEN:
-			case AU_IPORT_TOKEN:
-			case AU_OPAQUE_TOKEN:
-			case AU_SEQ_TOKEN:
-			case AU_TEXT_TOKEN:
-			case AU_ARB_TOKEN:
-			case AU_SOCK_TOKEN:
 			default:
 				break;
 			}

==== //depot/projects/trustedbsd/openbsm/bin/praudit/praudit.c#14 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2004 Apple Inc.
+ * Copyright (c) 2004-2008 Apple Inc.
  * Copyright (c) 2006 Martin Voros
  * All rights reserved.
  *
@@ -27,7 +27,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/bin/praudit/praudit.c#13 $
+ * $P4: //depot/projects/trustedbsd/openbsm/bin/praudit/praudit.c#14 $
  */
 
 /*
@@ -80,7 +80,7 @@
 		/* Record must begin with a header token. */
 		do {
 			type = fgetc(fp);
-		} while(type != AU_HEADER_32_TOKEN);
+		} while(type != AUT_HEADER32);
 		ungetc(type, fp);
 	}
 

==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#70 (text+ko) ====

@@ -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#69 $
+ * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#70 $
  */
 
 #include <sys/types.h>
@@ -912,7 +912,7 @@
 	if (t == NULL)
 		return (NULL);
 
-	ADD_U_CHAR(dptr, AU_SOCK_UNIX_TOKEN);
+	ADD_U_CHAR(dptr, AUT_SOCKUNIX);
 	/* BSM token has two bytes for family */
 	ADD_U_CHAR(dptr, 0);
 	ADD_U_CHAR(dptr, so->sun_family);

==== //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#2 (text+ko) ====

@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2005 Apple Inc.
+ * Copyright (c) 2005-2008 Apple Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +26,7 @@
  * (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/sys/bsm/audit_record.h#1 $
+ * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_record.h#2 $
  */
 
 #ifndef _BSM_AUDIT_RECORD_H_
@@ -47,7 +47,7 @@
 #define	AUT_IPC			0x22
 #define	AUT_PATH		0x23
 #define	AUT_SUBJECT32		0x24
-#define	AUT_SERVER32		0x25
+#define	AUT_XATPATH		0x25
 #define	AUT_PROCESS32		0x26
 #define	AUT_RETURN32		0x27
 #define	AUT_TEXT		0x28
@@ -63,9 +63,7 @@
 #define	AUT_IPC_PERM		0x32
 #define	AUT_LABEL		0x33
 #define	AUT_GROUPS		0x34
-#define	AUT_ILABEL		0x35
-#define	AUT_SLABEL		0x36
-#define	AUT_CLEAR		0x37
+#define	AUT_ACE			0x35
 #define	AUT_PRIV		0x38
 #define	AUT_UPRIV		0x39
 #define	AUT_LIAISON		0x3a
@@ -73,22 +71,28 @@
 #define	AUT_EXEC_ARGS		0x3c
 #define	AUT_EXEC_ENV		0x3d
 #define	AUT_ATTR32		0x3e
-/* #define	AUT_????	0x3f */
+#define	AUT_UNAUTH		0x3f
 #define	AUT_XATOM		0x40
 #define	AUT_XOBJ		0x41
 #define	AUT_XPROTO		0x42
 #define	AUT_XSELECT		0x43
-/* XXXRW: Additional X11 tokens not defined? */
+#define	AUT_XCOLORMAP		0x44
+#define	AUT_XCURSOR		0x45
+#define	AUT_XFONT		0x46
+#define	AUT_XGC			0x47
+#define	AUT_XPIXMAP		0x48
+#define	AUT_XPROPERTY		0x49
+#define	AUT_XWINDOW		0x4a
+#define	AUT_XCLIENT		0x4b
 #define	AUT_CMD			0x51
 #define	AUT_EXIT		0x52
 #define	AUT_ZONENAME		0x60
-/* XXXRW: OpenBSM AUT_HOST 0x70? */
+#define	AUT_HOST		0x70
 #define	AUT_ARG64		0x71
 #define	AUT_RETURN64		0x72
 #define	AUT_ATTR64		0x73
 #define	AUT_HEADER64		0x74
 #define	AUT_SUBJECT64		0x75
-#define	AUT_SERVER64		0x76
 #define	AUT_PROCESS64		0x77
 #define	AUT_OTHER_FILE64	0x78
 #define	AUT_HEADER64_EX		0x79
@@ -107,55 +111,10 @@
 #define	AUT_ARG			AUT_ARG32
 #define	AUT_RETURN		AUT_RETURN32
 #define	AUT_SUBJECT		AUT_SUBJECT32
-#define	AUT_SERVER		AUT_SERVER32
 #define	AUT_PROCESS		AUT_PROCESS32
 #define	AUT_OTHER_FILE		AUT_OTHER_FILE32
 
 /*
- * Darwin's bsm distribution uses the following non-BSM token name defines.
- * We provide them for a single OpenBSM release for compatibility reasons.
- */
-#define	AU_FILE_TOKEN		AUT_OTHER_FILE32
-#define	AU_TRAILER_TOKEN	AUT_TRAILER
-#define	AU_HEADER_32_TOKEN	AUT_HEADER32
-#define	AU_DATA_TOKEN		AUT_DATA
-#define	AU_ARB_TOKEN		AUT_DATA
-#define	AU_IPC_TOKEN		AUT_IPC
-#define	AU_PATH_TOKEN		AUT_PATH
-#define	AU_SUBJECT_32_TOKEN	AUT_SUBJECT32
-#define	AU_PROCESS_32_TOKEN	AUT_PROCESS32
-#define	AU_RETURN_32_TOKEN	AUT_RETURN32
-#define	AU_TEXT_TOKEN		AUT_TEXT
-#define	AU_OPAQUE_TOKEN		AUT_OPAQUE
-#define	AU_IN_ADDR_TOKEN	AUT_IN_ADDR
-#define	AU_IP_TOKEN		AUT_IP
-#define	AU_IPORT_TOKEN		AUT_IPORT
-#define	AU_ARG32_TOKEN		AUT_ARG32
-#define	AU_SOCK_TOKEN		AUT_SOCKET
-#define	AU_SEQ_TOKEN		AUT_SEQ
-#define	AU_ATTR_TOKEN		AUT_ATTR
-#define	AU_IPCPERM_TOKEN	AUT_IPC_PERM
-#define	AU_NEWGROUPS_TOKEN	AUT_NEWGROUPS
-#define	AU_EXEC_ARG_TOKEN	AUT_EXEC_ARGS
-#define	AU_EXEC_ENV_TOKEN	AUT_EXEC_ENV
-#define	AU_ATTR32_TOKEN		AUT_ATTR32
-#define	AU_CMD_TOKEN		AUT_CMD
-#define	AU_EXIT_TOKEN		AUT_EXIT
-#define	AU_ARG64_TOKEN		AUT_ARG64
-#define	AU_RETURN_64_TOKEN	AUT_RETURN64
-#define	AU_ATTR64_TOKEN		AUT_ATTR64
-#define	AU_HEADER_64_TOKEN	AUT_HEADER64
-#define	AU_SUBJECT_64_TOKEN	AUT_SUBJECT64
-#define	AU_PROCESS_64_TOKEN	AUT_PROCESS64
-#define	AU_HEADER_64_EX_TOKEN	AUT_HEADER64_EX
-#define	AU_SUBJECT_32_EX_TOKEN	AUT_SUBJECT32_EX
-#define	AU_PROCESS_32_EX_TOKEN	AUT_PROCESS32_EX
-#define	AU_SUBJECT_64_EX_TOKEN	AUT_SUBJECT64_EX
-#define	AU_PROCESS_64_EX_TOKEN	AUT_PROCESS64_EX
-#define	AU_IN_ADDR_EX_TOKEN	AUT_IN_ADDR_EX
-#define	AU_SOCK_32_EX_TOKEN	AUT_SOCKET_EX
-
-/*
  * The values for the following token ids are not defined by BSM.
  *
  * XXXRW: Not sure how to handle these in OpenBSM yet, but I'll give them
@@ -165,9 +124,6 @@
 #define	AUT_SOCKINET32		0x80		/* XXX */
 #define	AUT_SOCKINET128		0x81		/* XXX */
 #define	AUT_SOCKUNIX		0x82		/* XXX */
-#define	AU_SOCK_INET_32_TOKEN	AUT_SOCKINET32
-#define	AU_SOCK_INET_128_TOKEN	AUT_SOCKINET128
-#define	AU_SOCK_UNIX_TOKEN	AUT_SOCKUNIX
 
 /* print values for the arbitrary token */
 #define AUP_BINARY      0



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