Repository navigation
Description
Description of Issue/Question
policycoreutils 2.5 (RHEL 7.3's version of choice) changes the output of 'semodule -l' in relation to earlier versions (or at least v. 2.2.5), doing away with the display of the various modules' versions. Thus, list_semod() breaks when it tries to parse semodule's output and assign version numbers to the respective dictionary element on a RHEL 7.3 minion.
Setup
RHEL 7.3 on minion with an SLS using the selinux.module state, e.g.:
wireshark:
selinux.module
Steps to Reproduce Issue
state.apply any SLS with a selinux.module state therein. You will get the following errors:
[ERROR ] An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/state.py", line 1733, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1652, in wrapper
return f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/salt/states/selinux.py", line 186, in module
modules = salt'selinux.list_semod'
File "/usr/lib/python2.7/site-packages/salt/modules/selinux.py", line 254, in list_semod
'Version': comps[1]}
IndexError: list index out of range
Versions Report
Salt Version:
Salt: 2016.3.3
Dependency Versions:
cffi: 0.8.6
cherrypy: Not Installed
dateutil: 1.5
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: 0.21.0
libnacl: Not Installed
M2Crypto: 0.21.1
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: 2.14
pycrypto: 2.6.1
pygit2: 0.21.4
Python: 2.7.5 (default, Aug 29 2016, 10:12:21)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: redhat 7.2 Maipo
machine: x86_64
release: 3.10.0-327.36.2.el7.x86_64
system: Linux
version: Red Hat Enterprise Linux Server 7.2 Maipo
Activity
[-]list_semod (from modules/selinux.py) incompatible with policycoreutils-2.2.5 (RHEL 7.3)[/-][+]list_semod() (from modules/selinux.py) incompatible with policycoreutils-2.2.5 (RHEL 7.3)[/+]dhaines commentedon Nov 16, 2016
Apparently, versioning of selinux modules is a thing of the past:
SELinuxProject/selinux@e599a43
gtmanfred commentedon Nov 16, 2016
Thank you for reporting this.
I have tagged it as low hanging fruit, but also with our platform team. If you wouldn't mind submitting a pull request fixing this issue, we would greatly appreciate it!
Thanks,
Daniel
[-]list_semod() (from modules/selinux.py) incompatible with policycoreutils-2.2.5 (RHEL 7.3)[/-][+]list_semod() (from modules/selinux.py) incompatible with policycoreutils-2.5 (RHEL 7.3)[/+]dhaines commentedon Nov 16, 2016
Sure thing. I'll try to get it to you today.
gtmanfred commentedon Nov 16, 2016
Awesome! thanks!
dhaines commentedon Nov 16, 2016
My first PR!
gtmanfred commentedon Nov 16, 2016
Awesome! thanks for submitting it. one of our core team members will review it later and merge it!
Thanks
Daniel
Merge pull request #37736 from dhaines/issue-37732
gtmanfred commentedon Dec 29, 2016
Looks like this has been merged!
Thanks,
Daniel