Bug 1208797

Summary: semanage -o does not work in combination with -S minimum
Product: Red Hat Enterprise Linux 7 Reporter: Milos Malik <mmalik>
Component: policycoreutilsAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: dapospis, dwalsh, lvrabec, mgrepl, mmalik, plautrba, pvrabec, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: policycoreutils-2.2.5-19.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1122850 Environment:
Last Closed: 2015-11-19 12:49:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milos Malik 2015-04-03 08:36:48 UTC
Following commands work fine:
 # semanage -S mls -o -
 # semanage -S targeted -o -

but "semanage -S minimum -o -" does not. Even if the selinux-policy-minimum package is installed.

Version-Release number of selected component (if applicable):
policycoreutils-2.2.5-15.el7.x86_64
policycoreutils-devel-2.2.5-15.el7.x86_64
policycoreutils-newrole-2.2.5-15.el7.x86_64
policycoreutils-python-2.2.5-15.el7.x86_64
policycoreutils-restorecond-2.2.5-15.el7.x86_64
policycoreutils-sandbox-2.2.5-15.el7.x86_64
selinux-policy-3.13.1-24.el7.noarch
selinux-policy-devel-3.13.1-24.el7.noarch
selinux-policy-doc-3.13.1-24.el7.noarch
selinux-policy-minimum-3.13.1-24.el7.noarch
selinux-policy-mls-3.13.1-24.el7.noarch
selinux-policy-sandbox-3.13.1-24.el7.noarch
selinux-policy-targeted-3.13.1-24.el7.noarch

Steps to reproduce:
# ls -l /etc/selinux/minimum/
total 16
-rw-r--r--. 1 root root 2589 Mar 31 09:12 booleans.subs_dist
drwxr-xr-x. 4 root root 4096 Apr  2 10:21 contexts
drwxr-xr-x. 2 root root    6 Mar 31 09:12 logins
drwxr-xr-x. 3 root root   70 Apr  2 10:21 modules
drwxr-xr-x. 2 root root   22 Apr  2 10:21 policy
-rw-r--r--. 1 root root  607 Mar 31 09:12 setrans.conf
-rw-r--r--. 1 root root  176 Apr  2 10:21 seusers
# semanage -S minimum -o -
usage: semanage export [-h] [-S STORE] [-f OUTPUT_FILE]
semanage export: error: argument -S/--store: expected one argument
# echo $?
2
#

Comment 1 Miroslav Grepl 2015-07-09 07:47:34 UTC
Easy fix.

--- /usr/sbin/semanage~	2015-07-09 09:46:03.644120855 +0200
+++ /usr/sbin/semanage	2015-07-09 09:46:14.903176323 +0200
@@ -798,7 +798,7 @@
 
 def make_io_args(args):
     # import/export backward compability
-    args_origin = ["-S", "-o", "-i", "targeted", "minumum", "mls"]
+    args_origin = ["-S", "-o", "-i", "targeted", "minimum", "mls"]
     args_file = []
     args_ie = []
     args_subcommand = []

Comment 2 Petr Lautrbach 2015-07-09 08:15:17 UTC
Mirek, thank you for the patch.

Comment 5 errata-xmlrpc 2015-11-19 12:49:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2098.html