From: Martin R. <mr...@us...> - 2005-11-08 16:50:17
|
Update of /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22391/selinux-testsuite/tests/execute_no_trans Modified Files: selinux_execute_no_trans.sh Log Message: Security test updates from Joy Index: selinux_execute_no_trans.sh =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/selinux_execute_no_trans.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** selinux_execute_no_trans.sh 14 Jul 2005 18:21:34 -0000 1.2 --- selinux_execute_no_trans.sh 8 Nov 2005 16:49:34 -0000 1.3 *************** *** 12,16 **** setup() { - LTPTMP="/tmp/selinux" export TCID="setup" export TST_COUNT=0 --- 12,15 ---- *************** *** 18,22 **** # Clean up from a previous run ! rm -f $LTPTMP/true 2>&1 } --- 17,21 ---- # Clean up from a previous run ! rm -f $SELINUXTMPDIR/true 2>&1 } *************** *** 28,43 **** # Set up a program with the denied type for this domain. ! cp /bin/true $LTPTMP/true ! chcon -t test_execute_notrans_denied_t $LTPTMP/true # Verify that test_execute_notrans_t cannot execute the denied type. ! runcon -t test_execute_notrans_t -- bash -c $LTPTMP/true 2>&1 RC=$? # this should fail if [ $RC -ne 0 ] then ! tst_resm TPASS "Test #1: execute_no_trans passed." RC=0 else ! tst_resm TFAIL "Test #1: execute_no_trans failed." RC=1 fi --- 27,42 ---- # Set up a program with the denied type for this domain. ! cp /bin/true $SELINUXTMPDIR/true ! chcon -t test_execute_notrans_denied_t $SELINUXTMPDIR/true # Verify that test_execute_notrans_t cannot execute the denied type. ! runcon -t test_execute_notrans_t -- bash -c $SELINUXTMPDIR/true 2>&1 RC=$? # this should fail if [ $RC -ne 0 ] then ! echo "$TCID PASS : execute_no_trans passed." RC=0 else ! echo "$TCID FAIL : execute_no_trans failed." RC=1 fi *************** *** 52,65 **** # Set up a program with the allowed type for this domain. ! chcon -t test_execute_notrans_allowed_t $LTPTMP/true # Verify that test_execute_notrans_t can execute the allowed type. ! runcon -t test_execute_notrans_t -- bash -c $LTPTMP/true 2>&1 RC=$? if [ $RC -ne 0 ] then ! tst_resm TFAIL "Test #2: execute_no_trans failed." else ! tst_resm TPASS "Test #2: execute_no_trans passed." fi return $RC --- 51,64 ---- # Set up a program with the allowed type for this domain. ! chcon -t test_execute_notrans_allowed_t $SELINUXTMPDIR/true # Verify that test_execute_notrans_t can execute the allowed type. ! runcon -t test_execute_notrans_t -- bash -c $SELINUXTMPDIR/true 2>&1 RC=$? if [ $RC -ne 0 ] then ! echo "$TCID FAIL : execute_no_trans failed." else ! echo "$TCID PASS : execute_no_trans passed." fi return $RC *************** *** 69,73 **** { # Cleanup. ! rm -f $LTPTMP/true } --- 68,72 ---- { # Cleanup. ! rm -f $SELINUXTMPDIR/true } |