7039bfb libselinux-2.5-15

Authored and Committed by plautrba 7 years ago
    libselinux-2.5-15
    
    libselinux: Rewrite restorecon() python method
    
    When the restorecon method was added to the libselinux swig python
    bindings, there was no libselinux restorecon implementation and it
    he had to call matchpathcon() which is deprecated in favor of
    selabel_lookup().
    
    The new restorecon method uses selinux_restorecon method from libselinux
    and which is exported by the previous commit.
    
    https://github.com/SELinuxProject/selinux/issues/29
    https://github.com/fedora-selinux/selinux/pull/35
    
    Fixes:
    >>> selinux.restorecon('/var/lib', recursive=True)
    Traceback (most recent call last):
      File "/usr/lib64/python3.5/site-packages/selinux/__init__.py", line 114, in restorecon
        status, context = matchpathcon(path, mode)
    FileNotFoundError: [Errno 2] No such file or directory
    
        
file modified
+71 -0
file modified
+5 -2