[systemd-devel] [PATCH 2/2] udev: do NOT re-label smack

WaLyong Cho walyong.cho at samsung.com
Sun Aug 17 23:06:52 PDT 2014


If selinux is disabled and smack is only enabled, smack label is
re-lable-ed by label_fix. To avoid, make only be labeled for selinux.
---
 src/udev/udev-node.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 9ec98bc..f4f4827 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -314,8 +314,8 @@ static int node_permissions_apply(struct udev_device *dev, bool apply,
                 }
 
                 /* set the defaults */
-                if (!selinux)
-                        label_fix(devnode, true, false);
+                if (!selinux && use_selinux())
+                        selinux_label_fix(devnode, true, false);
                 if (!smack)
                         smack_label_path(devnode, NULL);
         }
-- 
1.9.3



More information about the systemd-devel mailing list