From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QLEJW-0001RN-Jl for garchives@archives.gentoo.org; Sat, 14 May 2011 12:51:29 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9515CE0138; Sat, 14 May 2011 12:51:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 6723CE0138 for ; Sat, 14 May 2011 12:51:15 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D90361B4032 for ; Sat, 14 May 2011 12:51:14 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 510A580505 for ; Sat, 14 May 2011 12:51:14 +0000 (UTC) From: "Sven Vermeulen" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Vermeulen" Message-ID: Subject: [gentoo-commits] proj/hardened-docs:master commit in: xml/ X-VCS-Repository: proj/hardened-docs X-VCS-Files: xml/selinux-faq.xml X-VCS-Directories: xml/ X-VCS-Committer: SwifT X-VCS-Committer-Name: Sven Vermeulen X-VCS-Revision: e355d40278fe8df7e742825cb2baa9b15a115e09 Date: Sat, 14 May 2011 12:51:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: ba65a3da4217549d0fb70fd99ced2eee commit: e355d40278fe8df7e742825cb2baa9b15a115e09 Author: Sven Vermeulen siphos be> AuthorDate: Sat May 14 12:13:36 2011 +0000 Commit: Sven Vermeulen siphos be> CommitDate: Sat May 14 12:13:36 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/hardened-docs= .git;a=3Dcommit;h=3De355d402 Add FAQ on how to retrieve the file context rule for a particular path --- xml/selinux-faq.xml | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-) diff --git a/xml/selinux-faq.xml b/xml/selinux-faq.xml index 471917e..969b562 100644 --- a/xml/selinux-faq.xml +++ b/xml/selinux-faq.xml @@ -17,8 +17,8 @@ The FAQ is a collection of solutions found on IRC, mail= inglist, forums or elsewhere =20 -7 -2011-05-03 +8 +2011-05-14 =20 Questions @@ -234,6 +234,33 @@ context. =20 +
+ + How do I know which file context rule is used for a particular file? + + + +

+If you use the matchpathcon command, it will tell you what the se= curity +context for the given path (file or directory) should be, but it doesn't= tell +you which rule it used to deduce this. To do that, you can use findco= n: +

+ +
+~# findcon /etc/selinux/strict/contexts/files/file_contexts -p /lib64=
/rc/init.d
+/.*                          system_u:object_r:default_t
+/lib(64)?/rc/init\.d(/.*)?   system_u:object_r:initrc_state_t
+/lib64/.*                    system_u:object_r:lib_t
+
+ +

+When the SELinux utilities try to apply a context, they try to match the= rule +that is the most specific, so in the above case, it is the one that lead= s to the +initrc_state_t context. +

+ + +
=20