Bug 866296

Summary: semanage: not possible to feed multiple commands from stdin
Product: [Fedora] Fedora Reporter: Matt Kinni <matt>
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: policycoreutils-2.1.13-27.3.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-01 02:27:05 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 Matt Kinni 2012-10-15 04:10:14 UTC
Description of problem:
Hello.  I saw a post on Dan Walsh's blog <http://danwalsh.livejournal.com/41593.html> that showed how you can process many semanage commands in one transaction like so:

semanage -S targeted -i - << _EOF
boolean -m --on allow_polyinstantiation
boolean -m --on xguest_connect_network
boolean -m --on xguest_mount_media
boolean -m --on xguest_use_bluetooth
_EOF

However, running this on my system outputs an error:

Traceback (most recent call last):
  File "/sbin/semanage", line 566, in <module>
    trans.finish()
  File "/usr/lib64/python2.7/site-packages/seobject.py", line 285, in finish
    self.commit()
  File "/usr/lib64/python2.7/site-packages/seobject.py", line 274, in commit
    semanage_set_reload(self.sh, self.reload)
TypeError: in method 'semanage_set_reload', argument 2 of type 'int'

None of the commands end up being processed.

Version-Release number of selected component (if applicable):
policycoreutils-python-2.1.11-18.fc17.x86_64

How reproducible:
Always

Steps to Reproduce:
1. run the example code above
2.
3.
  
Actual results:
semange explodes

Expected results:
works as intended

Additional info:
I'm not sure how to debug this further.  Let me know if you need anything else

Comment 1 Daniel Walsh 2013-02-08 17:41:12 UTC
Fixed in policycoreutils-2.1.13-27.3.fc17

Comment 2 Fedora Update System 2013-02-08 19:28:53 UTC
policycoreutils-2.1.13-27.3.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/policycoreutils-2.1.13-27.3.fc17

Comment 3 Fedora Update System 2013-02-09 11:22:21 UTC
Package policycoreutils-2.1.13-27.3.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.13-27.3.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-2163/policycoreutils-2.1.13-27.3.fc17
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-06-01 02:27:05 UTC
policycoreutils-2.1.13-27.3.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.