From 46410fd2b965d219e0c70ec11f7b2ba420791f47 Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: May 23 2005 15:49:31 +0000 Subject: add tmpfsfile support --- diff --git a/refpolicy/policy/modules/system/files.if b/refpolicy/policy/modules/system/files.if index b1fcda2..2d8f3c9 100644 --- a/refpolicy/policy/modules/system/files.if +++ b/refpolicy/policy/modules/system/files.if @@ -74,6 +74,29 @@ attribute tmpfile; ') ######################################## +## +## +## Transform the type into a file, for use on a +## virtual memory filesystem (tmpfs). +## +## +## The type to be transformed. +## +## +## +# +define(`files_make_tmpfs_file',` +requires_block_template(`$0'_depend) +files_make_file($1) +filesystem_tmpfs_associate($1) +typeattribute $1 tmpfsfile; +') + +define(`files_make_tmpfs_file_depend',` +attribute tmpfsfile; +') + +######################################## # # files_get_all_file_attributes(domain) # @@ -408,6 +431,29 @@ class lnk_file { getattr read }; ') ######################################## +## +## +## Delete system configuration files in /etc. +## +## +## The type of the process performing this action. +## +## +## +# +define(`files_remove_general_system_config',` +requires_block_template(`$0'_depend) +allow $1 etc_t:dir { getattr search read write remove_name }; +allow $1 etc_t:file unlink; +') + +define(`files_remove_general_system_config_depend',` +type etc_t; +class dir { getattr search read write remove_name }; +class file unlink; +') + +######################################## # # files_execute_system_config_script(domain) # diff --git a/refpolicy/policy/modules/system/files.te b/refpolicy/policy/modules/system/files.te index c26db14..3dc0026 100644 --- a/refpolicy/policy/modules/system/files.te +++ b/refpolicy/policy/modules/system/files.te @@ -4,9 +4,10 @@ policy_module(files,1.0) attribute file_type; attribute lockfile; +attribute mountpoint; attribute pidfile; attribute tmpfile; -attribute mountpoint; +attribute tmpfsfile; # default_t is the default type for files that do not # match any specification in the file_contexts configuration