Gentoo Archives: gentoo-commits

From: Sven Vermeulen <swift@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/
Date: Mon, 30 Jun 2014 19:03:53
Message-Id: 1404154683.21342c022f09080d201c8661aa2ac8af893b4346.swift@gentoo
1 commit: 21342c022f09080d201c8661aa2ac8af893b4346
2 Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
3 AuthorDate: Wed Jun 25 19:53:01 2014 +0000
4 Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 30 18:58:03 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=21342c02
7
8 Deprecate init_daemon_run_dir interface
9
10 With init_daemon_pid_file supporting class parameters, all calls to
11 init_daemon_run_dir can now be transformed into init_daemon_pid_file
12 calls.
13
14 Update the init_daemon_run_dir interface so it gives a warning when
15 used, and use the init_daemon_pid_file interface underlyingly.
16
17 Signed-off-by: Sven Vermeulen <sven.vermeulen <AT> siphos.be>
18
19 ---
20 policy/modules/system/init.if | 5 ++---
21 policy/modules/system/init.te | 2 ++
22 2 files changed, 4 insertions(+), 3 deletions(-)
23
24 diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if
25 index e60d55e..6a01568 100644
26 --- a/policy/modules/system/init.if
27 +++ b/policy/modules/system/init.if
28 @@ -464,9 +464,8 @@ interface(`init_daemon_run_dir',`
29 type initrc_t;
30 ')
31
32 - typeattribute $1 daemonrundir;
33 -
34 - files_pid_filetrans(initrc_t, $1, dir, $2)
35 + refpolicywarn(`$0($*) has been deprecated, use init_daemon_pid_file() instead.')
36 + init_daemon_pid_file($1, dir, $2)
37 ')
38
39 ########################################
40
41 diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te
42 index a243be6..4bee18e 100644
43 --- a/policy/modules/system/init.te
44 +++ b/policy/modules/system/init.te
45 @@ -26,6 +26,7 @@ attribute daemon;
46 # Mark file type as a daemon pid file
47 attribute daemonpidfile;
48 # Mark file type as a daemon run directory
49 +# TODO - this attribute is deprecated and kept for a short while for compatibility
50 attribute daemonrundir;
51
52 #
53 @@ -257,6 +258,7 @@ create_dirs_pattern(initrc_t, daemonpidfile, daemonpidfile)
54 manage_files_pattern(initrc_t, daemonpidfile, daemonpidfile)
55 setattr_dirs_pattern(initrc_t, daemonpidfile, daemonpidfile)
56
57 +# TODO - this is deprecated supported for a short while for backwards compatibility
58 create_dirs_pattern(initrc_t, daemonrundir, daemonrundir)
59 setattr_dirs_pattern(initrc_t, daemonrundir, daemonrundir)