41
41
# PASS TEST (the file shouldn't exist, so open should create it
43
genprofile ${dir}:r ${filepath}:$okperm
43
genprofile ${dir}/:r ${filepath}:$okperm
44
44
runchecktest "OPENAT RW (create) " pass $dir $file
49
genprofile ${dir}:r ${filepath}:$okperm
49
genprofile ${dir}/:r ${filepath}:$okperm
50
50
runchecktest "OPENAT RW (exists)" pass $dir $file
55
genprofile ${dir}:r ${filepath}:$badperm1
55
genprofile ${dir}/:r ${filepath}:$badperm1
56
56
runchecktest "OPENAT R" fail $dir $file
61
genprofile ${dir}:r ${filepath}:$badperm2
61
genprofile ${dir}/:r ${filepath}:$badperm2
62
62
runchecktest "OPENAT W (exists)" fail $dir $file
66
genprofile ${dir}:r ${filepath}:$badperm1 cap:dac_override
66
genprofile ${dir}/:r ${filepath}:$badperm1 cap:dac_override
67
67
runchecktest "OPENAT R+dac_override" fail $dir $file
70
70
# This is testing for bug: https://bugs.wirex.com/show_bug.cgi?id=2885
71
71
# When we open O_CREAT|O_RDWR, we are (were?) allowing only write access
73
# This test currently passes when it should fail because of the o_creat bug
74
genprofile ${dir}:r ${filepath}:$badperm2
75
runchecktest "OPENAT W (create)" fail $dir $file
75
genprofile ${dir}/:r ${filepath}:$badperm2
76
runchecktest "OPENAT W (create)" known_fail $dir $file
77
78
# PASS rename of directory in between opendir/openat
79
genprofile ${dir}/${subdir}:rw ${dir}/otherdir:w ${dir}/otherdir/file:rw
80
genprofile ${dir}/${subdir}/:rw ${dir}/otherdir/:w ${dir}/otherdir/file:rw
80
81
runchecktest "OPENAT RW (rename/newpath)" pass --rename ${dir}/otherdir ${dir}/${subdir} file
82
83
# PASS rename of directory in between opendir/openat - file exists
85
genprofile ${dir}/${subdir}:rw ${dir}/otherdir:w ${dir}/otherdir/file:rw
86
genprofile ${dir}/${subdir}/:rw ${dir}/otherdir/:w ${dir}/otherdir/file:rw
86
87
runchecktest "OPENAT RW (rename/newpath)" pass --rename ${dir}/otherdir ${dir}/${subdir} file
88
89
# FAIL rename of directory in between opendir/openat - use old name
90
genprofile ${dir}/${subdir}:rw ${dir}/otherdir:w ${dir}/${subdir}/file:rw
91
genprofile ${dir}/${subdir}/:rw ${dir}/otherdir/:w ${dir}/${subdir}/file:rw
91
92
runchecktest "OPENAT RW (rename/newpath)" fail --rename ${dir}/otherdir ${dir}/${subdir} file
94
94
# FAIL rename of directory in between opendir/openat - use old name, file exists
97
genprofile ${dir}/${subdir}:rw ${dir}/otherdir:w ${dir}/${subdir}/file:rw
97
genprofile ${dir}/${subdir}/:rw ${dir}/otherdir/:w ${dir}/${subdir}/file:rw
98
98
runchecktest "OPENAT RW (rename/newpath)" fail --rename ${dir}/otherdir ${dir}/${subdir} file