2
# $Id: access.sh 61 2006-05-19 18:32:14Z steve-beattie $
4
# Copyright (C) 2002-2005 Novell/SUSE
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
13
# Verify that the access syscall is correctly managed for confined profiles
17
pwd=`cd $pwd ; /bin/pwd`
31
chmod 777 $file # full perms so discretionary access checks succeed
34
genprofile $file:$rwxperm
35
runchecktest "ACCESS file r (rwx)" pass $file r
36
runchecktest "ACCESS file rx (rwx)" pass $file rx
37
runchecktest "ACCESS file rwx (rwx)" pass $file rwx
39
genprofile $file:$rperm
40
runchecktest "ACCESS file r (r)" pass $file r
41
runchecktest "ACCESS file rx (r)" fail $file rx
42
runchecktest "ACCESS file rwx (r)" fail $file rwx
44
genprofile $file:$wxperm
45
runchecktest "ACCESS file x (wx)" pass $file x
46
runchecktest "ACCESS file w (wx)" pass $file w
47
runchecktest "ACCESS file wx (wx)" pass $file wx
49
genprofile $file:$wxperm
50
runchecktest "ACCESS file r (wx)" fail $file r
51
runchecktest "ACCESS file rx (wx)" fail $file rx
52
runchecktest "ACCESS file rwx (wx)" fail $file rwx
54
# wx are not necessary for directory write or traverse
57
chmod 777 $dir # full perms so discretionary access checks succeed
59
genprofile $dir:$rwxperm
60
runchecktest "ACCESS dir r (rwx)" pass $dir r
61
runchecktest "ACCESS dir rx (rwx)" pass $dir rx
62
runchecktest "ACCESS dir rwx (rwx)" pass $dir rwx
64
genprofile $dir:$rperm
65
runchecktest "ACCESS dir r (r)" pass $dir r
66
runchecktest "ACCESS dir rx (r)" pass $dir rx
67
runchecktest "ACCESS dir rwx (r)" pass $dir rwx
69
genprofile $dir:$wxperm
70
runchecktest "ACCESS dir x (wx)" pass $dir x
71
runchecktest "ACCESS dir w (wx)" pass $dir w
72
runchecktest "ACCESS dir wx (wx)" pass $dir wx
74
genprofile $dir:$wxperm
75
runchecktest "ACCESS dir r (wx)" fail $dir r
76
runchecktest "ACCESS dir rx (wx)" fail $dir rx
77
runchecktest "ACCESS dir rwx (wx)" fail $dir rwx