diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2013-01-28 11:16:31 -0500 |
---|---|---|
committer | Ian Stakenvicius <axs@gentoo.org> | 2013-01-28 12:12:41 -0500 |
commit | 26e92619267df364bac4aed29376a36669fb53d3 (patch) | |
tree | 903b84f302c56fc447341429b48e04bae333f657 /src/udev/label.c | |
parent | 82f60023e3d4b33624c85a149915b411b504e426 (diff) |
Add missing selinux code to udev core (convenience lib)
Original Author: Alexey D. (TZ86)
Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
Diffstat (limited to 'src/udev/label.c')
-rw-r--r-- | src/udev/label.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/udev/label.c b/src/udev/label.c index d353da57ec..7e8d8f9277 100644 --- a/src/udev/label.c +++ b/src/udev/label.c @@ -31,12 +31,19 @@ #include "path-util.h" #ifdef HAVE_SELINUX -#include "selinux-util.h" +#include <stdbool.h> #include <selinux/selinux.h> #include <selinux/label.h> static struct selabel_handle *label_hnd = NULL; +static int use_selinux_cached = -1; +bool use_selinux(void) { + if (use_selinux_cached < 0) + use_selinux_cached = is_selinux_enabled() > 0; + + return use_selinux_cached; +} #endif int label_init(const char *prefix) { |