Date: Wed, 16 Jan 2008 06:00:40 GMT From: Zhouyi ZHOU <zhouzhouyi@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 133398 for review Message-ID: <200801160600.m0G60eMD029385@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=133398 Change 133398 by zhouzhouyi@zhouzhouyi_mactest on 2008/01/16 06:00:39 Style Modification Affected files ... .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/debug/00.t#2 edit Differences ... ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/debug/00.t#2 (text+ko) ==== @@ -1,75 +1,72 @@ #!/bin/sh -# $FreeBSD: src/tools/regression/mactest/tests/debug/00.t,v 1.2 2007/01/25 20:50:02 zhouzhouyi Exp $ +# $FreeBSD$ -desc="test of bpf" +desc="test of ptrace" dir=`dirname $0` . ${dir}/../misc.sh -echo "1..4" +case "${os}" in +FreeBSD) + + mac_mls_support=`sysctl -n security.mac.mls.enabled 2>/dev/null` + mac_biba_support=`sysctl -n security.mac.biba.enabled 2>/dev/null` + mac_test_support=`sysctl -n security.mac.test.pseudoinit 2>/dev/null` + if [ "${mac_mls_support}" != "" ] && [ "${mac_biba_support}" != "" ] && + [ "${mac_test_support}" != "" ]; then #turn off all the switches -for i in `sysctl security.mac | grep "\.enabled"| - sed 's/\([a-z\.]*\.enabled\)\(:\ \)\([01]\)/\1/`; do -sysctl ${i}=0 -done + for i in `sysctl security.mac | grep "\.enabled"| + sed 's/\([a-z\.]*\.enabled\)\(:\ \)\([01]\)/\1/`; do + sysctl ${i}=0 >/dev/null + done -mac_mls_support=`sysctl -n security.mac.mls.enabled 2>/dev/null` -mac_biba_support=`sysctl -n security.mac.biba.enabled 2>/dev/null` -mac_test_support=`sysctl -n security.mac.test.pseudoinit 2>/dev/null` + if [ -f ${mactest_conf} ]; then + rm ${mactest_conf} + fi + touch ${mactest_conf} + setfmac "mls/equal,biba/equal" ${mactest_conf} + + echo "1..4" -if [ "${mac_mls_support}" != "" ] && [ "${mac_biba_support}" != "" ] && - [ "${mac_test_support}" != "" ]; then - dvplabel=`getfmac ".."| sed 's/\(\.\.:\ \)\([a-z\,\/]*\)/\2/`; - - - if [ -f ${mactest_conf} ]; then - rm ${mactest_conf} - fi - touch ${mactest_conf} - - - -############################################################# - t=`sysctl security.mac.mls.enabled=1` - t=`sysctl security.mac.biba.enabled=1` - echo "enabling mac/mls!" - echo "enabling mac/biba!" - - - + sysctl security.mac.mls.enabled=1 > /dev/null + sysctl security.mac.biba.enabled=1 > /dev/null #case 1: blp can search high - bizarretestexpect ${ptrace} "" \ - "error.attach.proc" -f ${mactest_conf} -t 1 -d "mls/5" \ - -a "mls/6" + bizarretestexpect ${ptrace} "" \ + "error.attach.proc" -f ${mactest_conf} -t 1 -d "mls/5" \ + -a "mls/6" #case 2: blp can attach low - bizarretestexpect ${ptrace} "" \ - "error.attach.proc" -f ${mactest_conf} -t 1 -d "mls/5" \ - -a "mls/4" + bizarretestexpect ${ptrace} "" \ + "error.attach.proc" -f ${mactest_conf} -t 1 -d "mls/5" \ + -a "mls/4" #case 3: biba can search low - bizarretestexpect ${ptrace} "" \ - "error.attach.proc" -f ${mactest_conf} -t 1 -d "biba/5" \ - -a "biba/4" + bizarretestexpect ${ptrace} "" \ + "error.attach.proc" -f ${mactest_conf} -t 1 -d "biba/5" \ + -a "biba/4" #case 4: biba can attach high - echo -n "pid = -2 mac_test_check_proc_debug with cr_label:" > ${mactest_conf} - echo "biba/4(low-high),mls/low(low-high) biba/5(low-high),mls/low(low-high)" \ - >> ${mactest_conf} - bizarretestexpect ${ptrace} "" \ - "error.attach.proc" -f ${mactest_conf} -t 1 -d "biba/4" \ - -a "biba/5" + echo -n "pid = -2 proc_check_debug:" > ${mactest_conf} + echo "biba/4(low-high),mls/low(low-high) biba/5(low-high),mls/low(low-high)" \ + >> ${mactest_conf} + bizarretestexpect ${ptrace} "" \ + "error.attach.proc" -f ${mactest_conf} -t 1 -d "biba/4" -a "biba/5" +#cleanup: + sysctl security.mac.mls.enabled=0 >/dev/null + sysctl security.mac.biba.enabled=0 > /dev/null + rm ${mactest_conf} +#ping received, no firewall + fi +#mac_mls mac_biba and mac_test support + ;; +*) + quick_exit + ;; +esac -#cleanup: - t=`sysctl security.mac.mls.enabled=0` - echo "disabling mac/mls!" - t=`sysctl security.mac.biba.enabled=0` - echo "disabling mac/biba!" - rm ${mactest_conf} -fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801160600.m0G60eMD029385>