From ad349ef1adc8edc07b73fcaec2a71b82b93353e3 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Wed, 5 Jun 2013 13:26:26 -0400 Subject: [PATCH] Fix handing of semanage with no args --- policycoreutils-semanage.patch | 27 ++++++++++++--------------- policycoreutils.spec | 5 ++++- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/policycoreutils-semanage.patch b/policycoreutils-semanage.patch index 9096116..ec27e14 100644 --- a/policycoreutils-semanage.patch +++ b/policycoreutils-semanage.patch @@ -1,6 +1,6 @@ diff -up policycoreutils-2.1.14/semanage/semanage.semanage policycoreutils-2.1.14/semanage/semanage ---- policycoreutils-2.1.14/semanage/semanage.semanage 2013-05-28 11:04:07.196665120 -0400 -+++ policycoreutils-2.1.14/semanage/semanage 2013-05-28 11:04:21.122726993 -0400 +--- policycoreutils-2.1.14/semanage/semanage.semanage 2013-06-05 13:24:34.958339017 -0400 ++++ policycoreutils-2.1.14/semanage/semanage 2013-06-05 13:24:53.591429169 -0400 @@ -1,5 +1,7 @@ #! /usr/bin/python -Es -# Copyright (C) 2005-2012 Red Hat @@ -10,7 +10,7 @@ diff -up policycoreutils-2.1.14/semanage/semanage.semanage policycoreutils-2.1.1 # see file 'COPYING' for use and warranty information # # semanage is a tool for managing SELinux configuration files -@@ -19,567 +21,705 @@ +@@ -19,567 +21,702 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # 02111-1307 USA # @@ -696,18 +696,15 @@ diff -up policycoreutils-2.1.14/semanage/semanage.semanage policycoreutils-2.1.1 + return commandParser + +def make_args(sys_args): -+ args = None -+ -+ # handle old '-o' and '-i" options for semanage -+ if sys_args[1] == "-o" and len(sys_args) == 3: -+ args = [ "export", "-f", sys_args[2] ] -+ if sys_args[1] == "-S" and sys_args[3] == "-o" and len(sys_args) == 5: -+ args = [ "export", "-S", sys_args[2], "-f", sys_args[4] ] -+ if sys_args[1] == "-i" and len(sys_args) == 3: -+ args = [ "import", "-f", sys.argv[2] ] -+ if sys_args[1] == "-S" and sys_args[3] == "-i" and len(sys_args) == 5: -+ args = [ "import", "-S", sys_args[2], "-f", sys_args[4] ] -+ ++ args = [] ++ for i in sys_args: ++ if i == '-o': ++ args += [ "export", "-f" ] ++ continue ++ if i == '-i': ++ args += [ "import", "-f" ] ++ continue ++ args.append(i) + return args + +def do_parser(): diff --git a/policycoreutils.spec b/policycoreutils.spec index 1f6621a..b0a4f23 100644 --- a/policycoreutils.spec +++ b/policycoreutils.spec @@ -7,7 +7,7 @@ Summary: SELinux policy core utilities Name: policycoreutils Version: 2.1.14 -Release: 48%{?dist} +Release: 49%{?dist} License: GPLv2 Group: System Environment/Base # Based on git repository with tag 20101221 @@ -311,6 +311,9 @@ The policycoreutils-restorecond package contains the restorecond service. %systemd_postun_with_restart restorecond.service %changelog +* Wed Jun 5 2013 Dan Walsh - 2.1.14-49 +- Fix handing of semanage with no args + * Tue Jun 4 2013 Dan Walsh - 2.1.14-48 - Fix audit2allow -o to open file for append - Fix the name of the spec file generated in the build script