From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 34CF6138247 for ; Sun, 3 Nov 2013 11:19:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1EE40E0AA2; Sun, 3 Nov 2013 11:19:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6F44CE09B5 for ; Sun, 3 Nov 2013 11:19:09 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6120433F08D for ; Sun, 3 Nov 2013 11:19:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 18282E54D6 for ; Sun, 3 Nov 2013 11:19:07 +0000 (UTC) From: "Sven Vermeulen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Vermeulen" Message-ID: <1383477374.ee154a5d02d8ee55ec048796017ec187ad888b43.swift@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/contrib/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: policy/modules/contrib/portage.te X-VCS-Directories: policy/modules/contrib/ X-VCS-Committer: swift X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: ee154a5d02d8ee55ec048796017ec187ad888b43 X-VCS-Branch: master Date: Sun, 3 Nov 2013 11:19:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 5aedea3e-bdb9-4c14-8b0f-20f6c2d1c88b X-Archives-Hash: 0dbb37c4d736648db7ad6c368259e876 commit: ee154a5d02d8ee55ec048796017ec187ad888b43 Author: Sven Vermeulen siphos be> AuthorDate: Sun Nov 3 11:16:14 2013 +0000 Commit: Sven Vermeulen gentoo org> CommitDate: Sun Nov 3 11:16:14 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=ee154a5d Support self-update of Portage When Portage is asked to update itself, it triggers a specific procedure (in portage/pym/portage/package/ebuild/doebuild.py, a method called _prepare_self_update). In this method, it will create a temporary copy of PORTAGE_BIN_PATH and PORTAGE_PYM_PATH (which are bin_t, lib_t and some specific Portage types). During this copy, it needs to set the proper labels on the files, which is why we now allow the various relabel operations. --- policy/modules/contrib/portage.te | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/policy/modules/contrib/portage.te b/policy/modules/contrib/portage.te index 533919c..5230679 100644 --- a/policy/modules/contrib/portage.te +++ b/policy/modules/contrib/portage.te @@ -395,12 +395,25 @@ ifdef(`distro_gentoo',` # allow portage_t self:capability2 block_suspend; + # Support self-update of Portage + allow portage_t portage_tmp_t:dir relabel_dir_perms; + allow portage_t portage_tmp_t:lnk_file relabel_lnk_file_perms; + allow portage_t portage_exec_t:file relabel_file_perms; + allow portage_t portage_fetch_exec_t:file relabel_file_perms; + # Portage is selinuxaware, transitions on calling ebuild, now marked as bin_t corecmd_bin_entry_type(portage_t) + # Support self-update of Portage + corecmd_relabel_bin_dirs(portage_t) + corecmd_relabel_bin_files(portage_t) + corecmd_relabel_bin_lnk_files(portage_t) auth_use_nsswitch(portage_t) libs_generic_etc_filetrans_ld_so_cache(portage_t, file, "ld.so.cache~") + # Support self-update of Portage + libs_relabel_lib_dirs(portage_t) + libs_relabel_lib_files(portage_t) ########################################## #