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

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