From owner-p4-projects@FreeBSD.ORG Wed Nov 12 16:53:04 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3FAB51065679; Wed, 12 Nov 2008 16:53:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0B381065676 for ; Wed, 12 Nov 2008 16:53:03 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C36268FC1D for ; Wed, 12 Nov 2008 16:53:03 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mACGr3ia062515 for ; Wed, 12 Nov 2008 16:53:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mACGr3aI062513 for perforce@freebsd.org; Wed, 12 Nov 2008 16:53:03 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 12 Nov 2008 16:53:03 GMT Message-Id: <200811121653.mACGr3aI062513@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 152876 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: Wed, 12 Nov 2008 16:53:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=152876 Change 152876 by rwatson@rwatson_cinnamon on 2008/11/12 16:52:21 When generating return tokens, convert from the local error space to the BSM error space. When interpreting return tokens, convert from the BSM error space to the local error space. Affected files ... .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#56 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#73 edit .. //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#3 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#56 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2004 Apple Inc. + * Copyright (c) 2004-2008 Apple Inc. * Copyright (c) 2005 SPARTA, Inc. * Copyright (c) 2006 Robert N. M. Watson * Copyright (c) 2006 Martin Voros @@ -32,7 +32,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_io.c#55 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#56 $ */ #include @@ -2946,6 +2946,7 @@ READ_TOKEN_U_CHAR(buf, len, tok->tt.ret32.status, tok->len, err); if (err) return (-1); + tok->tt.ret32.status = au_bsm_to_errno(tok->tt.ret32.status); READ_TOKEN_U_INT32(buf, len, tok->tt.ret32.ret, tok->len, err); if (err) @@ -2984,6 +2985,7 @@ READ_TOKEN_U_CHAR(buf, len, tok->tt.ret64.err, tok->len, err); if (err) return (-1); + tok->tt.ret64.err = au_bsm_to_errno(tok->tt.ret64.err); READ_TOKEN_U_INT64(buf, len, tok->tt.ret64.val, tok->len, err); if (err) ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#73 (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#72 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#73 $ */ #include @@ -846,6 +846,7 @@ if (t == NULL) return (NULL); + status = au_errno_to_bsm(status); ADD_U_CHAR(dptr, AUT_RETURN32); ADD_U_CHAR(dptr, status); ADD_U_INT32(dptr, ret); @@ -863,6 +864,7 @@ if (t == NULL) return (NULL); + status = au_errno_to_bsm(status); ADD_U_CHAR(dptr, AUT_RETURN64); ADD_U_CHAR(dptr, status); ADD_U_INT64(dptr, ret); ==== //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#3 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 Apple Inc. + * Copyright (c) 2005-2008 Apple Inc. * Copyright (c) 2005 SPARTA, Inc. * All rights reserved. * @@ -30,7 +30,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_internal.h#2 $ + * $P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#3 $ */ #ifndef _AUDIT_INTERNAL_H @@ -114,4 +114,10 @@ #define ADD_STRING(loc, data, size) ADD_MEM(loc, data, size) +/* + * Map between BSM and local constants for error numbers. + */ +int au_bsm_to_errno(u_char bsm_error); +u_char au_errno_to_bsm(int error); + #endif /* !_AUDIT_INTERNAL_H_ */