Fix handing of semanage with no args

This commit is contained in:
Dan Walsh 2013-06-05 13:26:26 -04:00
parent 4f084e9fcd
commit ad349ef1ad
2 changed files with 16 additions and 16 deletions

View File

@ -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():

View File

@ -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 <dwalsh@redhat.com> - 2.1.14-49
- Fix handing of semanage with no args
* Tue Jun 4 2013 Dan Walsh <dwalsh@redhat.com> - 2.1.14-48
- Fix audit2allow -o to open file for append
- Fix the name of the spec file generated in the build script