[PATCH 59/74] Change polgengui to use latest interfaces availabel in

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

 



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


   This patch looks good to me. acked.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJpNu4ACgkQrlYvE4MpobPjCACdF3VkZXevcRakrshjRSOegDsN
kqQAnjc6Q199ZxtRofVKQxIofZbSSS6B
=ydba
-----END PGP SIGNATURE-----
>From 34e9c015d0f564fa3bc7bc29c83170d3d8e5e3b8 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@xxxxxxxxxx>
Date: Fri, 11 Oct 2013 09:21:48 -0400
Subject: [PATCH 59/74] Change polgengui to use latest interfaces availabel in
 sepolicy toolchain.

---
 policycoreutils/gui/polgengui.py | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/policycoreutils/gui/polgengui.py b/policycoreutils/gui/polgengui.py
index 1c16f7b..8b6f902 100644
--- a/policycoreutils/gui/polgengui.py
+++ b/policycoreutils/gui/polgengui.py
@@ -4,7 +4,7 @@
 #
 # Dan Walsh <dwalsh@xxxxxxxxxx>
 #
-# Copyright (C) 2007-2012 Red Hat
+# Copyright (C) 2007-2013 Red Hat
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,7 +28,12 @@ import os
 import gobject
 import gnome
 import sys
-from sepolicy import generate
+try:
+    from sepolicy import generate
+except ValueError,e:
+    sys.stderr.write("%s: %s\n" % (e.__class__.__name__, str(e)))
+    sys.exit(1)
+    
 import sepolicy.interface
 import commands
 
@@ -320,14 +325,16 @@ class childWindow:
         col = gtk.TreeViewColumn(_("Application"), gtk.CellRendererText(), text = 0)
         self.admin_treeview.append_column(col)
 
-
-        for u in sepolicy.interface.get_user():
-            iter = self.transition_store.append()
-            self.transition_store.set_value(iter, 0, u)
-
-        for a in sepolicy.interface.get_admin():
-            iter = self.admin_store.append()
-            self.admin_store.set_value(iter, 0, a)
+        try:
+            for u in sepolicy.interface.get_user():
+                iter = self.transition_store.append()
+                self.transition_store.set_value(iter, 0, u)
+
+            for a in sepolicy.interface.get_admin():
+                iter = self.admin_store.append()
+                self.admin_store.set_value(iter, 0, a)
+        except ValueError,e:
+            self.error(e.message)
 
     def confine_application(self):
         return self.get_type() in generate.APPLICATIONS
-- 
1.8.3.1


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux