apparmor/tests/regression/subdomain/exec.sh
Steve Beattie 6d3e74907d Import the rest of the core functionality of the internal apparmor
development tree (trunk branch). From svn repo version 6381.
2006-04-11 21:52:54 +00:00

55 lines
1,018 B
Bash
Executable file

#! /bin/bash
# $Id: exec.sh 6040 2006-01-11 00:15:48Z tonyj $
# Copyright (C) 2002-2005 Novell/SUSE
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, version 2 of the
# License.
#=NAME exec
#=DESCRIPTION Runs exec() through ux, ix & px functionality
pwd=`dirname $0`
pwd=`cd $pwd ; /bin/pwd`
bin=$pwd
. $bin/prologue.inc
file=/bin/true
ok_ix_perm=ix
badperm=r
ok_ux_perm=ux
ok_px_perm=px
# PASS TEST - inherited
genprofile $file:$ok_ix_perm
runchecktest "EXEC with ix" pass $file
# PASS TEST - unconstrained
genprofile $file:$ok_ux_perm
runchecktest "EXEC with ux" pass $file
# PASS TEST - profiled
genprofile $file:$ok_px_perm -- image=$file
runchecktest "EXEC with px" pass $file
# FAIL TEST - px/no profile
genprofile $file:$ok_px_perm
runchecktest "EXEC with px - no profile" fail $file
# NOLINK PERMTEST
genprofile $file:$badperm
runchecktest "EXEC no x" fail $file