pycontribs / selinux

Pure-python selinux shim module for use in virtualenvs
MIT License
20 stars 19 forks source link

use sys.executable #68

Open br-olf opened 1 year ago

br-olf commented 1 year ago

Fixed nasty bug

br-olf commented 1 year ago

How to add PR labels?

br-olf commented 1 year ago

I rewrote my PR to look for selinux site-package in all provided places and it should now be easy to add further places to look into. Please review the PR now.

br-olf commented 1 year ago

BTW, this now also adds support for virtualenvs

br-olf commented 1 year ago

@ssbarnea Do you have any plans of merging this?

fbicknel commented 1 year ago

This (gh pr checkout 68) fixed my problem using the selinux package with pyenv with a virtualenv. I vote for merge.

gonzalemario commented 8 months ago

Hi. I think this is working because it's reloading on itself and the check for is_selinux_enabled() is always the local one, not from the original library. I tested this on a selinux enabled system and I always receive a '0', which it's the return call from the local method instead.

If I'm understanding correctly, this shim library should reload using selinux bindings if they are installed. If this is correct, I understand why we cannot merge this.

Please correct me if I'm wrong.

ps: I also looking for a solution to this problem. I can help if you guys let me.

gonzalemario commented 7 months ago

ansible now from version 8, loads selinux differently. Basically it's using ctypes to get the .so

I might understand why the main developers haven't payed attention to this PR

cinnion commented 21 hours ago

Can someone please get this reviewed and merged?!! #17 not only fixed virtualenv setups, but broke more standard installs such as those done from source, which install under /usr/local/bin by default (and might even break RHEL SCL installs which would install under /opt/rh... I have just started using those, so have not checked). See my comment on #69 for more info.