From 8222e32ca0052abc9ec15a36f6d390885e5a9b89 Mon Sep 17 00:00:00 2001 From: Luke Macken Date: Tue, 18 Nov 2008 21:25:09 +0000 Subject: [PATCH] Fix a typo in the restorecon method, and import the stat module. --- libselinux-rhat.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libselinux-rhat.patch b/libselinux-rhat.patch index 2ccf200..397c6d4 100644 --- a/libselinux-rhat.patch +++ b/libselinux-rhat.patch @@ -164,7 +164,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libs +%pythoncode %{ + -+import shutil, os ++import shutil, os, stat + +def restorecon(path, recursive=False): + """ Restore SELinux context on a given path """ @@ -175,7 +175,7 @@ diff --exclude-from=exclude -N -u -r nsalibselinux/src/selinuxswig_python.i libs + if recursive: + os.path.walk(path, lambda arg, dirname, fnames: + map(restorecon, [os.path.join(dirname, fname) -+ s for fname in fnames]), None) ++ for fname in fnames]), None) + +def copytree(src, dest): + """ An SELinux-friendly shutil.copytree method """