From: sven.vermeulen@siphos.be (Sven Vermeulen) Date: Wed, 25 Jun 2014 21:53:01 +0200 Subject: [refpolicy] [PATCH v2 2/3] Deprecate init_daemon_run_dir interface In-Reply-To: <1403725982-10043-1-git-send-email-sven.vermeulen@siphos.be> References: <1403725982-10043-1-git-send-email-sven.vermeulen@siphos.be> Message-ID: <1403725982-10043-3-git-send-email-sven.vermeulen@siphos.be> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com With init_daemon_pid_file supporting class parameters, all calls to init_daemon_run_dir can now be transformed into init_daemon_pid_file calls. Update the init_daemon_run_dir interface so it gives a warning when used, and use the init_daemon_pid_file interface underlyingly. Signed-off-by: Sven Vermeulen --- policy/modules/system/init.if | 5 ++--- policy/modules/system/init.te | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if index a168713..15483b0 100644 --- a/policy/modules/system/init.if +++ b/policy/modules/system/init.if @@ -465,9 +465,8 @@ interface(`init_daemon_run_dir',` type initrc_t; ') - typeattribute $1 daemonrundir; - - files_pid_filetrans(initrc_t, $1, dir, $2) + refpolicywarn(`$0($*) has been deprecated, use init_daemon_pid_file() instead.') + init_daemon_pid_file($1, dir, $2) ') ######################################## diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te index 17ecd36..7414ca4 100644 --- a/policy/modules/system/init.te +++ b/policy/modules/system/init.te @@ -26,6 +26,7 @@ attribute daemon; # Mark file type as a daemon pid file attribute daemonpidfile; # Mark file type as a daemon run directory +# TODO - this attribute is deprecated and kept for a short while for compatibility attribute daemonrundir; # @@ -257,6 +258,7 @@ create_dirs_pattern(initrc_t, daemonpidfile, daemonpidfile) manage_files_pattern(initrc_t, daemonpidfile, daemonpidfile) setattr_dirs_pattern(initrc_t, daemonpidfile, daemonpidfile) +# TODO - this is deprecated supported for a short while for backwards compatibility create_dirs_pattern(initrc_t, daemonrundir, daemonrundir) setattr_dirs_pattern(initrc_t, daemonrundir, daemonrundir) -- 1.8.5.5