[libselinux/f13/master] Add chcon patch
Daniel J Walsh
dwalsh at fedoraproject.org
Mon Aug 23 14:26:34 UTC 2010
commit 43c1b465a4640a24773c7e1060a27fd8c90c173f
Author: Dan Walsh <dwalsh at redhat.com>
Date: Mon Aug 23 10:26:08 2010 -0400
Add chcon patch
libselinux-2.0.94_chcon.patch | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
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)
More information about the scm-commits
mailing list