Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python import selinux #46

Closed
Fastidious opened this issue Feb 3, 2017 · 3 comments
Closed

Python import selinux #46

Fastidious opened this issue Feb 3, 2017 · 3 comments

Comments

@Fastidious
Copy link

Fastidious commented Feb 3, 2017

I am getting this, on a RHEL 6.8 machine:

[fast@pandora]$ python
Python 2.6.6 (r266:84292, Aug  9 2016, 06:11:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import selinux
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/selinux/__init__.py", line 25, in <module>
    _selinux = swig_import_helper()
  File "/usr/lib64/python2.6/site-packages/selinux/__init__.py", line 21, in swig_import_helper
    _mod = imp.load_module('_selinux', fp, pathname, description)
ImportError: /usr/lib64/python2.6/site-packages/selinux/_selinux.so: undefined symbol: selinux_set_policy_root
>>>

Can anyone shed some light? The following is the output of the installed selinux packages:

[fast@pandora]$ yum list installed | grep selinux
libselinux.x86_64          2.0.94-5.3.el6_4.1   installed
libselinux.x86_64          2.0.94-7.el6         @rhel-x86_64-server-6.8-20160802
libselinux-python.x86_64   2.0.94-7.el6         @rhel-x86_64-server-6.8-20160802
libselinux-ruby.x86_64     2.0.94-7.el6         @rhel-x86_64-server-6.8-20170131
libselinux-utils.x86_64    2.0.94-7.el6         @rhel-x86_64-server-6.8-20160802
selinux-policy.noarch      3.7.19-292.el6_8.2   @rhel-x86_64-server-6.8-20170131
selinux-policy-targeted.noarch
@stephensmalley
Copy link
Member

Bugs in the RHEL packages should be filed at bugzilla.redhat.com, not here - this issue tracker is for issues with the upstream selinux code. I can't reproduce your issue with the upstream selinux code. libselinux 2.0.94 was from the 20100525 release of selinux. selinux_set_policy_root() was not introduced until 2013. I assume Red Hat back-ported a patch incorrectly, introducing a caller of the function without the function's definition, but I don't really know. This assumes of course that you are using the pristine RHEL packages and not some locally customized one.

@bachradsusi
Copy link
Member

Works for me.

libselinux.x86_64          2.0.94-5.3.el6_4.1   installed
libselinux.x86_64          2.0.94-7.el6         @rhel-x86_64-server-6.8-20160802

I guess it's a conflict among those 2 packages as selinux_set_policy_root was added to libselinux-2.0.94-6.el6. Please remove the older one and try it again.

@Fastidious
Copy link
Author

@bachradsusi that is the fix. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants