From owner-trustedbsd-cvs@FreeBSD.ORG Sun Mar 5 18:38:02 2006 Return-Path: X-Original-To: trustedbsd-cvs@freebsd.org Delivered-To: trustedbsd-cvs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2B2F716A42B for ; Sun, 5 Mar 2006 18:38:02 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89CE843D48 for ; Sun, 5 Mar 2006 18:38:01 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by cyrus.watson.org (Postfix) with ESMTP id A178646BB5 for ; Sun, 5 Mar 2006 13:37:40 -0500 (EST) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 4A65057063; Sun, 5 Mar 2006 18:38:00 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 3744516A422; Sun, 5 Mar 2006 18:38:00 +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 EC1E316A423 for ; Sun, 5 Mar 2006 18:37:59 +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 98A1343D49 for ; Sun, 5 Mar 2006 18:37:59 +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 k25IbxmO074623 for ; Sun, 5 Mar 2006 18:37:59 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 k25IbxZg074620 for perforce@freebsd.org; Sun, 5 Mar 2006 18:37:59 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 5 Mar 2006 18:37:59 GMT Message-Id: <200603051837.k25IbxZg074620@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 92803 for review X-BeenThere: trustedbsd-cvs@FreeBSD.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: TrustedBSD CVS and Perforce commit message list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2006 18:38:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=92803 Change 92803 by rwatson@rwatson_peppercorn on 2006/03/05 18:37:45 Always read and write process32/subject32 addr/machine fields in network byte order, as they are interpreted as IP addresses. Affected files ... .. //depot/projects/trustedbsd/openbsm/HISTORY#6 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#36 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#46 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/HISTORY#6 (text+ko) ==== @@ -20,6 +20,8 @@ definition. Don't try to retrieve time zone information using gettimeofday(), as it's not needed, and introduces possible failure modes. +- Always read and write process32 and subject32 machine/addr fields in + network byte order. OpenBSM 1.0 alpha 5 @@ -147,4 +149,4 @@ to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/HISTORY#5 $ +$P4: //depot/projects/trustedbsd/openbsm/HISTORY#6 $ ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#36 (text+ko) ==== @@ -31,7 +31,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#35 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#36 $ */ #include @@ -1732,7 +1732,8 @@ if (err) return (-1); - READ_TOKEN_U_INT32(buf, len, tok->tt.proc32.tid.addr, tok->len, err); + READ_TOKEN_BYTES(buf, len, &tok->tt.proc32.tid.addr, + sizeof(tok->tt.proc32.tid.addr), tok->len, err); if (err) return (-1); ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#46 (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#45 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#46 $ */ #include @@ -645,7 +645,7 @@ ADD_U_INT32(dptr, pid); ADD_U_INT32(dptr, sid); ADD_U_INT32(dptr, tid->port); - ADD_U_INT32(dptr, tid->machine); + ADD_MEM(dptr, &tid->machine, sizeof(u_int32_t)); return (t); } @@ -918,7 +918,7 @@ ADD_U_INT32(dptr, pid); ADD_U_INT32(dptr, sid); ADD_U_INT32(dptr, tid->port); - ADD_U_INT32(dptr, tid->machine); + ADD_MEM(dptr, &tid->machine, sizeof(u_int32_t)); return (t); }