~ubuntu-branches/ubuntu/raring/apparmor/raring

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-03-23 16:42:01 UTC
  • Revision ID: james.westby@ubuntu.com-20070323164201-jkax6f0oku087b7l
Tags: upstream-2.0.1+510.dfsg
ImportĀ upstreamĀ versionĀ 2.0.1+510.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
# $Id: readdir.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 readdir
 
12
#=DESCRIPTION 
 
13
# AppArmor requires 'r' permission on a directory in order for a confined task 
 
14
# to be able to read the directory contents.  This test verifies this.
 
15
#=END
 
16
 
 
17
pwd=`dirname $0`
 
18
pwd=`cd $pwd ; /bin/pwd`
 
19
 
 
20
bin=$pwd
 
21
 
 
22
. $bin/prologue.inc
 
23
 
 
24
dir=$tmpdir/tmpdir
 
25
# x is not really needed, see chdir.sh
 
26
okperm=rix
 
27
badperm=ix
 
28
 
 
29
mkdir $dir
 
30
 
 
31
# CHDIR TEST
 
32
 
 
33
genprofile $dir:$okperm
 
34
 
 
35
runchecktest "READDIR" pass $dir
 
36
 
 
37
# CHDIR TEST (no perm)
 
38
 
 
39
genprofile $dir:$badperm
 
40
 
 
41
runchecktest "READDIR (no perm)" fail $dir