2
# Copyright (C) 2002-2005 Novell/SUSE
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
11
# Verifies basic file access permission checks for a parent profile and one
16
pwd=`cd $pwd ; /bin/pwd`
26
othertest="$pwd/rename"
28
fqsubbase="$pwd/changeprofile"
29
fqsubtest="$fqsubbase//$subtest"
36
# CHANGEPROFILE UNCONFINED
37
runchecktest "CHANGEPROFILE (unconfined - nochange)" pass nochange $file
38
runchecktest_errno ENOENT "CHANGEPROFILE (unconfined - noent)" fail $othertest $file
39
genprofile image=$othertest $file:$okperm
40
runchecktest "CHANGEPROFILE (unconfined)" pass $othertest $file
42
# NO CHANGEPROFILE TEST file access of base profile okay
43
genprofile $file:$okperm
44
runchecktest "NO CHANGEPROFILE (access parent file)" pass nochange $file
45
runchecktest "NO CHANGEPROFILE (access sub file)" fail nochange $subfile
47
# CHANGEPROFILE NO Target TEST - NO PERMISSION
48
runchecktest "CHANGEPROFILE (no target, nochange)" pass nochange $file
49
runchecktest_errno EACCES "CHANGEPROFILE (no target, $file)" fail $othertest $file
50
runchecktest_errno EACCES "CHANGEPROFILE (no target, $subfile)" fail $othertest $subfile
52
# CHANGEPROFILE NO Target TEST - PERMISSION
53
genprofile $file:$okperm 'change_profile->':$othertest
54
runchecktest "CHANGEPROFILE (no target, nochange)" pass nochange $file
55
runchecktest_errno ENOENT "CHANGEPROFILE (no target, $file)" fail $othertest $file
56
runchecktest_errno ENOENT "CHANGEPROFILE (no target, $subfile)" fail $othertest $subfile
60
genprofile $file:$okperm 'change_profile->':$fqsubtest hat:$subtest $subfile:$okperm
61
runchecktest "CHANGEPROFILE (nochange access file)" pass nochange $file
62
runchecktest_errno EACCES "CHANGEPROFILE (nochange access subfile)" fail nochange $subfile
63
runchecktest_errno EACCES "CHANGEPROFILE (access file)" fail $fqsubtest $file
64
runchecktest "CHANGEPROFILE (access sub file)" pass $fqsubtest $subfile
67
# CHANGEPROFILE RE TEST
68
genprofile $file:$okperm 'change_profile->':"$fqsubbase//*" hat:$subtest $subfile:$okperm
69
runchecktest "CHANGEPROFILE_RE (nochange access file)" pass nochange $file
70
runchecktest_errno EACCES "CHANGEPROFILE_RE (nochange access subfile)" fail nochange $subfile
71
runchecktest_errno EACCES "CHANGEPROFILE_RE (access file)" fail $fqsubtest $file
72
runchecktest "CHANGEPROFILE_RE (access sub file)" pass $fqsubtest $subfile