From 8ccbffc2e3cc0026dad33c73b9451baf9331fe79 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 15 Nov 2006 13:11:30 +0000 Subject: [PATCH] * Tue Nov 14 2006 Dan Walsh 1.33.1-2 - Fix Module handling in system-config-selinux --- policycoreutils-rhat.patch | 318 +++++++++++++++++++------------------ policycoreutils.spec | 7 +- 2 files changed, 165 insertions(+), 160 deletions(-) diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index 324808b..798b8c6 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -578,15 +578,23 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolicycoreutils/gui/Makefile policycoreutils-1.33.1/gui/Makefile --- nsapolicycoreutils/gui/Makefile 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.33.1/gui/Makefile 2006-11-14 10:27:04.000000000 -0500 -@@ -0,0 +1,20 @@ ++++ policycoreutils-1.33.1/gui/Makefile 2006-11-15 08:08:54.000000000 -0500 +@@ -0,0 +1,28 @@ +# Installation directories. +PREFIX ?= ${DESTDIR}/usr +SHAREDIR ?= $(PREFIX)/share/system-config-selinux + -+TARGETS= booleansPage.py portsPage.py fcontextPage.py loginsPage.py \ -+statusPage.py translationsPage.py semanagePage.py usersPage.py \ -+mappingsPage.py system-config-selinux.glade ++TARGETS= \ ++booleansPage.py \ ++fcontextPage.py \ ++loginsPage.py \ ++mappingsPage.py \ ++modulesPage.py \ ++portsPage.py \ ++semanagePage.py \ ++statusPage.py \ ++translationsPage.py \ ++usersPage.py + +all: $(TARGETS) system-config-selinux.py + @@ -658,6 +666,143 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + for k in keys: + print "%-25s %-25s %-25s" % (k, dict[k][0], translate(dict[k][1])) + +diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolicycoreutils/gui/modulesPage.py policycoreutils-1.33.1/gui/modulesPage.py +--- nsapolicycoreutils/gui/modulesPage.py 1969-12-31 19:00:00.000000000 -0500 ++++ policycoreutils-1.33.1/gui/modulesPage.py 2006-11-15 08:06:25.000000000 -0500 +@@ -0,0 +1,133 @@ ++## modulesPage.py - show selinux mappings ++## Copyright (C) 2006 Red Hat, Inc. ++ ++## 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 ++## the Free Software Foundation; either version 2 of the License, or ++## (at your option) any later version. ++ ++## This program is distributed in the hope that it will be useful, ++## but WITHOUT ANY WARRANTY; without even the implied warranty of ++## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++## GNU General Public License for more details. ++ ++## You should have received a copy of the GNU General Public License ++## along with this program; if not, write to the Free Software ++## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ ++## Author: Dan Walsh ++import string ++import gtk ++import gtk.glade ++import os ++import commands ++import libxml2 ++import gobject ++import sys ++import seobject ++from semanagePage import *; ++ ++## ++## I18N ++## ++PROGNAME="policycoreutils" ++import gettext ++gettext.bindtextdomain(PROGNAME, "/usr/share/locale") ++gettext.textdomain(PROGNAME) ++try: ++ gettext.install(PROGNAME, localedir="/usr/share/locale", unicode=1) ++except IOError: ++ import __builtin__ ++ __builtin__.__dict__['_'] = unicode ++ ++class modulesPage(semanagePage): ++ def __init__(self, xml): ++ semanagePage.__init__(self, xml, "modules", "SELinux Policy Module") ++ self.store = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING) ++ self.view.set_model(self.store) ++ self.store.set_sort_column_id(0, gtk.SORT_ASCENDING) ++ col = gtk.TreeViewColumn(_("Module Name"), gtk.CellRendererText(), text = 0) ++ col.set_sort_column_id(0) ++ col.set_resizable(True) ++ self.view.append_column(col) ++ self.store.set_sort_column_id(0, gtk.SORT_ASCENDING) ++ col = gtk.TreeViewColumn(_("Version"), gtk.CellRendererText(), text = 1) ++ col.set_sort_column_id(1) ++ col.set_resizable(True) ++ self.view.append_column(col) ++ self.store.set_sort_func(1,self.sort_int, "") ++ ++ self.load() ++ ++ def sort_int(self, treemodel, iter1, iter2, user_data): ++ try: ++ p1 = int(treemodel.get_value(iter1,1)) ++ p2 = int(treemodel.get_value(iter1,1)) ++ if p1 > p2: ++ return 1 ++ if p1 == p2: ++ return 0 ++ return -1 ++ except: ++ return 0 ++ ++ def load(self): ++ self.store.clear() ++ fd=os.popen("semodule -l") ++ l = fd.readlines() ++ fd.close() ++ for i in l: ++ module, ver = i.split('\t') ++ iter = self.store.append() ++ self.store.set_value(iter, 0, module.strip()) ++ self.store.set_value(iter, 1, ver.strip()) ++ ++ self.view.get_selection().select_path ((0,)) ++ ++ def delete(self): ++ store, iter = self.view.get_selection().get_selected() ++ module = store.get_value(iter, 0) ++ try: ++ status, output =commands.getstatusoutput("semodule -r %s" % module) ++ if status != 0: ++ self.error(output) ++ else: ++ store.remove(iter) ++ self.view.get_selection().select_path ((0,)) ++ ++ except ValueError, e: ++ self.error(e.args[0]) ++ ++ def addDialog(self): ++ dialog = gtk.FileChooserDialog(_("Load Policy Module"), ++ None, ++ gtk.FILE_CHOOSER_ACTION_OPEN, ++ (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, ++ gtk.STOCK_OPEN, gtk.RESPONSE_OK)) ++ dialog.set_default_response(gtk.RESPONSE_OK) ++ ++ filter = gtk.FileFilter() ++ filter.set_name("Policy Files") ++ filter.add_pattern("*.pp") ++ dialog.add_filter(filter) ++ ++ response = dialog.run() ++ if response == gtk.RESPONSE_OK: ++ self.add(dialog.get_filename()) ++ dialog.destroy() ++ ++ def add(self, file): ++ try: ++ status, output =commands.getstatusoutput("semodule -i %s" % file) ++ if status != 0: ++ self.error(output) ++ else: ++ self.load() ++ ++ except ValueError, e: ++ self.error(e.args[0]) ++ ++ ++ ++ ++ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolicycoreutils/gui/portsPage.py policycoreutils-1.33.1/gui/portsPage.py --- nsapolicycoreutils/gui/portsPage.py 1969-12-31 19:00:00.000000000 -0500 +++ policycoreutils-1.33.1/gui/portsPage.py 2006-11-14 09:54:05.000000000 -0500 @@ -1176,8 +1321,8 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolicycoreutils/gui/system-config-selinux.glade policycoreutils-1.33.1/gui/system-config-selinux.glade --- nsapolicycoreutils/gui/system-config-selinux.glade 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.33.1/gui/system-config-selinux.glade 2006-11-14 09:54:05.000000000 -0500 -@@ -0,0 +1,2760 @@ ++++ policycoreutils-1.33.1/gui/system-config-selinux.glade 2006-11-15 08:06:56.000000000 -0500 +@@ -0,0 +1,2616 @@ + + + @@ -3653,134 +3798,6 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + + + -+ -+ True -+ False -+ 0 -+ -+ -+ -+ True -+ GTK_ORIENTATION_HORIZONTAL -+ GTK_TOOLBAR_BOTH -+ True -+ True -+ -+ -+ -+ True -+ New File -+ gtk-add -+ True -+ True -+ False -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ -+ True -+ Open File -+ gtk-properties -+ True -+ True -+ False -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ -+ True -+ Save File -+ gtk-delete -+ True -+ True -+ False -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ 0 -+ False -+ False -+ -+ -+ -+ -+ -+ True -+ True -+ GTK_POLICY_ALWAYS -+ GTK_POLICY_ALWAYS -+ GTK_SHADOW_NONE -+ GTK_CORNER_TOP_LEFT -+ -+ -+ -+ True -+ True -+ True -+ False -+ False -+ True -+ False -+ False -+ False -+ -+ -+ -+ -+ 0 -+ True -+ True -+ -+ -+ -+ -+ False -+ True -+ -+ -+ -+ -+ -+ True -+ label43 -+ False -+ False -+ GTK_JUSTIFY_LEFT -+ False -+ False -+ 0.5 -+ 0.5 -+ 0 -+ 0 -+ PANGO_ELLIPSIZE_NONE -+ -1 -+ False -+ 0 -+ -+ -+ tab -+ -+ -+ -+ + + True + False @@ -3811,26 +3828,10 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + + + -+ -+ True -+ Open File -+ gtk-properties -+ True -+ True -+ False -+ -+ -+ -+ False -+ True -+ -+ -+ -+ + + True + Save File -+ gtk-delete ++ gtk-remove + True + True + False @@ -3859,7 +3860,7 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + GTK_CORNER_TOP_LEFT + + -+ ++ + True + True + True @@ -3940,8 +3941,8 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolicycoreutils/gui/system-config-selinux.py policycoreutils-1.33.1/gui/system-config-selinux.py --- nsapolicycoreutils/gui/system-config-selinux.py 1969-12-31 19:00:00.000000000 -0500 -+++ policycoreutils-1.33.1/gui/system-config-selinux.py 2006-11-14 11:02:17.000000000 -0500 -@@ -0,0 +1,163 @@ ++++ policycoreutils-1.33.1/gui/system-config-selinux.py 2006-11-15 08:06:42.000000000 -0500 +@@ -0,0 +1,164 @@ +#!/usr/bin/python +# +# system-config-selinux.py - GUI for SELinux Config tool in system-config-selinux @@ -3978,6 +3979,7 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic +import loginsPage +import usersPage +import portsPage ++import modulesPage +import fcontextPage +import translationsPage +## @@ -4019,13 +4021,13 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + xml.signal_connect("on_add_clicked", self.add) + xml.signal_connect("on_properties_clicked", self.properties) + self.status_page=statusPage.statusPage(xml) -+ self.boolean_page=booleansPage.booleansPage(xml) ++ self.tabs.append(booleansPage.booleansPage(xml)) + self.tabs.append(fcontextPage.fcontextPage(xml)) + self.tabs.append(loginsPage.loginsPage(xml)) + self.tabs.append(translationsPage.translationsPage(xml)) + self.tabs.append(usersPage.usersPage(xml)) + self.tabs.append(portsPage.portsPage(xml)) -+ self.tabs.append(None) # modules ++ self.tabs.append(modulesPage.modulesPage(xml)) # modules + self.tabs.append(None) # interfaces + + xml.signal_connect("on_quit_activate", self.destroy) @@ -4087,7 +4089,7 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic + iter = self.store.append() + self.store.set_value(iter, 0, _("Network Ports")) + iter = self.store.append() -+ self.store.set_value(iter, 0, _("Loaded Policy Modules")) ++ self.store.set_value(iter, 0, _("Policy Modules")) + self.view.get_selection().select_path ((0,)) + + def stand_alone(self): diff --git a/policycoreutils.spec b/policycoreutils.spec index e524bf7..47e496b 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -5,7 +5,7 @@ Summary: SELinux policy core utilities. Name: policycoreutils Version: 1.33.1 -Release: 1 +Release: 2 License: GPL Group: System Environment/Base Source: http://www.nsa.gov/selinux/archives/policycoreutils-%{version}.tgz @@ -168,7 +168,10 @@ fi [ -x /sbin/service ] && /sbin/service restorecond condrestart %changelog -* Tue Nov 14 2006 Dan Walsh 1.33.1-3 +* Tue Nov 14 2006 Dan Walsh 1.33.1-2 +- Fix Module handling in system-config-selinux + +* Tue Nov 14 2006 Dan Walsh 1.33.1-1 - Update to upstream * Merged newrole patch set from Michael Thompson. - Add policycoreutils-gui