From 11643b3535da185ed2fd5039a197156eff39868f Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Wed, 19 Jun 2013 10:44:58 -0400 Subject: [PATCH] Fix semanage export/import commands - Fix semange module command --- policycoreutils-rhat.patch | 6992 +++++++++++++++++++++++++++----- policycoreutils-semanage.patch | 44 +- policycoreutils.spec | 8 +- 3 files changed, 5917 insertions(+), 1127 deletions(-) diff --git a/policycoreutils-rhat.patch b/policycoreutils-rhat.patch index 8ec6308..fd701b3 100644 --- a/policycoreutils-rhat.patch +++ b/policycoreutils-rhat.patch @@ -1,14 +1,3 @@ -diff --git a/policycoreutils/.tx/config b/policycoreutils/.tx/config -index 07643e9..daff18c 100644 ---- a/policycoreutils/.tx/config -+++ b/policycoreutils/.tx/config -@@ -1,5 +1,5 @@ - [main] --host = https://www.transifex.net -+host = https://www.transifex.com - - [policycoreutils.policycoreutils] - file_filter = po/.po diff --git a/policycoreutils/Makefile b/policycoreutils/Makefile index 3980799..6624804 100644 --- a/policycoreutils/Makefile @@ -45,10 +34,20 @@ index 88635d4..fc290ea 100644 clean: rm -f *~ diff --git a/policycoreutils/audit2allow/audit2allow b/policycoreutils/audit2allow/audit2allow -index 8e0c396..1059bea 100644 +index 8e0c396..9f5185d 100644 --- a/policycoreutils/audit2allow/audit2allow +++ b/policycoreutils/audit2allow/audit2allow -@@ -18,7 +18,7 @@ +@@ -1,7 +1,8 @@ + #! /usr/bin/python -Es + # Authors: Karl MacMillan ++# Authors: Dan Walsh + # +-# Copyright (C) 2006-2007 Red Hat ++# Copyright (C) 2006-2013 Red Hat + # see file 'COPYING' for use and warranty information + # + # This program is free software; you can redistribute it and/or +@@ -18,7 +19,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # @@ -57,7 +56,7 @@ index 8e0c396..1059bea 100644 import sepolgen.audit as audit import sepolgen.policygen as policygen -@@ -29,6 +29,8 @@ import sepolgen.defaults as defaults +@@ -29,6 +30,8 @@ import sepolgen.defaults as defaults import sepolgen.module as module from sepolgen.sepolgeni18n import _ import selinux.audit2why as audit2why @@ -66,7 +65,7 @@ index 8e0c396..1059bea 100644 class AuditToPolicy: VERSION = "%prog .1" -@@ -80,8 +82,7 @@ class AuditToPolicy: +@@ -80,8 +83,7 @@ class AuditToPolicy: parser.add_option("--interface-info", dest="interface_info", help="file name of interface information") parser.add_option("--debug", dest="debug", action="store_true", default=False, help="leave generated modules for -M") @@ -76,7 +75,7 @@ index 8e0c396..1059bea 100644 help="Translates SELinux audit messages into a description of why the access was denied") options, args = parser.parse_args() -@@ -267,12 +268,10 @@ class AuditToPolicy: +@@ -267,12 +269,10 @@ class AuditToPolicy: continue if rc == audit2why.CONSTRAINT: @@ -93,7 +92,16 @@ index 8e0c396..1059bea 100644 if rc == audit2why.RBAC: print "\t\tMissing role allow rule.\n" -@@ -350,6 +349,9 @@ class AuditToPolicy: +@@ -329,7 +329,7 @@ class AuditToPolicy: + g.set_module_name(self.__options.module) + + if self.__options.output: +- fd = open(self.__options.output, "w") ++ fd = open(self.__options.output, "a") + else: + fd = sys.stdout + writer.write(g.get_module(), fd) +@@ -350,6 +350,9 @@ class AuditToPolicy: except ValueError, e: print e sys.exit(1) @@ -343,6 +351,33 @@ index 0000000..fcfa81d + true + + +diff --git a/policycoreutils/gui/polgengui.py b/policycoreutils/gui/polgengui.py +index 1c16f7b..b89bf1a 100644 +--- a/policycoreutils/gui/polgengui.py ++++ b/policycoreutils/gui/polgengui.py +@@ -4,7 +4,7 @@ + # + # Dan Walsh + # +-# 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 + diff --git a/policycoreutils/gui/selinux-polgengui.8 b/policycoreutils/gui/selinux-polgengui.8 new file mode 100644 index 0000000..52bf7dd @@ -74562,12 +74597,15 @@ index 15ea022..6a0c217 100644 "Allow ZoneMinder to modify public files used for public file transfer " "services." diff --git a/policycoreutils/po/fr.po b/policycoreutils/po/fr.po -index 783f5aa..65e4751 100644 +index 783f5aa..5b2b7b5 100644 --- a/policycoreutils/po/fr.po +++ b/policycoreutils/po/fr.po -@@ -3,20 +3,20 @@ +@@ -1,27 +1,27 @@ + # SOME DESCRIPTIVE TITLE. + # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. - # +-# ++# # Translators: -# Alain PORTAL , 2007. -# Charles-Antoine Couret , 2009. @@ -74591,21 +74629,44 @@ index 783f5aa..65e4751 100644 -"PO-Revision-Date: 2013-01-04 17:02+0000\n" -"Last-Translator: dwalsh \n" +"POT-Creation-Date: 2013-05-07 11:12-0400\n" -+"PO-Revision-Date: 2013-06-08 12:21+0000\n" ++"PO-Revision-Date: 2013-04-28 08:45+0000\n" +"Last-Translator: Jérôme Fenal \n" "Language-Team: French \n" ++"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -@@ -31,7 +31,7 @@ msgid "" + "Content-Transfer-Encoding: 8bit\n" +-"Language: fr\n" + "Plural-Forms: nplurals=2; plural=(n > 1);\n" + + #: ../run_init/run_init.c:67 +@@ -29,9 +29,12 @@ msgid "" + "USAGE: run_init