From c66e7f04997fb42b778703418097a5023fa17581 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Thu, 31 May 2012 13:17:26 +0200 Subject: mkdir: provide all functions with and without selinux label application --- src/shared/label.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/shared/label.c') diff --git a/src/shared/label.c b/src/shared/label.c index 3e5ea67469..d912574625 100644 --- a/src/shared/label.c +++ b/src/shared/label.c @@ -263,15 +263,14 @@ void label_free(const char *label) { #endif } -int label_mkdir(const char *path, mode_t mode) { +int label_mkdir(const char *path, mode_t mode, bool apply) { /* Creates a directory and labels it according to the SELinux policy */ - #ifdef HAVE_SELINUX int r; security_context_t fcon = NULL; - if (!use_selinux() || !label_hnd) + if (!apply || !use_selinux() || !label_hnd) goto skipped; if (path_is_absolute(path)) -- cgit v1.2.3-54-g00ecf