Support /sys/fs/selinux/context for bug #410687.
authorSven Vermeulen <swift@gentoo.org>
Thu, 5 Apr 2012 16:40:55 +0000 (09:40 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 5 Apr 2012 16:40:55 +0000 (09:40 -0700)
bin/misc-functions.sh

index b08389714cc4a80fa801574d43f5e3e2ee962843..4e81ddf5743e05253e6c62e4051dd364999f9c48 100755 (executable)
@@ -1095,13 +1095,15 @@ preinst_selinux_labels() {
                # SELinux file labeling (needs to always be last in dyn_preinst)
                # only attempt to label if setfiles is executable
                # and 'context' is available on selinuxfs.
-               if [ -f /selinux/context -a -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
+               if [ -f /selinux/context -o -f /sys/fs/selinux/context ] && \
+                       [ -x /usr/sbin/setfiles -a -x /usr/sbin/selinuxconfig ]; then
                        vecho ">>> Setting SELinux security labels"
                        (
                                eval "$(/usr/sbin/selinuxconfig)" || \
                                        die "Failed to determine SELinux policy paths.";
        
-                               addwrite /selinux/context;
+                               addwrite /selinux/context
+                               addwrite /sys/fs/selinux/context
        
                                /usr/sbin/setfiles "${file_contexts_path}" -r "${D}" "${D}"
                        ) || die "Failed to set SELinux security labels."