From: sven.vermeulen@siphos.be (Sven Vermeulen)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH 3/4] Allow emerge-webrsync to copy extracted files to the tree
Date: Sat, 13 Aug 2011 20:24:07 +0200 [thread overview]
Message-ID: <20110813182407.GD12571@siphos.be> (raw)
In-Reply-To: <20110813182048.GA12571@siphos.be>
The emerge-webrsync application, part of Portage, is responsible for fetching
a tree snapshot, having it extracted in a temporary location (portage_tmp_t)
and then copied over to the main portage tree. However, its domain
(portage_fetch_t) has no read rights on the temporary location.
To allow this, we need to define an interface (portage_read_tmp_files) since
we need to allow this both to portage_fetch_t (the emerge-webrsync application)
as well as gpg (to verify the GnuPG signature of the downloaded snapshot).
Also, portage_read_tmp_files doesn't use read_files_pattern since the
read-permission on the dir class is needed too.
Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
---
policy/modules/admin/portage.if | 19 +++++++++++++++++++
policy/modules/admin/portage.te | 3 +++
policy/modules/apps/gpg.te | 4 ++++
3 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/policy/modules/admin/portage.if b/policy/modules/admin/portage.if
index faf2eba..86948c7 100644
--- a/policy/modules/admin/portage.if
+++ b/policy/modules/admin/portage.if
@@ -250,6 +250,25 @@ interface(`portage_run_gcc_config',`
########################################
## <summary>
+## Allow a domain to read portage_tmp_t files
+## </summary>
+## <param name="domain">
+## <summary>
+## Domain to allow search privileges
+## </summary>
+## </param>
+#
+interface(`portage_read_tmp_files',`
+ gen_require(`
+ type portage_tmp_t;
+ ')
+
+ allow $1 portage_tmp_t:dir list_dir_perms;
+ allow $1 portage_tmp_t:file read_file_perms;
+')
+
+########################################
+## <summary>
## Do not audit attempts to search the
## portage temporary directories.
## </summary>
diff --git a/policy/modules/admin/portage.te b/policy/modules/admin/portage.te
index 4a6e53e..050202f 100644
--- a/policy/modules/admin/portage.te
+++ b/policy/modules/admin/portage.te
@@ -322,6 +322,9 @@ sysnet_dns_name_resolve(portage_fetch_t)
userdom_use_user_terminals(portage_fetch_t)
userdom_dontaudit_read_user_home_content_files(portage_fetch_t)
+
+portage_read_tmp_files(portage_fetch_t)
+
ifdef(`hide_broken_symptoms',`
dontaudit portage_fetch_t portage_cache_t:file read;
')
diff --git a/policy/modules/apps/gpg.te b/policy/modules/apps/gpg.te
index 9050e8c..469dc93 100644
--- a/policy/modules/apps/gpg.te
+++ b/policy/modules/apps/gpg.te
@@ -147,6 +147,10 @@ optional_policy(`
')
optional_policy(`
+ portage_read_tmp_files(gpg_t)
+')
+
+optional_policy(`
xserver_use_xdm_fds(gpg_t)
xserver_rw_xdm_pipes(gpg_t)
')
--
1.7.3.4
next prev parent reply other threads:[~2011-08-13 18:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-13 18:20 [refpolicy] [PATCH 0/4] Portage related updates Sven Vermeulen
2011-08-13 18:22 ` [refpolicy] [PATCH 1/4] Support layman through its own domain Sven Vermeulen
2011-08-16 17:59 ` Christopher J. PeBenito
2011-08-17 4:13 ` Sven Vermeulen
2011-08-17 5:38 ` Sven Vermeulen
2011-08-13 18:23 ` [refpolicy] [PATCH 2/4] Support emerge-webrsync through portage domain Sven Vermeulen
2011-08-16 17:53 ` Christopher J. PeBenito
2011-08-13 18:24 ` Sven Vermeulen [this message]
2011-08-13 18:25 ` [refpolicy] [PATCH 4/4] Allow gpg to search through portage configuration files Sven Vermeulen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110813182407.GD12571@siphos.be \
--to=sven.vermeulen@siphos.be \
--cc=refpolicy@oss.tresys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.