~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to tests/regression/subdomain/fork.sh

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/bash
2
 
# $Id: fork.sh 61 2006-05-19 18:32:14Z steve-beattie $
3
 
 
4
 
#       Copyright (C) 2002-2005 Novell/SUSE
5
 
#
6
 
#       This program is free software; you can redistribute it and/or
7
 
#       modify it under the terms of the GNU General Public License as
8
 
#       published by the Free Software Foundation, version 2 of the
9
 
#       License.
10
 
 
11
 
#=NAME fork
12
 
#=DESCRIPTION 
13
 
# Verifies that profiles are duplicated correctly for fork (the subtask 
14
 
# receives a copy of it's parents profile).  The test attempts to access the 
15
 
# files passed as arguments for both a parent and a child.    The test is 
16
 
# repeated for permissive and restrictive profiles.
17
 
#=END
18
 
 
19
 
pwd=`dirname $0`
20
 
pwd=`cd $pwd ; /bin/pwd`
21
 
 
22
 
bin=$pwd
23
 
 
24
 
. $bin/prologue.inc
25
 
 
26
 
file1=$tmpdir/file1
27
 
file2=$tmpdir/file2
28
 
file3=$tmpdir/file3
29
 
cap=ipc_owner
30
 
okperm=rw
31
 
badperm=r
32
 
 
33
 
touch $file1 $file2 $file3
34
 
 
35
 
# TEST1
36
 
 
37
 
genprofile cap:$cap $file1:$okperm $file2:$okperm $file3:$okperm
38
 
 
39
 
runchecktest "FORK with rw" pass $file1 $file2 $file3
40
 
 
41
 
# TEST2.  All will fail, but parent and child will equally fail
42
 
 
43
 
genprofile cap:$cap $file1:$badperm $file2:$badperm $file3:$badperm
44
 
 
45
 
runchecktest "FORK w/o w" pass $file1 $file2 $file3
46
 
 
47
 
# TEST3.  Some pass, some fail, but parent and child will equally fail
48
 
 
49
 
genprofile cap:$cap $file1:$badperm $file2:$okperm $file3:$badperm
50
 
 
51
 
runchecktest "FORK mixed" pass $file1 $file2 $file3