Bug 815725

Summary: semanage fcontext -l -e requires two arguments
Product: [Fedora] Fedora Reporter: Stef Walter <stefw>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-20 16:17:11 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 Stef Walter 2012-04-24 11:29:00 UTC
Description of problem:

The command 'semanage fcontext -l -e' fails unless you specify two paths as arguments. These arguments are not used, as far as I can tell. They can be anything.

The same applies to semanage fcontext -D -e

This is confusing.

Version-Release number of selected component (if applicable):

Name        : policycoreutils
Arch        : x86_64
Version     : 2.1.11
Release     : 5.fc17

How reproducible:

Every time

Steps to Reproduce:
1. Run 'semanage fcontext -l -e' as root
  
Actual results:

/sbin/semanage: 
semanage [ -S store ] -i [ input_file | - ]
semanage [ -S store ] -o [ output_file | - ]

semanage login -{a|d|m|l|D|E} [-nsr] login_name | %groupname
semanage user -{a|d|m|l|D|E} [-LnrRP] selinux_name
semanage port -{a|d|m|l|D|E} [-ntr] [ -p proto ] port | port_range
semanage interface -{a|d|m|l|D|E} [-ntr] interface_spec
semanage module -{a|d|m} [--enable|--disable] module
semanage node -{a|d|m|l|D|E} [-ntr] [ -p protocol ] [-M netmask] addr
semanage fcontext -{a|d|m|l|D|E} [-efnrst] file_spec
semanage boolean -{d|m} [--on|--off|-1|-0] -F boolean | boolean_file
semanage permissive -{d|a|l} [-n] type
semanage dontaudit [ on | off ]
...

Expected results:

Print out the fcontext info.

Comment 1 Stef Walter 2012-04-24 11:34:05 UTC
Hmmm, it looks like the '-e' isn't needed at all. 'semanage fcontext -l' works fine.

Comment 2 Stef Walter 2012-04-24 12:00:51 UTC
A patch something like this, might help clear things up. The manpage confused me :)

diff --git a/policycoreutils/semanage/semanage.8 b/policycoreutils/semanage/sema
index c5e18d9..91a01a1 100644
--- a/policycoreutils/semanage/semanage.8
+++ b/policycoreutils/semanage/semanage.8
@@ -44,9 +44,11 @@ Manage network node type definitions
 
 Manage file context mapping definitions
 .br
-.B semanage fcontext [\-S store] \-{a|d|m|l|D} [\-fnrst] file_spec
+.B semanage fcontext [\-S store] \-{l|D} [\-nrst] file_spec
 .br
-.B semanage fcontext [\-S store] \-{a|d|m|l|D} [\-n] \-e replacement target
+.B semanage fcontext [\-S store] \-{a|d|m} [\-frst] file_spec
+.br
+.B semanage fcontext [\-S store] \-{a|d|m} \-e replacement target
 .br

Comment 3 Daniel Walsh 2012-04-24 15:23:58 UTC
Applied fix to policycoreutils-2.1.11-7.fc18

Will back port to F17 on next push of policycoreutils.

Comment 4 Daniel Walsh 2012-10-16 19:18:54 UTC
Fixed in policycoreutils-2.1.12-4.fc17

Comment 5 Fedora Update System 2012-10-24 13:04:12 UTC
policycoreutils-2.1.12-4.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/policycoreutils-2.1.12-4.fc17

Comment 6 Fedora Update System 2012-10-24 23:56:04 UTC
Package policycoreutils-2.1.12-4.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing policycoreutils-2.1.12-4.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-16848/policycoreutils-2.1.12-4.fc17
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2012-11-01 01:24:56 UTC
Package policycoreutils-2.1.12-5.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing policycoreutils-2.1.12-5.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-16848/policycoreutils-2.1.12-5.fc17
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2012-12-20 16:17:13 UTC
policycoreutils-2.1.12-5.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.