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
10
#=DESCRIPTION mkdir() and rmdir() test
13
pwd=`cd $pwd ; /bin/pwd`
26
# null profile, verify mkdir/rmdir fail
29
runchecktest "MKDIR (confined - no perms)" fail mkdir $dir
31
# yeah, looks like NOP, but pass/fail of first shouldn't affect second
32
# use || : to avoid shell trap error if dir doesn't exist
33
/bin/rmdir $dir 2> /dev/null || :
36
runchecktest "RMDIR (confined - no perms)" fail rmdir $dir
38
# profile with read-only permissions, fail
40
genprofile $dir:$badperms
42
/bin/rmdir $dir 2> /dev/null || :
43
runchecktest "MKDIR (confined read-only)" fail mkdir $dir
45
# yeah, looks like NOP, but pass/fail of first shouldn't affect second
46
/bin/rmdir $dir 2> /dev/null || :
49
runchecktest "RMDIR (confined read-only)" fail rmdir $dir
51
# profile with permissions, shouldn't fail
53
genprofile $dir:$perms
55
/bin/rmdir $dir 2> /dev/null || :
56
runchecktest "MKDIR (confined)" pass mkdir $dir
58
# yeah, looks like NOP, but pass/fail of first shouldn't affect second
59
/bin/rmdir $dir 2> /dev/null || :
62
runchecktest "RMDIR (confined)" pass rmdir $dir
64
# profile with excess permissions, shouldn't fail
66
genprofile $dir:$excess_perms
68
/bin/rmdir $dir 2> /dev/null || :
69
runchecktest "MKDIR (confined +l)" pass mkdir $dir
71
# yeah, looks like NOP, but pass/fail of first shouldn't affect second
72
/bin/rmdir $dir 2> /dev/null || :
75
runchecktest "RMDIR (confined +l)" pass rmdir $dir