Deprecate init_daemon_run_dir interface

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 <sven.vermeulen@siphos.be>
This commit is contained in:
Sven Vermeulen 2014-06-25 21:53:01 +02:00 committed by Chris PeBenito
parent d64826b606
commit 3cea6ac6b6
2 changed files with 4 additions and 3 deletions

View File

@ -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)
')
########################################

View File

@ -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)