Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Jan 2006 13:17:57 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 90071 for review
Message-ID:  <200601211317.k0LDHvO1080699@repoman.freebsd.org>

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

Change 90071 by rwatson@rwatson_sesame on 2006/01/21 13:17:29

	Reflect OpenBSM changes to token construction APIs in kernel,
	especially now that we only conditionally pass things to the
	constructors: don't accept NULL arguments.

Affected files ...

.. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_bsm_token.c#3 (text+ko) ====

@@ -78,9 +78,6 @@
 	u_char *dptr = NULL;
 	u_int16_t textlen;
 
-	if (text == NULL)
-		return (NULL);
-
 	textlen = strlen(text);
 	GET_TOKEN_AREA(t, dptr, 9 + textlen);
 
@@ -103,9 +100,6 @@
 	u_char *dptr = NULL;
 	u_int16_t textlen;
 
-	if (text == NULL)
-		return (NULL);
-
 	textlen = strlen(text);
 	GET_TOKEN_AREA(t, dptr, 13 + textlen);
 
@@ -146,8 +140,6 @@
 	u_int16_t pad0_16 = 0;
 	u_int16_t pad0_32 = 0;
 
-	if (vni == NULL)
-		return (NULL);
 	GET_TOKEN_AREA(t, dptr, 29);
 
 	ADD_U_CHAR(dptr, AUT_ATTR32);
@@ -211,9 +203,6 @@
 	u_char *dptr = NULL;
 	size_t datasize, totdata;
 
-	if (p == NULL)
-		return (NULL);
-
 	/* Determine the size of the basic unit. */
 	switch (unit_type) {
 	case AUR_BYTE:
@@ -287,9 +276,6 @@
 	u_char *dptr = NULL;
 	int i;
 
-	if (groups == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, n * 4 + 3);
 
 	ADD_U_CHAR(dptr, AUT_NEWGROUPS);
@@ -310,9 +296,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if (internet_addr == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 5);
 
 	ADD_U_CHAR(dptr, AUT_IN_ADDR);
@@ -333,9 +316,6 @@
 	u_char *dptr = NULL;
 	u_int32_t type = AF_INET6;
 
-	if (internet_addr == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 21);
 
 	ADD_U_CHAR(dptr, AUT_IN_ADDR_EX);
@@ -358,9 +338,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if (ip == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 21);
 
 	ADD_U_CHAR(dptr, AUT_IP);
@@ -383,7 +360,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-
 	GET_TOKEN_AREA(t, dptr, 6);
 
 	ADD_U_CHAR(dptr, AUT_IPC);
@@ -410,10 +386,6 @@
 	u_char *dptr = NULL;
 	u_int16_t pad0 = 0;
 
-
-	if (perm == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 29);
 
 	ADD_U_CHAR(dptr, AUT_IPC_PERM);
@@ -456,7 +428,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-
 	GET_TOKEN_AREA(t, dptr, 3);
 
 	ADD_U_CHAR(dptr, AUT_IPORT);
@@ -477,9 +448,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if ((data == NULL) || (bytes <= 0))
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, bytes + 3);
 
 	ADD_U_CHAR(dptr, AUT_OPAQUE);
@@ -516,9 +484,6 @@
 #endif
 	/* XXXRW: else ...? */
 
-	if (file == NULL)
-		return (NULL);
-
 	filelen = strlen(file);
 	GET_TOKEN_AREA(t, dptr, filelen + 12);
 
@@ -546,9 +511,6 @@
 	u_char *dptr = NULL;
 	u_int16_t textlen;
 
-	if (text == NULL)
-		return (NULL);
-
 	textlen = strlen(text);
 	GET_TOKEN_AREA(t, dptr, textlen + 4);
 
@@ -573,9 +535,6 @@
 	u_char *dptr = NULL;
 	u_int16_t textlen;
 
-	if (text == NULL)
-		return (NULL);
-
 	textlen = strlen(text);
 	GET_TOKEN_AREA(t, dptr, textlen + 4);
 
@@ -608,9 +567,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if (tid == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 37);
 
 	ADD_U_CHAR(dptr, AUT_PROCESS32);
@@ -665,9 +621,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if (tid == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 53);
 
 	ADD_U_CHAR(dptr, AUT_PROCESS32_EX);
@@ -792,9 +745,6 @@
 	u_char *dptr;
 	u_int16_t so_type;
 
-	if (soi == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 15);
 						 
 	ADD_U_CHAR(dptr, AU_SOCK_TOKEN);
@@ -847,9 +797,6 @@
 	token_t *t;
 	u_char *dptr;
 
-	if (so == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 107);
 
 	ADD_U_CHAR(dptr, AU_SOCK_UNIX_TOKEN);
@@ -873,9 +820,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if (so == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 9);
 
 	ADD_U_CHAR(dptr, AUT_SOCKINET32);
@@ -898,9 +842,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if (so == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 21);
 
 	ADD_U_CHAR(dptr, AUT_SOCKINET128);
@@ -948,9 +889,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if (tid == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 37);
 
 	ADD_U_CHAR(dptr, AUT_SUBJECT32);
@@ -1005,9 +943,6 @@
 	token_t *t;
 	u_char *dptr = NULL;
 
-	if (tid == NULL)
-		return (NULL);
-
 	GET_TOKEN_AREA(t, dptr, 53);
 
 	ADD_U_CHAR(dptr, AUT_SUBJECT32_EX);
@@ -1077,9 +1012,6 @@
 	int i, count = 0;
 	size_t totlen = 0;
 
-	if (args == NULL)
-		return (NULL);
-
 	nextarg = *args;
 
 	while (nextarg != NULL) {
@@ -1118,9 +1050,6 @@
 	size_t totlen = 0;
 	const char *nextenv;
 
-	if (env == NULL)
-		return (NULL);
-
 	nextenv = *env;
 
 	while (nextenv != NULL) {



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