[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 52/90] policycoreutils: polgen: FIXME Add mgrepl patch to



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Currently sepolgen only looks for the rpm spec file related to the executable
that has been shipped.  Several Fedora packagers are shipping their systemd
content in separate rpm spec files, this patch allows us to look to see if
there is a NAME-systemd rpm associated with a package so we can setup proper
labeling of the unit files.

Acked by me.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/JFAcACgkQrlYvE4MpobOgWACfS10Pzbmes4Eo7ZElvZcknqCD
w0UAn3hmGvLKl8gWPAflpfjm+FZrKA3+
=iqba
-----END PGP SIGNATURE-----
>From 8430fb3b47289af7e325e49299f9857caca3f845 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@xxxxxxxxxx>
Date: Thu, 26 Apr 2012 13:53:14 -0400
Subject: [PATCH 52/90] policycoreutils: polgen: FIXME Add mgrepl patch to
 search for systemd subpackage

[what is this patch about?]

Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---
 policycoreutils/gui/polgen.py |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/policycoreutils/gui/polgen.py b/policycoreutils/gui/polgen.py
index baf9d67..668ec6e 100644
--- a/policycoreutils/gui/polgen.py
+++ b/policycoreutils/gui/polgen.py
@@ -1140,6 +1140,22 @@ allow %s_t %s_t:%s_socket name_%s;
                         else:
                             self.add_dir(f)
             fd.close()
+
+            # some packages have own systemd subpackage
+            # tor-systemd for example
+            binary_name = self.program.split("/")[-1]
+            rc, output = commands.getstatusoutput("rpm -q %s-systemd" % binary_name)
+            if rc == 0:
+                fd = os.popen("rpm -ql %s-systemd" % binary_name)
+                for f in fd.read().split():
+                    for b in self.DEFAULT_DIRS:
+                        if f.startswith(b):
+                            if os.path.isfile(f):
+                                self.add_file(f)
+                            else:
+                                self.add_dir(f)
+                fd.close()
+
             if os.path.isfile("/var/run/%s.pid"  % self.name):
                 self.add_file("/var/run/%s.pid"  % self.name)
 
-- 
1.7.10.2


[Fedora Users]     [Fedora Legacy]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite News]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

Powered by Linux