summaryrefslogtreecommitdiff
path: root/src/udev/label.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2014-01-09 18:55:21 -0500
committerAnthony G. Basile <blueness@gentoo.org>2014-01-09 18:55:21 -0500
commit97b903d94eca5cc6cf17262f91e43227998d3301 (patch)
tree9b82b6a8fb5fd9170f2e92506f3d1c6f3e5a058b /src/udev/label.c
parented55ef29406d173fb838211c31058e7941c09d00 (diff)
udev: add SECLABEL{selinux}= support
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/label.c')
-rw-r--r--src/udev/label.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/udev/label.c b/src/udev/label.c
index 5698020672..dca2a21228 100644
--- a/src/udev/label.c
+++ b/src/udev/label.c
@@ -233,3 +233,15 @@ skipped:
#endif
return mkdir(path, mode) < 0 ? -errno : 0;
}
+
+int label_apply(const char *path, const char *label) {
+ int r = 0;
+
+#ifdef HAVE_SELINUX
+ if (!use_selinux())
+ return 0;
+
+ r = setfilecon(path, (char *)label);
+#endif
+ return r;
+}