From owner-p4-projects@FreeBSD.ORG Fri May 20 00:17:49 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2CF1C16A4CE; Fri, 20 May 2005 00:17:49 +0000 (GMT) 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 8155816A4DF for ; Fri, 20 May 2005 00:17:48 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55B0143D54 for ; Fri, 20 May 2005 00:17:48 +0000 (GMT) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j4K0HmwY080643 for ; Fri, 20 May 2005 00:17:48 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j4K0HmZP080639 for perforce@freebsd.org; Fri, 20 May 2005 00:17:48 GMT (envelope-from csjp@freebsd.org) Date: Fri, 20 May 2005 00:17:48 GMT Message-Id: <200505200017.j4K0HmZP080639@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Subject: PERFORCE change 77201 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2005 00:17:50 -0000 http://perforce.freebsd.org/chv.cgi?CH=77201 Change 77201 by csjp@csjp_xor on 2005/05/20 00:17:30 -replace a size_t for int in the checksum calculation routines -declare temp variable to stuff the size of the extended attribute in. We have to do this because for some reason the data type representing extended attribute size between vn_extattr_get and VOP_GETEXTATTR conflict. This makes the mac_chkexec build happy on AMD64 Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.c#8 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/mac_chkexec/mac_chkexec.c#8 (text+ko) ==== @@ -419,7 +419,7 @@ MD5_CTX md5ctx; u_quad_t b; int error, count; - size_t resid; + int resid; struct vattr va; caddr_t bufobj; @@ -465,7 +465,7 @@ SHA1_CTX sha1ctx; u_quad_t b; int error, count; - size_t resid; + int resid; struct vattr va; caddr_t bufobj; @@ -510,15 +510,20 @@ char *depends, **ap, *paths[10]; int error, i, npaths; struct nameidata nd; - size_t alen; - + int alen; + size_t ealen; + ASSERT_VOP_LOCKED(vp, "no vlock held"); error = VOP_GETEXTATTR(vp, MAC_CHKEXEC_ATTRN, MAC_CHKEXEC_DEP, - NULL, &alen, NOCRED, curthread); + NULL, &ealen, NOCRED, curthread); if (error != 0 && error == ENOATTR) return (0); else if (error) return (error); + /* XXX why are'nt extended attribute size specification types between + * VOP_GETEXTATTR and vn_extattr_get the same? + */ + alen = ealen; depends = malloc(alen + 1, M_CHKEXEC, M_WAITOK | M_ZERO); error = vn_extattr_get(vp, IO_NODELOCKED, MAC_CHKEXEC_ATTRN, MAC_CHKEXEC_DEP, &alen, depends, curthread);