Fix a typo in the restorecon method, and import the stat module.

This commit is contained in:
Luke Macken 2008-11-18 21:25:09 +00:00
parent f4a6eb5feb
commit 8222e32ca0
1 changed files with 2 additions and 2 deletions

View File

@ -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 """