diff options
author | Karel Zak | 2008-07-01 14:24:58 +0200 |
---|---|---|
committer | Karel Zak | 2008-07-01 14:32:53 +0200 |
commit | 4ba66edf82e03109bd9110682179254d823c58a3 (patch) | |
tree | b0a86c16fc0ac848949f603fcc75e96d994dafca /disk-utils/mkswap.c | |
parent | mount: warn on "file_t" selinux context (diff) | |
download | kernel-qcow2-util-linux-4ba66edf82e03109bd9110682179254d823c58a3.tar.gz kernel-qcow2-util-linux-4ba66edf82e03109bd9110682179254d823c58a3.tar.xz kernel-qcow2-util-linux-4ba66edf82e03109bd9110682179254d823c58a3.zip |
selinux: is_selinux_enabled() returns 0, 1 and -1
Unfortunately, the current libselinux implementation of
is_selinux_enabled() returns -1 on error. This behavior is
undocumented.
The proper solution is to use "if (is_selinux_enabled() > 0)".
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/mkswap.c')
-rw-r--r-- | disk-utils/mkswap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index 10068b713..3f58f9c30 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -746,7 +746,7 @@ use the -f option to force it.\n"), #endif #ifdef HAVE_LIBSELINUX - if (S_ISREG(statbuf.st_mode) && is_selinux_enabled()) { + if (S_ISREG(statbuf.st_mode) && is_selinux_enabled() > 0) { security_context_t context_string; security_context_t oldcontext; context_t newcontext; |