Skip to contentSkip to conversation

Separate domtrans/run interfaces for portage_fetch

PATCH Superseded Sven Vermeulen 2 participants 2 messages Sep 9, 2011 – Sep 13, 2011

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Separate domtrans/run interfaces for portage_fetch

Since the introduction of the portage_fetch_t domain, access to the domain was governed through the portage_domtrans and portage_run interfaces. To support calling portage only (but no fetch domain) or vice versa, the interfaces need to be split up.

In this patch, we introduce the interfaces portage_domtrans_fetch and portage_run_fetch which will be used later in the domains that need to call portage/layman/emerge-webrsync/...

---
 portage.if |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)
portage.if +50 -0
index 9f7d652..ea892d1 100644
@@ -213,6 +213,56 @@ interface(`portage_compile_domain',`
 
 ########################################
 ## <summary>
+##	Execute tree management functions (fetching, layman, ...)
+##      in the portage_fetch_t domain.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+#
+interface(`portage_domtrans_fetch',`
+	gen_require(`
+		type portage_fetch_t, portage_fetch_exec_t;
+	')
+
+	files_search_usr($1)
+	corecmd_search_bin($1)
+
+	domtrans_pattern($1, portage_fetch_exec_t, portage_fetch_t)
+')
+
+########################################
+## <summary>
+##	Execute tree management functions (fetching, layman, ...) 
+##      in the portage_fetch_t domain, and allow the specified role
+##      the portage_fetch_t domain.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+## <param name="role">
+##	<summary>
+##	The role to allow the portage domain.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`portage_run_fetch',`
+	gen_require(`
+		type portage_fetch_t;
+	')
+
+	portage_domtrans_fetch($1)
+	role $2 types portage_fetch_t;
+')
+
+
+########################################
+## <summary>
 ##	Execute gcc-config in the gcc_config domain.
 ## </summary>
 ## <param name="domain">
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/1 Separate domtrans/run interfaces for portage_fetch

Quoted 8 lines · Sven Vermeulen

Since the introduction of the portage_fetch_t domain, access to the domain was governed through the portage_domtrans and portage_run interfaces. To support calling portage only (but no fetch domain) or vice versa, the interfaces need to be split up.

In this patch, we introduce the interfaces portage_domtrans_fetch and portage_run_fetch which will be used later in the domains that need to call portage/layman/emerge-webrsync/...

This doesn't remove the portage fetch transition in portage_domtrans(), nor does it update any callers that actually need the fetch transition.

Quoted 66 lines
---
 portage.if |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)
portage.if +50 -0
index 9f7d652..ea892d1 100644
@@ -213,6 +213,56 @@ interface(`portage_compile_domain',`
 
 ########################################
 ## <summary>
+##	Execute tree management functions (fetching, layman, ...)
+##      in the portage_fetch_t domain.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+#
+interface(`portage_domtrans_fetch',`
+	gen_require(`
+		type portage_fetch_t, portage_fetch_exec_t;
+	')
+
+	files_search_usr($1)
+	corecmd_search_bin($1)
+
+	domtrans_pattern($1, portage_fetch_exec_t, portage_fetch_t)
+')
+
+########################################
+## <summary>
+##	Execute tree management functions (fetching, layman, ...) 
+##      in the portage_fetch_t domain, and allow the specified role
+##      the portage_fetch_t domain.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+## <param name="role">
+##	<summary>
+##	The role to allow the portage domain.
+##	</summary>
+## </param>
+## <rolecap/>
+#
+interface(`portage_run_fetch',`
+	gen_require(`
+		type portage_fetch_t;
+	')
+
+	portage_domtrans_fetch($1)
+	role $2 types portage_fetch_t;
+')
+
+
+########################################
+## <summary>
 ##	Execute gcc-config in the gcc_config domain.
 ## </summary>
 ## <param name="domain">
Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com