Gentoo Archives: gentoo-commits

From: Sven Vermeulen <sven.vermeulen@××××××.be>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/contrib/, policy/modules/system/
Date: Mon, 31 Dec 2012 23:19:36
Message-Id: 1356974679.2e34d4ed1a88947b99dc82d88f1e5e0b0f026211.SwifT@gentoo
1 commit: 2e34d4ed1a88947b99dc82d88f1e5e0b0f026211
2 Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
3 AuthorDate: Mon Dec 31 17:24:39 2012 +0000
4 Commit: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
5 CommitDate: Mon Dec 31 17:24:39 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=2e34d4ed
7
8 Create filetransition for ld.so.cache~
9
10 When portage calls ldconfig (which runs in the portage domain, so no transition
11 occurs), ldconfig creates the ld.so.cache~ file (which later gets renamed to
12 ld.so.cache). As this file would then be labeled as etc_t, this results in a
13 wrongly labeled ld.so.cache file.
14
15 Introduce a file transition for ld.so.cache~ so that this comes through
16 correctly.
17
18 ---
19 policy/modules/contrib/portage.te | 7 +++++++
20 policy/modules/system/libraries.if | 33 +++++++++++++++++++++++++++++++++
21 2 files changed, 40 insertions(+), 0 deletions(-)
22
23 diff --git a/policy/modules/contrib/portage.te b/policy/modules/contrib/portage.te
24 index 5a1e463..dd5c0d0 100644
25 --- a/policy/modules/contrib/portage.te
26 +++ b/policy/modules/contrib/portage.te
27 @@ -383,6 +383,13 @@ ifdef(`distro_gentoo',`
28
29 ##########################################
30 #
31 + # Portage local policy
32 + #
33 +
34 + libs_generic_etc_filetrans_ld_so_cache(portage_t, file, "ld.so.cache~")
35 +
36 + ##########################################
37 + #
38 # Portage sandbox local policy
39 #
40
41
42 diff --git a/policy/modules/system/libraries.if b/policy/modules/system/libraries.if
43 index 808ba93..41a44f3 100644
44 --- a/policy/modules/system/libraries.if
45 +++ b/policy/modules/system/libraries.if
46 @@ -534,3 +534,36 @@ interface(`lib_filetrans_shared_lib',`
47 interface(`files_lib_filetrans_shared_lib',`
48 refpolicywarn(`$0($*) has been deprecated.')
49 ')
50 +
51 +# This is gentoo specific but cannot use ifdef distro_gentoo here
52 +
53 +########################################
54 +## <summary>
55 +## Create an object in etc with a type transition to
56 +## the ld_so_cache_t type
57 +## </summary>
58 +## <param name="domain">
59 +## <summary>
60 +## Domain allowed access
61 +## </summary>
62 +## </param>
63 +## <param name="class">
64 +## <summary>
65 +## Class of the resource for which a type transition occurs.
66 +## This is usually file as ld_so_cache is currently not used
67 +## for any other resources.
68 +## </summary>
69 +## </param>
70 +## <param name="filename" optional="true">
71 +## <summary>
72 +## Name of the resource created for which a type transition occurs
73 +## </summary>
74 +## </param>
75 +#
76 +interface(`libs_generic_etc_filetrans_ld_so_cache',`
77 + gen_require(`
78 + type ld_so_cache_t;
79 + ')
80 +
81 + files_etc_filetrans($1, ld_so_cache_t, $2, $3)
82 +')