2
# $Id: mkdir.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
12
#=DESCRIPTION mkdir() and rmdir() test
15
pwd=`cd $pwd ; /bin/pwd`
28
# null profile, verify mkdir/rmdir fail
31
runchecktest "MKDIR (confined - no perms)" fail mkdir $dir
33
# yeah, looks like NOP, but pass/fail of first shouldn't affect second
34
# use || : to avoid shell trap error if dir doesn't exist
35
/bin/rmdir $dir 2> /dev/null || :
38
runchecktest "RMDIR (confined - no perms)" fail rmdir $dir
40
# profile with read-only permissions, fail
42
genprofile $dir:$badperms
44
/bin/rmdir $dir 2> /dev/null || :
45
runchecktest "MKDIR (confined read-only)" fail mkdir $dir
47
# yeah, looks like NOP, but pass/fail of first shouldn't affect second
48
/bin/rmdir $dir 2> /dev/null || :
51
runchecktest "RMDIR (confined read-only)" fail rmdir $dir
53
# profile with permissions, shouldn't fail
55
genprofile $dir:$perms
57
/bin/rmdir $dir 2> /dev/null || :
58
runchecktest "MKDIR (confined)" pass mkdir $dir
60
# yeah, looks like NOP, but pass/fail of first shouldn't affect second
61
/bin/rmdir $dir 2> /dev/null || :
64
runchecktest "RMDIR (confined)" pass rmdir $dir
66
# profile with excess permissions, shouldn't fail
68
genprofile $dir:$excess_perms
70
/bin/rmdir $dir 2> /dev/null || :
71
runchecktest "MKDIR (confined +l)" pass mkdir $dir
73
# yeah, looks like NOP, but pass/fail of first shouldn't affect second
74
/bin/rmdir $dir 2> /dev/null || :
77
runchecktest "RMDIR (confined +l)" pass rmdir $dir