Blame SOURCES/0002-Fix-STANDARD_FILE_CONTEXT-section-in-man-pages.patch

b9d005
From 7a548cae4303f8429040ba6be67be182b7f9a943 Mon Sep 17 00:00:00 2001
5b70e6
From: Dan Walsh <dwalsh@redhat.com>
5b70e6
Date: Mon, 21 Apr 2014 13:54:40 -0400
5b70e6
Subject: [PATCH] Fix STANDARD_FILE_CONTEXT section in man pages
5b70e6
5b70e6
Signed-off-by: Miroslav Grepl <mgrepl@redhat.com>
5b70e6
---
5b70e6
 python/sepolicy/sepolicy/manpage.py | 7 +++++--
5b70e6
 1 file changed, 5 insertions(+), 2 deletions(-)
5b70e6
5b70e6
diff --git a/python/sepolicy/sepolicy/manpage.py b/python/sepolicy/sepolicy/manpage.py
5b70e6
index 2f847abb87e2..dccd778ed4be 100755
5b70e6
--- a/python/sepolicy/sepolicy/manpage.py
5b70e6
+++ b/python/sepolicy/sepolicy/manpage.py
5b70e6
@@ -737,10 +737,13 @@ Default Defined Ports:""")
5b70e6
 
5b70e6
     def _file_context(self):
5b70e6
         flist = []
5b70e6
+        flist_non_exec = []
5b70e6
         mpaths = []
5b70e6
         for f in self.all_file_types:
5b70e6
             if f.startswith(self.domainname):
5b70e6
                 flist.append(f)
5b70e6
+                if not file_type_is_executable(f) or not file_type_is_entrypoint(f):
5b70e6
+                    flist_non_exec.append(f)
5b70e6
                 if f in self.fcdict:
5b70e6
                     mpaths = mpaths + self.fcdict[f]["regex"]
5b70e6
         if len(mpaths) == 0:
5b70e6
@@ -799,12 +802,12 @@ SELinux %(domainname)s policy is very flexible allowing users to setup their %(d
5b70e6
 SELinux defines the file context types for the %(domainname)s, if you wanted to
b9d005
 store files with these types in a diffent paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk.
5b70e6
 
5b70e6
-.B semanage fcontext -a -t %(type)s '/srv/%(domainname)s/content(/.*)?'
5b70e6
+.B semanage fcontext -a -t %(type)s '/srv/my%(domainname)s_content(/.*)?'
5b70e6
 .br
5b70e6
 .B restorecon -R -v /srv/my%(domainname)s_content
5b70e6
 
5b70e6
 Note: SELinux often uses regular expressions to specify labels that match multiple files.
5b70e6
-""" % {'domainname': self.domainname, "type": flist[0]})
5b70e6
+""" % {'domainname': self.domainname, "type": flist_non_exec[-1]})
5b70e6
 
5b70e6
         self.fd.write(r"""
5b70e6
 .I The following file types are defined for %(domainname)s:
5b70e6
-- 
5b70e6
2.32.0
5b70e6