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

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



---
 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:
-- 
1.6.1


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