~ubuntu-branches/ubuntu/trusty/apparmor/trusty-updates

« back to all changes in this revision

Viewing changes to .pc/test-signal-rules.patch/tests/regression/apparmor/exec.sh

  • Committer: Package Import Robot
  • Author(s): Jamie Strandboge
  • Date: 2014-04-04 01:07:24 UTC
  • Revision ID: package-import@ubuntu.com-20140404010724-n7pyk2cd5er3gi6m
Tags: 2.8.95~2430-0ubuntu5
debian/control: add versioned Breaks to apparmor for lxc, libvirt-bin,
lightdm and apparmor-easyprof-ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
#       Copyright (C) 2002-2005 Novell/SUSE
 
3
#
 
4
#       This program is free software; you can redistribute it and/or
 
5
#       modify it under the terms of the GNU General Public License as
 
6
#       published by the Free Software Foundation, version 2 of the
 
7
#       License.
 
8
 
 
9
#=NAME exec
 
10
#=DESCRIPTION Runs exec() through ux, ix & px functionality
 
11
 
 
12
pwd=`dirname $0`
 
13
pwd=`cd $pwd ; /bin/pwd`
 
14
 
 
15
bin=$pwd
 
16
 
 
17
. $bin/prologue.inc
 
18
 
 
19
file=/bin/true
 
20
ok_ix_perm=rix
 
21
badperm=r
 
22
ok_ux_perm=ux
 
23
ok_px_perm=px
 
24
bad_mx_perm=rm
 
25
 
 
26
# PASS TEST - inherited
 
27
 
 
28
genprofile $file:$ok_ix_perm
 
29
 
 
30
runchecktest "EXEC with ix" pass $file
 
31
 
 
32
# PASS TEST - unconfined
 
33
 
 
34
genprofile $file:$ok_ux_perm
 
35
 
 
36
runchecktest "EXEC with ux" pass $file
 
37
 
 
38
# PASS TEST - profiled
 
39
 
 
40
genprofile $file:$ok_px_perm -- image=$file
 
41
 
 
42
runchecktest "EXEC with px" pass $file
 
43
 
 
44
# FAIL TEST - px/no profile
 
45
 
 
46
genprofile $file:$ok_px_perm
 
47
 
 
48
runchecktest "EXEC with px - no profile" fail $file
 
49
 
 
50
# NOLINK PERMTEST
 
51
 
 
52
genprofile $file:$badperm
 
53
 
 
54
runchecktest "EXEC no x" fail $file
 
55
 
 
56
# MMAP exec
 
57
 
 
58
genprofile $file:$bad_mx_perm
 
59
 
 
60
runchecktest "EXEC mmap x" fail $file
 
61
 
 
62
# UNCONFINED -> CONFINED
 
63
 
 
64
genprofile image=$file
 
65
runchecktest "EXEC unconfined -> confined" pass $file
 
66
 
 
67
# UNCONFINED -> CONFINED no access to self binary
 
68
 
 
69
genprofile -I image=$file
 
70
runchecktest "EXEC unconfined -> confined/no access to self" pass $file