From owner-p4-projects Mon Oct 21 10:59:51 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7269637B404; Mon, 21 Oct 2002 10:59:48 -0700 (PDT) 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 0A05E37B401 for ; Mon, 21 Oct 2002 10:59:48 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DA0A43E6A for ; Mon, 21 Oct 2002 10:59:47 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9LHxImV020139 for ; Mon, 21 Oct 2002 10:59:18 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9LHxHY6020136 for perforce@freebsd.org; Mon, 21 Oct 2002 10:59:17 -0700 (PDT) Date: Mon, 21 Oct 2002 10:59:17 -0700 (PDT) Message-Id: <200210211759.g9LHxHY6020136@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 Subject: PERFORCE change 19811 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=19811 Change 19811 by rwatson@rwatson_paprika on 2002/10/21 10:58:37 No need to explicitly copy compartment arrays: structure assignment will copy all members. Affected files ... .. //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#144 edit .. //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#125 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/security/mac_biba/mac_biba.c#144 (text+ko) ==== @@ -432,16 +432,8 @@ KASSERT((labelfrom->mb_flags & MAC_BIBA_FLAG_RANGE) != 0, ("mac_biba_copy_range: labelfrom not range")); - memcpy(labelto->mb_rangelow.mbe_compartments, - labelfrom->mb_rangelow.mbe_compartments, - sizeof(labelfrom->mb_rangelow.mbe_compartments)); labelto->mb_rangelow = labelfrom->mb_rangelow; - - memcpy(labelto->mb_rangehigh.mbe_compartments, - labelfrom->mb_rangehigh.mbe_compartments, - sizeof(labelfrom->mb_rangehigh.mbe_compartments)); labelto->mb_rangehigh = labelfrom->mb_rangehigh; - labelto->mb_flags |= MAC_BIBA_FLAG_RANGE; } @@ -452,9 +444,6 @@ KASSERT((labelfrom->mb_flags & MAC_BIBA_FLAG_SINGLE) != 0, ("mac_biba_copy_single: labelfrom not single")); - memcpy(labelto->mb_single.mbe_compartments, - labelfrom->mb_single.mbe_compartments, - sizeof(labelfrom->mb_single.mbe_compartments)); labelto->mb_single = labelfrom->mb_single; labelto->mb_flags |= MAC_BIBA_FLAG_SINGLE; } ==== //depot/projects/trustedbsd/mac/sys/security/mac_mls/mac_mls.c#125 (text+ko) ==== @@ -421,16 +421,8 @@ KASSERT((labelfrom->mm_flags & MAC_MLS_FLAG_RANGE) != 0, ("mac_mls_copy_range: labelfrom not range")); - memcpy(labelto->mm_rangelow.mme_compartments, - labelfrom->mm_rangelow.mme_compartments, - sizeof(labelfrom->mm_rangelow.mme_compartments)); labelto->mm_rangelow = labelfrom->mm_rangelow; - - memcpy(labelto->mm_rangehigh.mme_compartments, - labelfrom->mm_rangehigh.mme_compartments, - sizeof(labelfrom->mm_rangehigh.mme_compartments)); labelto->mm_rangehigh = labelfrom->mm_rangehigh; - labelto->mm_flags |= MAC_MLS_FLAG_RANGE; } @@ -441,11 +433,7 @@ KASSERT((labelfrom->mm_flags & MAC_MLS_FLAG_SINGLE) != 0, ("mac_mls_copy_single: labelfrom not single")); - memcpy(labelto->mm_single.mme_compartments, - labelfrom->mm_single.mme_compartments, - sizeof(labelfrom->mm_single.mme_compartments)); labelto->mm_single = labelfrom->mm_single; - labelto->mm_flags |= MAC_MLS_FLAG_SINGLE; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message