summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-02-06 21:37:49 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-02-06 22:27:21 +0100
commitd7887449e7c972770b6dd896f7d8c09f0d26c88f (patch)
treeefd40b5a46322eef75e81fec7121527ca4329ba8
parent22cd7aabecd81fca14026749e48eadddff98a4bd (diff)
downloadsystemd-d7887449e7c972770b6dd896f7d8c09f0d26c88f.tar.gz
basic/selinux-util: expose _cleanup_freecon_
-rw-r--r--src/basic/selinux-util.c3
-rw-r--r--src/basic/selinux-util.h7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/basic/selinux-util.c b/src/basic/selinux-util.c
index 1d209d03d5..90bb93ed0b 100644
--- a/src/basic/selinux-util.c
+++ b/src/basic/selinux-util.c
@@ -28,10 +28,7 @@
#include "time-util.h"
#if HAVE_SELINUX
-DEFINE_TRIVIAL_CLEANUP_FUNC(char*, freecon);
DEFINE_TRIVIAL_CLEANUP_FUNC(context_t, context_free);
-
-#define _cleanup_freecon_ _cleanup_(freeconp)
#define _cleanup_context_free_ _cleanup_(context_freep)
static int cached_use = -1;
diff --git a/src/basic/selinux-util.h b/src/basic/selinux-util.h
index 639c35b687..b73b7c50e0 100644
--- a/src/basic/selinux-util.h
+++ b/src/basic/selinux-util.h
@@ -8,6 +8,13 @@
#include "macro.h"
#include "label.h"
+#if HAVE_SELINUX
+#include <selinux/selinux.h>
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(char*, freecon);
+#define _cleanup_freecon_ _cleanup_(freeconp)
+#endif
+
bool mac_selinux_use(void);
void mac_selinux_retest(void);