From 9a1121532e361c23bc632acc81fa0767e937a507 Mon Sep 17 00:00:00 2001
From: Federico Simoncelli <fsimonce@redhat.com>
Date: Tue, 30 Sep 2014 13:01:49 +0000
Subject: [PATCH] udev: set default selinux label only at "add" events
---
src/udev/udev-node.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index d42af9a..ae117a0 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -314,7 +314,7 @@ static int node_permissions_apply(struct udev_device *dev, bool apply,
}
/* set the defaults */
- if (!selinux)
+ if (!selinux && streq(udev_device_get_action(dev), "add"))
label_fix(devnode, true, false);
if (!smack)
smack_label_path(devnode, NULL);
--
1.8.3.1