mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-30 18:12:10 +00:00
regerate swig wrappers for commit 09836bf0c1
This commit is contained in:
parent
09836bf0c1
commit
3726a7783e
@ -48,6 +48,20 @@ except AttributeError:
|
||||
del types
|
||||
|
||||
|
||||
import shutil, os, stat
|
||||
|
||||
def restorecon(path, recursive=False):
|
||||
""" Restore SELinux context on a given path """
|
||||
mode = os.lstat(path)[stat.ST_MODE]
|
||||
status, context = matchpathcon(path, mode)
|
||||
if status == 0:
|
||||
lsetfilecon(path, context)
|
||||
if recursive:
|
||||
os.path.walk(path, lambda arg, dirname, fnames:
|
||||
map(restorecon, [os.path.join(dirname, fname)
|
||||
for fname in fnames]), None)
|
||||
|
||||
|
||||
is_selinux_enabled = _selinux.is_selinux_enabled
|
||||
is_selinux_mls_enabled = _selinux.is_selinux_mls_enabled
|
||||
getcon = _selinux.getcon
|
||||
|
Loading…
Reference in New Issue
Block a user