@@ -350,6 +350,7 @@ allow test_filesystem_fscontext_t test_filesystem_filecon_t:file { getattr open
allow test_filesystem_fscontext_t test_filesystem_fscontext_fs_t:dir { add_name search write };
allow test_filesystem_fscontext_t test_filesystem_fscontext_fs_t:file { create getattr open relabelfrom write };
allow test_filesystem_fscontext_t test_filesystem_fscontext_fs_t:filesystem { mount relabelto unmount };
+domain_obj_id_change_exemption(test_filesystem_fscontext_t)
fs_relabelfrom_all_fs(test_filesystem_fscontext_t)
files_search_all(test_filesystem_fscontext_t)
allow test_filesystem_filecon_t test_filesystem_fscontext_fs_t:filesystem { associate };
@@ -1116,7 +1116,7 @@ if ( not $nfs_enabled ) {
# system_u:object_r:test_filesystem_context_file_t:s0 from $test_opts
print "Creating test file $basedir/mntpoint/mp1/test_file\n";
$result = system(
-"runcon -u system_u -t test_filesystem_fscontext_t $basedir/create_file -f $basedir/mntpoint/mp1/test_file -e test_filesystem_context_file_t $v"
+"runcon -t test_filesystem_fscontext_t $basedir/create_file -f $basedir/mntpoint/mp1/test_file -e test_filesystem_context_file_t $v"
);
ok( $result eq 0 );
@@ -1145,7 +1145,7 @@ if ( not $nfs_enabled ) {
# system_u:object_r:test_filesystem_context_file_t:s0 from $test_opts
print "Creating test file $basedir/mntpoint/mp1/test_file\n";
$result = system(
-"runcon -u system_u -t test_filesystem_fscontext_t $filesystem_dir/create_file -f $basedir/mntpoint/mp1/test_file -e test_filesystem_context_file_t $v"
+"runcon -t test_filesystem_fscontext_t $filesystem_dir/create_file -f $basedir/mntpoint/mp1/test_file -e test_filesystem_context_file_t $v"
);
ok( $result eq 0 );
Rather than forcing the process user identity to system_u in the filesystem tests (which broke in Debian due to not being authorized for unconfined_r), grant the test_filesystem_fscontext_t domain the ability to create objects in other user identities. This is cleaner. Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com> --- policy/test_filesystem.te | 1 + tests/filesystem/test | 2 +- tests/fs_filesystem/test | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)