* Tue Nov 14 2006 Dan Walsh <dwalsh@redhat.com> 1.33.1-2
- Fix Module handling in system-config-selinux
This commit is contained in:
parent
e568e7aef9
commit
ed275eb345
@ -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 @@
|
||||
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
+
|
||||
@ -3653,134 +3798,6 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic
|
||||
+ </child>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkVBox" id="vbox16">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="homogeneous">False</property>
|
||||
+ <property name="spacing">0</property>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkToolbar" id="toolbar7">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
+ <property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
|
||||
+ <property name="tooltips">True</property>
|
||||
+ <property name="show_arrow">True</property>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkToolButton" id="toolbutton20">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="tooltip" translatable="yes">New File</property>
|
||||
+ <property name="stock_id">gtk-add</property>
|
||||
+ <property name="visible_horizontal">True</property>
|
||||
+ <property name="visible_vertical">True</property>
|
||||
+ <property name="is_important">False</property>
|
||||
+ <signal name="clicked" handler="on_add_clicked" last_modification_time="Mon, 16 Jan 2006 18:27:03 GMT"/>
|
||||
+ </widget>
|
||||
+ <packing>
|
||||
+ <property name="expand">False</property>
|
||||
+ <property name="homogeneous">True</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkToolButton" id="toolbutton21">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="tooltip" translatable="yes">Open File</property>
|
||||
+ <property name="stock_id">gtk-properties</property>
|
||||
+ <property name="visible_horizontal">True</property>
|
||||
+ <property name="visible_vertical">True</property>
|
||||
+ <property name="is_important">False</property>
|
||||
+ <signal name="clicked" handler="on_properties_clicked" last_modification_time="Mon, 16 Jan 2006 18:26:51 GMT"/>
|
||||
+ </widget>
|
||||
+ <packing>
|
||||
+ <property name="expand">False</property>
|
||||
+ <property name="homogeneous">True</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkToolButton" id="toolbutton22">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="tooltip" translatable="yes">Save File</property>
|
||||
+ <property name="stock_id">gtk-delete</property>
|
||||
+ <property name="visible_horizontal">True</property>
|
||||
+ <property name="visible_vertical">True</property>
|
||||
+ <property name="is_important">False</property>
|
||||
+ <signal name="clicked" handler="on_delete_clicked" last_modification_time="Mon, 16 Jan 2006 18:26:29 GMT"/>
|
||||
+ </widget>
|
||||
+ <packing>
|
||||
+ <property name="expand">False</property>
|
||||
+ <property name="homogeneous">True</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
+ </widget>
|
||||
+ <packing>
|
||||
+ <property name="padding">0</property>
|
||||
+ <property name="expand">False</property>
|
||||
+ <property name="fill">False</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkScrolledWindow" id="scrolledwindow14">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="can_focus">True</property>
|
||||
+ <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
|
||||
+ <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
|
||||
+ <property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkTreeView" id="interfacesView">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="can_focus">True</property>
|
||||
+ <property name="headers_visible">True</property>
|
||||
+ <property name="rules_hint">False</property>
|
||||
+ <property name="reorderable">False</property>
|
||||
+ <property name="enable_search">True</property>
|
||||
+ <property name="fixed_height_mode">False</property>
|
||||
+ <property name="hover_selection">False</property>
|
||||
+ <property name="hover_expand">False</property>
|
||||
+ </widget>
|
||||
+ </child>
|
||||
+ </widget>
|
||||
+ <packing>
|
||||
+ <property name="padding">0</property>
|
||||
+ <property name="expand">True</property>
|
||||
+ <property name="fill">True</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
+ </widget>
|
||||
+ <packing>
|
||||
+ <property name="tab_expand">False</property>
|
||||
+ <property name="tab_fill">True</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkLabel" id="label43">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="label" translatable="yes">label43</property>
|
||||
+ <property name="use_underline">False</property>
|
||||
+ <property name="use_markup">False</property>
|
||||
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
+ <property name="wrap">False</property>
|
||||
+ <property name="selectable">False</property>
|
||||
+ <property name="xalign">0.5</property>
|
||||
+ <property name="yalign">0.5</property>
|
||||
+ <property name="xpad">0</property>
|
||||
+ <property name="ypad">0</property>
|
||||
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
+ <property name="width_chars">-1</property>
|
||||
+ <property name="single_line_mode">False</property>
|
||||
+ <property name="angle">0</property>
|
||||
+ </widget>
|
||||
+ <packing>
|
||||
+ <property name="type">tab</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkVBox" id="vbox17">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="homogeneous">False</property>
|
||||
@ -3811,26 +3828,10 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic
|
||||
+ </child>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkToolButton" id="toolbutton24">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="tooltip" translatable="yes">Open File</property>
|
||||
+ <property name="stock_id">gtk-properties</property>
|
||||
+ <property name="visible_horizontal">True</property>
|
||||
+ <property name="visible_vertical">True</property>
|
||||
+ <property name="is_important">False</property>
|
||||
+ <signal name="clicked" handler="on_properties_clicked" last_modification_time="Mon, 16 Jan 2006 18:26:51 GMT"/>
|
||||
+ </widget>
|
||||
+ <packing>
|
||||
+ <property name="expand">False</property>
|
||||
+ <property name="homogeneous">True</property>
|
||||
+ </packing>
|
||||
+ </child>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkToolButton" id="toolbutton25">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="tooltip" translatable="yes">Save File</property>
|
||||
+ <property name="stock_id">gtk-delete</property>
|
||||
+ <property name="stock_id">gtk-remove</property>
|
||||
+ <property name="visible_horizontal">True</property>
|
||||
+ <property name="visible_vertical">True</property>
|
||||
+ <property name="is_important">False</property>
|
||||
@ -3859,7 +3860,7 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic
|
||||
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
+
|
||||
+ <child>
|
||||
+ <widget class="GtkTreeView" id="treeview6">
|
||||
+ <widget class="GtkTreeView" id="modulesView">
|
||||
+ <property name="visible">True</property>
|
||||
+ <property name="can_focus">True</property>
|
||||
+ <property name="headers_visible">True</property>
|
||||
@ -3940,8 +3941,8 @@ diff --exclude-from=exclude --exclude='*.po' --exclude='*.pot' -N -u -r nsapolic
|
||||
+</glade-interface>
|
||||
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):
|
||||
|
@ -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 <dwalsh@redhat.com> 1.33.1-3
|
||||
* Tue Nov 14 2006 Dan Walsh <dwalsh@redhat.com> 1.33.1-2
|
||||
- Fix Module handling in system-config-selinux
|
||||
|
||||
* Tue Nov 14 2006 Dan Walsh <dwalsh@redhat.com> 1.33.1-1
|
||||
- Update to upstream
|
||||
* Merged newrole patch set from Michael Thompson.
|
||||
- Add policycoreutils-gui
|
||||
|
Loading…
Reference in New Issue
Block a user