From owner-p4-projects@FreeBSD.ORG Sat Jan 21 13:13:53 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 033F616A422; Sat, 21 Jan 2006 13:13:53 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B07E16A41F for ; Sat, 21 Jan 2006 13:13:52 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B60643D45 for ; Sat, 21 Jan 2006 13:13:52 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k0LDDqXG080450 for ; Sat, 21 Jan 2006 13:13:52 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k0LDDphj080447 for perforce@freebsd.org; Sat, 21 Jan 2006 13:13:51 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 21 Jan 2006 13:13:51 GMT Message-Id: <200601211313.k0LDDphj080447@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90070 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2006 13:13:53 -0000 http://perforce.freebsd.org/chv.cgi?CH=90070 Change 90070 by rwatson@rwatson_sesame on 2006/01/21 13:12:53 Be less tolerant of NULL pointer arguments to token generation functions: Solaris will core dump apps that try this, and it adds significant complexity for cases not actually supported by the API. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#25 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#25 (text+ko) ==== @@ -83,11 +83,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } - textlen = strlen(text); textlen += 1; @@ -113,11 +108,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } - textlen = strlen(text); textlen += 1; @@ -161,11 +151,6 @@ u_int16_t pad0_16 = 0; u_int16_t pad0_32 = 0; - if (vni == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 2*sizeof(u_int16_t) + 3*sizeof(u_int32_t) + sizeof(u_int64_t) + sizeof(u_int32_t)); if (t == NULL) @@ -233,11 +218,6 @@ u_char *dptr = NULL; size_t datasize, totdata; - if (p == NULL) { - errno = EINVAL; - return (NULL); - } - /* Determine the size of the basic unit. */ switch (unit_type) { case AUR_BYTE: @@ -316,11 +296,6 @@ u_char *dptr = NULL; int i; - if (groups == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, n * 4 + 3); if (t == NULL) return (NULL); @@ -343,11 +318,6 @@ token_t *t; u_char *dptr = NULL; - if (internet_addr == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 5); if (t == NULL) return (NULL); @@ -370,11 +340,6 @@ u_char *dptr = NULL; u_int32_t type = AF_INET6; - if (internet_addr == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 21); if (t == NULL) return (NULL); @@ -399,11 +364,6 @@ token_t *t; u_char *dptr = NULL; - if (ip == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(struct ip)); if (t == NULL) return (NULL); @@ -457,12 +417,6 @@ u_char *dptr = NULL; u_int16_t pad0 = 0; - - if (perm == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 12 * sizeof(u_int16_t) + sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -507,7 +461,6 @@ token_t *t; u_char *dptr = NULL; - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t)); if (t == NULL) return (NULL); @@ -530,11 +483,6 @@ token_t *t; u_char *dptr = NULL; - if (data == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + sizeof(u_int16_t) + bytes); if (t == NULL) return (NULL); @@ -572,10 +520,6 @@ return (NULL); #endif - if (file == NULL) { - errno = EINVAL; - return (NULL); - } filelen = strlen(file); filelen += 1; @@ -607,10 +551,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } textlen = strlen(text); textlen += 1; @@ -637,10 +577,6 @@ u_char *dptr = NULL; u_int16_t textlen; - if (text == NULL) { - errno = EINVAL; - return (NULL); - } textlen = strlen(text); textlen += 1; @@ -675,11 +611,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -737,11 +668,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -903,9 +829,6 @@ token_t *t; u_char *dptr; - if (so == NULL) - return (NULL); - GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + strlen(so->sun_path) + 1); if (t == NULL) return (NULL); @@ -931,11 +854,6 @@ token_t *t; u_char *dptr = NULL; - if (so == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + sizeof(u_int32_t)); if (t == NULL) @@ -961,11 +879,6 @@ token_t *t; u_char *dptr = NULL; - if (so == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, 3 * sizeof(u_char) + sizeof(u_int16_t) + 4 * sizeof(u_int32_t)); if (t == NULL) @@ -1016,11 +929,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 9 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1078,11 +986,6 @@ token_t *t; u_char *dptr = NULL; - if (tid == NULL) { - errno = EINVAL; - return (NULL); - } - GET_TOKEN_AREA(t, dptr, sizeof(u_char) + 13 * sizeof(u_int32_t)); if (t == NULL) return (NULL); @@ -1155,11 +1058,6 @@ int i, count = 0; size_t totlen = 0; - if (args == NULL) { - errno = EINVAL; - return (NULL); - } - nextarg = *args; while (nextarg != NULL) { @@ -1201,11 +1099,6 @@ size_t totlen = 0; const char *nextenv; - if (env == NULL) { - errno = EINVAL; - return (NULL); - } - nextenv = *env; while (nextenv != NULL) {