Date: Mon, 21 Oct 2002 10:59:17 -0700 (PDT) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 19811 for review Message-ID: <200210211759.g9LHxHY6020136@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210211759.g9LHxHY6020136>