PERFORCE change 89707 for review

Robert Watson rwatson at FreeBSD.org
Sat Jan 14 22:41:10 GMT 2006


http://perforce.freebsd.org/chv.cgi?CH=89707

Change 89707 by rwatson at rwatson_peppercorn on 2006/01/14 22:41:07

	Continue divergence of bsm_token.c:GET_TOKEN_AREA(): kernel malloc
	with M_WAITOK will not fail, so don't check for it.

Affected files ...

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

Differences ...

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

@@ -83,8 +83,6 @@
 
 	textlen = strlen(text);
 	GET_TOKEN_AREA(t, dptr, 9 + textlen);
-	if (t == NULL)
-		return (NULL);
 
 	textlen += 1;
 
@@ -110,8 +108,6 @@
 
 	textlen = strlen(text);
 	GET_TOKEN_AREA(t, dptr, 13 + textlen);
-	if (t == NULL)
-		return (NULL);
 
 	textlen += 1;
 
@@ -153,8 +149,6 @@
 	if (vni == NULL)
 		return (NULL);
 	GET_TOKEN_AREA(t, dptr, 29);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_ATTR32);
 
@@ -241,8 +235,6 @@
 	totdata = datasize * unit_count;
 
 	GET_TOKEN_AREA(t, dptr, totdata + 4);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_DATA);
 	ADD_U_CHAR(dptr, unit_print);
@@ -266,8 +258,6 @@
 	u_char *dptr = NULL;
 
 	GET_TOKEN_AREA(t, dptr, 9);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_EXIT);
 	ADD_U_INT32(dptr, err);
@@ -301,8 +291,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, n * 4 + 3);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_NEWGROUPS);
 	ADD_U_INT16(dptr, n);
@@ -326,8 +314,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 5);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_IN_ADDR);
 	ADD_U_INT32(dptr, internet_addr->s_addr);
@@ -351,8 +337,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 21);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_IN_ADDR_EX);
 	ADD_U_INT32(dptr, type);
@@ -378,8 +362,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 21);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_IP);
 	/*
@@ -403,8 +385,6 @@
 
 
 	GET_TOKEN_AREA(t, dptr, 6);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_IPC);
 	ADD_U_CHAR(dptr, type);
@@ -435,8 +415,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 29);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_IPC_PERM);
 
@@ -480,8 +458,6 @@
 
 
 	GET_TOKEN_AREA(t, dptr, 3);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_IPORT);
 	ADD_U_INT16(dptr, iport);
@@ -505,8 +481,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, bytes + 3);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_OPAQUE);
 	ADD_U_INT16(dptr, bytes);
@@ -547,8 +521,6 @@
 
 	filelen = strlen(file);
 	GET_TOKEN_AREA(t, dptr, filelen + 12);
-	if (t == NULL)
-		return (NULL);
 
 	filelen += 1;
 	timems = tm.tv_usec/1000;
@@ -579,8 +551,6 @@
 
 	textlen = strlen(text);
 	GET_TOKEN_AREA(t, dptr, textlen + 4);
-	if (t == NULL)
-		return (NULL);
 
 	textlen += 1;
 
@@ -608,8 +578,6 @@
 
 	textlen = strlen(text);
 	GET_TOKEN_AREA(t, dptr, textlen + 4);
-	if (t == NULL)
-		return (NULL);
 
 	textlen += 1;
 
@@ -644,8 +612,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 37);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_PROCESS32);
 	ADD_U_INT32(dptr, auid);
@@ -703,8 +669,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 53);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_PROCESS32_EX);
 	ADD_U_INT32(dptr, auid);
@@ -753,8 +717,6 @@
 	u_char *dptr = NULL;
 
 	GET_TOKEN_AREA(t, dptr, 6);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_RETURN32);
 	ADD_U_CHAR(dptr, status);
@@ -770,8 +732,6 @@
 	u_char *dptr = NULL;
 
 	GET_TOKEN_AREA(t, dptr, 10);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_RETURN64);
 	ADD_U_CHAR(dptr, status);
@@ -798,8 +758,6 @@
 	u_char *dptr = NULL;
 
 	GET_TOKEN_AREA(t, dptr, 5);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_SEQ);
 	ADD_U_INT32(dptr, audit_count);
@@ -838,8 +796,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 15);
-	if (t == NULL)
-		return (NULL);
 						 
 	ADD_U_CHAR(dptr, AU_SOCK_TOKEN);
 	/* Coerce the socket type into a short value */
@@ -895,8 +851,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 107);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AU_SOCK_UNIX_TOKEN);
 	/* BSM token has two bytes for family */
@@ -923,8 +877,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 9);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_SOCKINET32);
 	/*
@@ -950,8 +902,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 21);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_SOCKINET128);
 	/*
@@ -1002,8 +952,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 37);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_SUBJECT32);
 	ADD_U_INT32(dptr, auid);
@@ -1061,8 +1009,6 @@
 		return (NULL);
 
 	GET_TOKEN_AREA(t, dptr, 53);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_SUBJECT32_EX);
 	ADD_U_INT32(dptr, auid);
@@ -1146,8 +1092,6 @@
 	}
 
 	GET_TOKEN_AREA(t, dptr, 5 + totlen);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_EXEC_ARGS);
 	ADD_U_INT32(dptr, count);
@@ -1189,8 +1133,6 @@
 	}
 
 	GET_TOKEN_AREA(t, dptr, 5 + totlen);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_EXEC_ENV);
 	ADD_U_INT32(dptr, count);
@@ -1233,8 +1175,6 @@
 	/* XXXRW: else ...? */
 
 	GET_TOKEN_AREA(t, dptr, 18);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_HEADER32);
 	ADD_U_INT32(dptr, rec_size);
@@ -1286,8 +1226,6 @@
 	u_int16_t magic = TRAILER_PAD_MAGIC;
 
 	GET_TOKEN_AREA(t, dptr, 7);
-	if (t == NULL)
-		return (NULL);
 
 	ADD_U_CHAR(dptr, AUT_TRAILER);
 	ADD_U_INT16(dptr, magic);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list