[policycoreutils] - Fix proper handling of getopt errors - Do not allow modules names to contain spaces
Daniel J Walsh
dwalsh at fedoraproject.org
Mon Jan 10 19:39:31 UTC 2011
commit 12eb5b45f4625b3151b4ecb59af24ab529888951
Author: Dan Walsh <dwalsh at redhat.com>
Date: Mon Jan 10 14:39:21 2011 -0500
- Fix proper handling of getopt errors
- Do not allow modules names to contain spaces
policycoreutils-gui.patch | 89 ++++++++++++-----------
policycoreutils-rhat.patch | 174 +++++++++++++++++++++++++++++++++-----------
policycoreutils.spec | 6 +-
3 files changed, 183 insertions(+), 86 deletions(-)
---
diff --git a/policycoreutils-gui.patch b/policycoreutils-gui.patch
index 497dc74..e34b245 100644
--- a/policycoreutils-gui.patch
+++ b/policycoreutils-gui.patch
@@ -1,6 +1,6 @@
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/booleansPage.py policycoreutils-2.0.85/gui/booleansPage.py
--- nsapolicycoreutils/gui/booleansPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/booleansPage.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/booleansPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,247 @@
+#
+# booleansPage.py - GUI for Booleans page in system-config-securitylevel
@@ -251,7 +251,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/booleansPage.py poli
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/domainsPage.py policycoreutils-2.0.85/gui/domainsPage.py
--- nsapolicycoreutils/gui/domainsPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/domainsPage.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/domainsPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,154 @@
+## domainsPage.py - show selinux domains
+## Copyright (C) 2009 Red Hat, Inc.
@@ -409,7 +409,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/domainsPage.py polic
+ self.error(e.args[0])
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/fcontextPage.py policycoreutils-2.0.85/gui/fcontextPage.py
--- nsapolicycoreutils/gui/fcontextPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/fcontextPage.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/fcontextPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,223 @@
+## fcontextPage.py - show selinux mappings
+## Copyright (C) 2006 Red Hat, Inc.
@@ -636,7 +636,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/fcontextPage.py poli
+ self.store.set_value(iter, TYPE_COL, "%s:%s" % (type, mls))
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/html_util.py policycoreutils-2.0.85/gui/html_util.py
--- nsapolicycoreutils/gui/html_util.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/html_util.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/html_util.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,164 @@
+# Authors: John Dennis <jdennis at redhat.com>
+#
@@ -804,7 +804,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/html_util.py policyc
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/lockdown.glade policycoreutils-2.0.85/gui/lockdown.glade
--- nsapolicycoreutils/gui/lockdown.glade 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/lockdown.glade 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/lockdown.glade 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,771 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
@@ -1579,7 +1579,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/lockdown.glade polic
+</glade-interface>
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/lockdown.gladep policycoreutils-2.0.85/gui/lockdown.gladep
--- nsapolicycoreutils/gui/lockdown.gladep 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/lockdown.gladep 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/lockdown.gladep 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
@@ -1590,7 +1590,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/lockdown.gladep poli
+</glade-project>
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/lockdown.py policycoreutils-2.0.85/gui/lockdown.py
--- nsapolicycoreutils/gui/lockdown.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/lockdown.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/lockdown.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,382 @@
+#!/usr/bin/python -Es
+#
@@ -1976,7 +1976,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/lockdown.py policyco
+ app.stand_alone()
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/loginsPage.py policycoreutils-2.0.85/gui/loginsPage.py
--- nsapolicycoreutils/gui/loginsPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/loginsPage.py 2011-01-04 17:02:41.000000000 -0500
++++ policycoreutils-2.0.85/gui/loginsPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,185 @@
+## loginsPage.py - show selinux mappings
+## Copyright (C) 2006 Red Hat, Inc.
@@ -2165,7 +2165,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/loginsPage.py policy
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/Makefile policycoreutils-2.0.85/gui/Makefile
--- nsapolicycoreutils/gui/Makefile 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/Makefile 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/Makefile 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,40 @@
+# Installation directories.
+PREFIX ?= ${DESTDIR}/usr
@@ -2209,7 +2209,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/Makefile policycoreu
+relabel:
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/mappingsPage.py policycoreutils-2.0.85/gui/mappingsPage.py
--- nsapolicycoreutils/gui/mappingsPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/mappingsPage.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/mappingsPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,56 @@
+## mappingsPage.py - show selinux mappings
+## Copyright (C) 2006 Red Hat, Inc.
@@ -2269,7 +2269,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/mappingsPage.py poli
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/modulesPage.py policycoreutils-2.0.85/gui/modulesPage.py
--- nsapolicycoreutils/gui/modulesPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/modulesPage.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/modulesPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,190 @@
+## modulesPage.py - show selinux mappings
+## Copyright (C) 2006-2009 Red Hat, Inc.
@@ -2463,7 +2463,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/modulesPage.py polic
+ self.error(e.args[0])
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgen.glade policycoreutils-2.0.85/gui/polgen.glade
--- nsapolicycoreutils/gui/polgen.glade 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/polgen.glade 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/polgen.glade 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,3305 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
@@ -5772,7 +5772,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgen.glade policyc
+</glade-interface>
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgen.gladep policycoreutils-2.0.85/gui/polgen.gladep
--- nsapolicycoreutils/gui/polgen.gladep 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/polgen.gladep 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/polgen.gladep 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
@@ -5783,8 +5783,8 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgen.gladep policy
+</glade-project>
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgengui.py policycoreutils-2.0.85/gui/polgengui.py
--- nsapolicycoreutils/gui/polgengui.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/polgengui.py 2011-01-04 17:02:52.000000000 -0500
-@@ -0,0 +1,657 @@
++++ policycoreutils-2.0.85/gui/polgengui.py 2011-01-10 14:24:00.000000000 -0500
+@@ -0,0 +1,662 @@
+#!/usr/bin/python -Es
+#
+# polgengui.py - GUI for SELinux Config tool in system-config-selinux
@@ -6295,7 +6295,8 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgengui.py policyc
+ self.druid = self.xml.get_widget("druid")
+ self.type = 0
+ self.name_entry = self.xml.get_widget("name_entry")
-+ self.name_entry.connect("focus_out_event",self.on_name_entry_changed)
++ self.name_entry.connect("insert_text",self.on_name_entry_changed)
++ self.name_entry.connect("focus_out_event",self.on_focus_out_event)
+ self.exec_entry = self.xml.get_widget("exec_entry")
+ self.exec_button = self.xml.get_widget("exec_button")
+ self.init_script_entry = self.xml.get_widget("init_script_entry")
@@ -6344,7 +6345,11 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgengui.py policyc
+ return
+ self.output_entry.set_text(self.file_dialog.get_filename())
+
-+ def on_name_entry_changed(self, entry, third):
++ def on_name_entry_changed(self, entry, text, size, position):
++ if text.find(" ") >= 0:
++ entry.emit_stop_by_name("insert_text")
++
++ def on_focus_out_event(self, entry, third):
+ name = entry.get_text()
+ if self.name != name:
+ if name in self.all_types:
@@ -6444,7 +6449,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgengui.py policyc
+ app.stand_alone()
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgen.py policycoreutils-2.0.85/gui/polgen.py
--- nsapolicycoreutils/gui/polgen.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/polgen.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/polgen.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,1311 @@
+#!/usr/bin/python -Es
+#
@@ -7759,7 +7764,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/polgen.py policycore
+ usage(e)
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/portsPage.py policycoreutils-2.0.85/gui/portsPage.py
--- nsapolicycoreutils/gui/portsPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/portsPage.py 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/portsPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,259 @@
+## portsPage.py - show selinux mappings
+## Copyright (C) 2006 Red Hat, Inc.
@@ -8022,7 +8027,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/portsPage.py policyc
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/selinux.tbl policycoreutils-2.0.85/gui/selinux.tbl
--- nsapolicycoreutils/gui/selinux.tbl 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/selinux.tbl 2010-12-21 16:16:39.000000000 -0500
++++ policycoreutils-2.0.85/gui/selinux.tbl 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,234 @@
+acct_disable_trans _("SELinux Service Protection") _("Disable SELinux protection for acct daemon")
+allow_daemons_dump_core _("Admin") _("Allow all daemons to write corefiles to /")
@@ -8260,7 +8265,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/selinux.tbl policyco
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/semanagePage.py policycoreutils-2.0.85/gui/semanagePage.py
--- nsapolicycoreutils/gui/semanagePage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/semanagePage.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/semanagePage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,168 @@
+## semanagePage.py - show selinux mappings
+## Copyright (C) 2006 Red Hat, Inc.
@@ -8432,7 +8437,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/semanagePage.py poli
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/statusPage.py policycoreutils-2.0.85/gui/statusPage.py
--- nsapolicycoreutils/gui/statusPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/statusPage.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/statusPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,190 @@
+# statusPage.py - show selinux status
+## Copyright (C) 2006-2009 Red Hat, Inc.
@@ -8626,7 +8631,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/statusPage.py policy
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/system-config-selinux.glade policycoreutils-2.0.85/gui/system-config-selinux.glade
--- nsapolicycoreutils/gui/system-config-selinux.glade 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/system-config-selinux.glade 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/system-config-selinux.glade 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,3024 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
@@ -11654,7 +11659,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/system-config-selinu
+</glade-interface>
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/system-config-selinux.gladep policycoreutils-2.0.85/gui/system-config-selinux.gladep
--- nsapolicycoreutils/gui/system-config-selinux.gladep 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/system-config-selinux.gladep 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/system-config-selinux.gladep 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,7 @@
+<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
+<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
@@ -11665,7 +11670,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/system-config-selinu
+</glade-project>
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/system-config-selinux.py policycoreutils-2.0.85/gui/system-config-selinux.py
--- nsapolicycoreutils/gui/system-config-selinux.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/system-config-selinux.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/system-config-selinux.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,187 @@
+#!/usr/bin/python -Es
+#
@@ -11856,7 +11861,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/system-config-selinu
+ app.stand_alone()
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/boolean.py policycoreutils-2.0.85/gui/templates/boolean.py
--- nsapolicycoreutils/gui/templates/boolean.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/boolean.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/boolean.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,40 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -11900,7 +11905,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/boolean.py
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/etc_rw.py policycoreutils-2.0.85/gui/templates/etc_rw.py
--- nsapolicycoreutils/gui/templates/etc_rw.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/etc_rw.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/etc_rw.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,113 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -12017,7 +12022,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/etc_rw.py
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/executable.py policycoreutils-2.0.85/gui/templates/executable.py
--- nsapolicycoreutils/gui/templates/executable.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/executable.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/executable.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,393 @@
+# Copyright (C) 2007-2009 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -12414,7 +12419,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/executable
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/__init__.py policycoreutils-2.0.85/gui/templates/__init__.py
--- nsapolicycoreutils/gui/templates/__init__.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/__init__.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/__init__.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2007 Red Hat, Inc.
@@ -12436,7 +12441,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/__init__.p
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/network.py policycoreutils-2.0.85/gui/templates/network.py
--- nsapolicycoreutils/gui/templates/network.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/network.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/network.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,80 @@
+te_port_types="""
+type TEMPLATETYPE_port_t;
@@ -12520,7 +12525,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/network.py
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/polgen.py policycoreutils-2.0.85/gui/templates/polgen.py
--- nsapolicycoreutils/gui/templates/polgen.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/polgen.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/polgen.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,1303 @@
+#!/usr/bin/python -Es
+#
@@ -13827,7 +13832,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/polgen.py
+ usage(e)
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/rw.py policycoreutils-2.0.85/gui/templates/rw.py
--- nsapolicycoreutils/gui/templates/rw.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/rw.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/rw.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,131 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -13962,7 +13967,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/rw.py poli
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/script.py policycoreutils-2.0.85/gui/templates/script.py
--- nsapolicycoreutils/gui/templates/script.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/script.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/script.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,126 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -14092,7 +14097,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/script.py
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/semodule.py policycoreutils-2.0.85/gui/templates/semodule.py
--- nsapolicycoreutils/gui/templates/semodule.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/semodule.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/semodule.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,41 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -14137,7 +14142,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/semodule.p
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/tmp.py policycoreutils-2.0.85/gui/templates/tmp.py
--- nsapolicycoreutils/gui/templates/tmp.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/tmp.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/tmp.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,102 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -14243,7 +14248,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/tmp.py pol
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/user.py policycoreutils-2.0.85/gui/templates/user.py
--- nsapolicycoreutils/gui/templates/user.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/user.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/user.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,205 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -14452,7 +14457,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/user.py po
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_cache.py policycoreutils-2.0.85/gui/templates/var_cache.py
--- nsapolicycoreutils/gui/templates/var_cache.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/var_cache.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/var_cache.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,133 @@
+# Copyright (C) 2010 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -14589,7 +14594,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_cache.
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_lib.py policycoreutils-2.0.85/gui/templates/var_lib.py
--- nsapolicycoreutils/gui/templates/var_lib.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/var_lib.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/var_lib.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,161 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -14754,7 +14759,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_lib.py
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_log.py policycoreutils-2.0.85/gui/templates/var_log.py
--- nsapolicycoreutils/gui/templates/var_log.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/var_log.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/var_log.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,116 @@
+# Copyright (C) 2007,2010 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -14874,7 +14879,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_log.py
+
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_run.py policycoreutils-2.0.85/gui/templates/var_run.py
--- nsapolicycoreutils/gui/templates/var_run.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/var_run.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/var_run.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,101 @@
+# Copyright (C) 2007,2010 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -14979,7 +14984,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_run.py
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_spool.py policycoreutils-2.0.85/gui/templates/var_spool.py
--- nsapolicycoreutils/gui/templates/var_spool.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/templates/var_spool.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/templates/var_spool.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,133 @@
+# Copyright (C) 2007 Red Hat
+# see file 'COPYING' for use and warranty information
@@ -15116,7 +15121,7 @@ diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/templates/var_spool.
+"""
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/gui/usersPage.py policycoreutils-2.0.85/gui/usersPage.py
--- nsapolicycoreutils/gui/usersPage.py 1969-12-31 19:00:00.000000000 -0500
-+++ policycoreutils-2.0.85/gui/usersPage.py 2010-12-21 16:16:40.000000000 -0500
++++ policycoreutils-2.0.85/gui/usersPage.py 2011-01-06 16:45:14.000000000 -0500
@@ -0,0 +1,150 @@
+## usersPage.py - show selinux mappings
+## Copyright (C) 2006,2007,2008 Red Hat, Inc.
diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch
index 5c75722..4bbecb0 100644
--- a/policycoreutils-rhat.patch
+++ b/policycoreutils-rhat.patch
@@ -2793,7 +2793,7 @@ index 0000000..e2befdb
+ packages=["policycoreutils"],
+)
diff --git a/policycoreutils/semanage/semanage b/policycoreutils/semanage/semanage
-index ffaca5b..05d6834 100644
+index ffaca5b..bc989bf 100644
--- a/policycoreutils/semanage/semanage
+++ b/policycoreutils/semanage/semanage
@@ -1,4 +1,4 @@
@@ -2944,23 +2944,70 @@ index ffaca5b..05d6834 100644
object = argv[0]
option_dict=get_options()
if object not in option_dict.keys():
-@@ -197,10 +222,14 @@ Object-specific Options (see above):
+@@ -196,58 +221,84 @@ Object-specific Options (see above):
+
args = argv[1:]
- gopts, cmds = getopt.getopt(args,
+- gopts, cmds = getopt.getopt(args,
- '01adf:i:lhmnp:s:FCDR:L:r:t:P:S:M:',
-+ '01adEe:f:i:lhmnp:s:FCDR:L:r:t:P:S:M:',
- ['add',
- 'delete',
- 'deleteall',
-+ 'equal=',
-+ 'enable',
-+ 'extract',
-+ 'disable',
- 'ftype=',
- 'file',
- 'help',
-@@ -225,29 +254,47 @@ Object-specific Options (see above):
+- ['add',
+- 'delete',
+- 'deleteall',
+- 'ftype=',
+- 'file',
+- 'help',
+- 'input=',
+- 'list',
+- 'modify',
+- 'noheading',
+- 'localist',
+- 'off',
+- 'on',
+- 'proto=',
+- 'seuser=',
+- 'store=',
+- 'range=',
+- 'locallist=',
+- 'level=',
+- 'roles=',
+- 'type=',
+- 'prefix=',
+- 'mask='
+- ])
++ try:
++ gopts, cmds = getopt.getopt(args,
++ '01adEe:f:i:lhmnp:s:FCDR:L:r:t:P:S:M:',
++ ['add',
++ 'delete',
++ 'deleteall',
++ 'equal=',
++ 'enable',
++ 'extract',
++ 'disable',
++ 'ftype=',
++ 'file',
++ 'help',
++ 'input=',
++ 'list',
++ 'modify',
++ 'noheading',
++ 'localist',
++ 'off',
++ 'on',
++ 'proto=',
++ 'seuser=',
++ 'store=',
++ 'range=',
++ 'locallist=',
++ 'level=',
++ 'roles=',
++ 'type=',
++ 'prefix=',
++ 'mask='
++ ])
++ except getopt.error, error:
++ usage(_("Options Error %s ") % error.msg)
++
for o, a in gopts:
if o not in option_dict[object]:
sys.stderr.write(_("%s not valid for %s objects\n") % ( o, object) );
@@ -3015,7 +3062,7 @@ index ffaca5b..05d6834 100644
if o == "-n" or o == "--noheading":
heading = False
-@@ -256,8 +303,7 @@ Object-specific Options (see above):
+@@ -256,8 +307,7 @@ Object-specific Options (see above):
locallist = True
if o == "-m"or o == "--modify":
@@ -3025,7 +3072,7 @@ index ffaca5b..05d6834 100644
modify = True
if o == "-S" or o == '--store':
-@@ -292,8 +338,10 @@ Object-specific Options (see above):
+@@ -292,8 +342,10 @@ Object-specific Options (see above):
if o == "--on" or o == "-1":
value = "on"
@@ -3036,7 +3083,7 @@ index ffaca5b..05d6834 100644
if object == "login":
OBJECT = seobject.loginRecords(store)
-@@ -315,6 +363,11 @@ Object-specific Options (see above):
+@@ -315,6 +367,11 @@ Object-specific Options (see above):
if object == "boolean":
OBJECT = seobject.booleanRecords(store)
@@ -3048,7 +3095,7 @@ index ffaca5b..05d6834 100644
if object == "permissive":
OBJECT = seobject.permissiveRecords(store)
-@@ -330,65 +383,97 @@ Object-specific Options (see above):
+@@ -330,65 +387,97 @@ Object-specific Options (see above):
OBJECT.deleteall()
return
@@ -3158,7 +3205,7 @@ index ffaca5b..05d6834 100644
if delete:
if object == "port":
OBJECT.delete(target, proto)
-@@ -401,15 +486,14 @@ Object-specific Options (see above):
+@@ -401,50 +490,65 @@ Object-specific Options (see above):
else:
OBJECT.delete(target)
@@ -3176,32 +3223,65 @@ index ffaca5b..05d6834 100644
input = None
store = ""
-@@ -417,7 +501,7 @@ Object-specific Options (see above):
+ if len(sys.argv) < 3:
usage(_("Requires 2 or more arguments"))
- gopts, cmds = getopt.getopt(sys.argv[1:],
+- gopts, cmds = getopt.getopt(sys.argv[1:],
- '01adf:i:lhmnp:s:FCDR:L:r:t:T:P:S:',
-+ '01adf:i:lhmno:p:s:FCDR:L:r:t:T:P:S:',
- ['add',
- 'delete',
- 'deleteall',
-@@ -431,6 +515,7 @@ Object-specific Options (see above):
- 'localist',
- 'off',
- 'on',
-+ 'output=',
- 'proto=',
- 'seuser=',
- 'store=',
-@@ -438,6 +523,7 @@ Object-specific Options (see above):
- 'level=',
- 'roles=',
- 'type=',
-+ 'trans=',
- 'prefix='
- ])
+- ['add',
+- 'delete',
+- 'deleteall',
+- 'ftype=',
+- 'file',
+- 'help',
+- 'input=',
+- 'list',
+- 'modify',
+- 'noheading',
+- 'localist',
+- 'off',
+- 'on',
+- 'proto=',
+- 'seuser=',
+- 'store=',
+- 'range=',
+- 'level=',
+- 'roles=',
+- 'type=',
+- 'prefix='
+- ])
++ try:
++ gopts, cmds = getopt.getopt(sys.argv[1:],
++ '01adf:i:lhmno:p:s:FCDR:L:r:t:T:P:S:',
++ ['add',
++ 'delete',
++ 'deleteall',
++ 'ftype=',
++ 'file',
++ 'help',
++ 'input=',
++ 'list',
++ 'modify',
++ 'noheading',
++ 'localist',
++ 'off',
++ 'on',
++ 'output=',
++ 'proto=',
++ 'seuser=',
++ 'store=',
++ 'range=',
++ 'level=',
++ 'roles=',
++ 'type=',
++ 'trans=',
++ 'prefix='
++ ])
++ except getopt.error, error:
++ usage(_("Options Error %s ") % error.msg)
++
for o, a in gopts:
-@@ -445,6 +531,16 @@ Object-specific Options (see above):
+ if o == "-S" or o == '--store':
store = a
if o == "-i" or o == '--input':
input = a
@@ -3218,7 +3298,15 @@ index ffaca5b..05d6834 100644
if input != None:
if input == "-":
-@@ -467,3 +563,5 @@ Object-specific Options (see above):
+@@ -459,11 +563,11 @@ Object-specific Options (see above):
+ else:
+ process_args(sys.argv[1:])
+
+- except getopt.error, error:
+- usage(_("Options Error %s ") % error.msg)
+ except ValueError, error:
+ errorExit(error.args[0])
+ except KeyError, error:
errorExit(_("Invalid value %s") % error.args[0])
except IOError, error:
errorExit(error.args[1])
diff --git a/policycoreutils.spec b/policycoreutils.spec
index 62f5dfe..08d3751 100644
--- a/policycoreutils.spec
+++ b/policycoreutils.spec
@@ -7,7 +7,7 @@
Summary: SELinux policy core utilities
Name: policycoreutils
Version: 2.0.85
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPLv2
Group: System Environment/Base
# Based on git repository with tag 20101221
@@ -329,6 +329,10 @@ fi
exit 0
%changelog
+* Thu Jan 6 2011 Dan Walsh <dwalsh at redhat.com> 2.0.85-4
+- Fix proper handling of getopt errors
+- Do not allow modules names to contain spaces
+
* Wed Jan 5 2011 Dan Walsh <dwalsh at redhat.com> 2.0.85-3
- Polgengui raises the wrong type of exception. #471078
- Change semanage to not allow it to semanage module -D
More information about the scm-commits
mailing list