From 43c1b465a4640a24773c7e1060a27fd8c90c173f Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Aug 23 2010 14:26:08 +0000 Subject: Add chcon patch --- diff --git a/libselinux-2.0.94_chcon.patch b/libselinux-2.0.94_chcon.patch new file mode 100644 index 0000000..15ec1ba --- /dev/null +++ b/libselinux-2.0.94_chcon.patch @@ -0,0 +1,18 @@ +diff -up libselinux-2.0.94/src/selinuxswig_python.i.chcon libselinux-2.0.94/src/selinuxswig_python.i +--- libselinux-2.0.94/src/selinuxswig_python.i.chcon 2010-08-23 10:23:50.000000000 -0400 ++++ libselinux-2.0.94/src/selinuxswig_python.i 2010-08-23 10:23:54.000000000 -0400 +@@ -21,6 +21,14 @@ def restorecon(path, recursive=False): + map(restorecon, [os.path.join(dirname, fname) + for fname in fnames]), None) + ++def chcon(path, context, recursive=False): ++ """ Set the SELinux context on a given path """ ++ lsetfilecon(path, context) ++ if recursive: ++ for root, dirs, files in os.walk(path): ++ for name in files + dirs: ++ lsetfilecon(os.path.join(root,name), context) ++ + def copytree(src, dest): + """ An SELinux-friendly shutil.copytree method """ + shutil.copytree(src, dest)