Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-17351

system-config-selinux can't be called directly

    • policycoreutils-2.9-25.el8
    • None
    • Moderate
    • rhel-sst-security-selinux
    • ssg_security
    • 25
    • None
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • No
    • Red Hat Enterprise Linux
    • None
    • Hide

      The system-config-selinux command does not print the ModuleNotFoundError message when executed by the root user or common users.

      Show
      The system-config-selinux command does not print the ModuleNotFoundError message when executed by the root user or common users.
    • Pass
    • Automated
    • Release Note Not Required
    • x86_64
    • None

      What were you trying to do that didn't work?

      Run system-config-selinux directly

      Please provide the package NVR for which bug is seen:

      policycoreutils-2.9-24.el8.src.rpm

      How reproducible:

      always

      Steps to reproduce

      1. run system-config-selinux
      2.  
      3.  

      Expected results

      Run without issue

      Actual results

      1. system-config-selinux  
        Unable to init server: Could not connect: Connection refused
        Unable to init server: Could not connect: Connection refused
        Traceback (most recent call last):
         File "/usr/share/system-config-selinux/system-config-selinux.py", line 39, in <module>
           import statusPage
        ModuleNotFoundError: No module named 'statusPage'

       

      • This is because of the shebang with -I in /usr/share/system-config-selinux/system-config-selinux.py:

      #! /usr/libexec/platform-python -EsI


      {{ -I Run Python in isolated mode. This also implies -E and -s. In isolated mode sys.path contains neither the script's directory nor the user's site-packages directory. All PYTHON* environment variables are ignored, too. Further restrictions may be imposed to prevent the user from injecting malicious code.}}

      • {{A fix might be to move the sys.path.append('/usr/share/system-config-selinux') before the import statusPage}}

        * A workaround is to run with python3, but this work only with root user (no call of pkexec):

        python3 /usr/share/system-config-selinux/system-config-selinux.py

              vmojzis@redhat.com Vit Mojzis
              rhn-support-bwelterl Benoit Welterlen
              Vit Mojzis Vit Mojzis
              Milos Malik Milos Malik
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: