Skip to content

list_semod() (from modules/selinux.py) incompatible with policycoreutils-2.5 (RHEL 7.3) #37732

Closed

Description

@dhaines

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

  1. changed the title [-]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)[/+] on Nov 16, 2016
  2. dhaines commented on Nov 16, 2016

    @dhaines
    Author

    Apparently, versioning of selinux modules is a thing of the past:

    SELinuxProject/selinux@e599a43

  3. added
    bug
    severity-medium
    P3
    Platform
    on Nov 16, 2016
  4. added this to the Approved milestone on Nov 16, 2016
  5. gtmanfred commented on Nov 16, 2016

    @gtmanfred
    Contributor

    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

  6. changed the title [-]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)[/+] on Nov 16, 2016
  7. dhaines commented on Nov 16, 2016

    @dhaines
    Author

    Sure thing. I'll try to get it to you today.

  8. gtmanfred commented on Nov 16, 2016

    @gtmanfred
    Contributor

    Awesome! thanks!

  9. dhaines commented on Nov 16, 2016

    @dhaines
    Author

    My first PR!

  10. gtmanfred commented on Nov 16, 2016

    @gtmanfred
    Contributor

    Awesome! thanks for submitting it. one of our core team members will review it later and merge it!

    Thanks
    Daniel

  11. added a commit that references this issue on Nov 24, 2016
  12. gtmanfred commented on Dec 29, 2016

    @gtmanfred
    Contributor

    Looks like this has been merged!

    Thanks,
    Daniel

  13. added
    good first issue
    and removed on May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Execution-ModuleP3Platformbuggood first issueseverity-medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions