[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] Ensure we set the SELinux context correctly on symlinks (#505054)



Looks good,

Regards,

Hans


On 06/26/2009 08:51 PM, Jeremy Katz wrote:
---
  livecd.py |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/livecd.py b/livecd.py
index b186d00..900eb8c 100644
--- a/livecd.py
+++ b/livecd.py
@@ -65,6 +65,8 @@ def copytree(src, dst, symlinks=False, preserveOwner=False,
              if symlinks and os.path.islink(srcname):
                  linkto = os.readlink(srcname)
                  os.symlink(linkto, dstname)
+                if preserveSelinux:
+                    selinux.lsetfilecon(dstname, selinux.lgetfilecon(srcname)[1])
              elif os.path.isdir(srcname):
                  copytree(srcname, dstname, symlinks, preserveOwner, preserveSelinux)
              else:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]