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

« back to all changes in this revision

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