2
# $Id: changehat_fork.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
# As 'changehat' but access checks for hats are verified across a fork
17
pwd=`cd $pwd ; /bin/pwd`
31
genprofile $file:$okperm
33
runchecktest "NO CHANGEHAT (access parent file)" pass nochange $file
34
runchecktest "NO CHANGEHAT (access sub file)" fail nochange $subfile
40
genprofile $file:$okperm hat:$subtest $subfile:$okperm
42
runchecktest "CHANGEHAT (access parent file)" fail $subtest $file
43
runchecktest "CHANGEHAT (access sub file)" pass $subtest $subfile
45
# CHANGEHAT TEST -- multiple subprofiles
50
genprofile $file:$okperm hat:$subtest $subfile:$okperm hat:$subtest2 $subfile:$okperm hat:$subtest3 $subfile:$okperm
52
runchecktest "CHANGEHAT (access parent file)" fail $subtest $file
53
runchecktest "CHANGEHAT (access sub file)" pass $subtest $subfile
54
runchecktest "CHANGEHAT (access sub file)" pass $subtest2 $subfile
55
runchecktest "CHANGEHAT (access sub file)" pass $subtest3 $subfile
57
# CHANGEHAT TEST -- non-existent subprofile access
58
# Should put us into a null-profile
63
genprofile $file:$okperm hat:$subtest $subfile:$okperm hat:$subtest2 $subfile:$okperm
65
runchecktest "CHANGEHAT (access parent file)" fail $subtest3 $file
66
runchecktest "CHANGEHAT (access sub file)" fail $subtest3 $subfile