summaryrefslogtreecommitdiff
path: root/src/shared/label.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/label.c')
-rw-r--r--src/shared/label.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/label.c b/src/shared/label.c
index fde39f2259..5c7cc1c906 100644
--- a/src/shared/label.c
+++ b/src/shared/label.c
@@ -384,3 +384,15 @@ skipped:
#endif
return bind(fd, addr, addrlen) < 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;
+}