X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fselinux.c;h=e49e657bdb58013c071c98b811b24dce424dd55d;hp=3b4b9ba61d7663db72b3dc6056f2f8587215321d;hb=00fae9fe88ca83dfc3ee0b1b7d8e27e644f6e9c7;hpb=9f7bec212fc7d146b4fd4be6e8b3e98677dc0a0a diff --git a/daemon/selinux.c b/daemon/selinux.c index 3b4b9ba..e49e657 100644 --- a/daemon/selinux.c +++ b/daemon/selinux.c @@ -29,6 +29,21 @@ #include "../src/guestfs_protocol.h" #include "daemon.h" #include "actions.h" +#include "optgroups.h" + +#if defined(HAVE_LIBSELINUX) +int +optgroup_selinux_available (void) +{ + return 1; +} +#else /* !HAVE_LIBSELINUX */ +int +optgroup_selinux_available (void) +{ + return 0; +} +#endif /* !HAVE_LIBSELINUX */ /* setcon is only valid under the following circumstances: * - single threaded @@ -45,8 +60,7 @@ do_setcon (const char *context) return 0; #else - reply_with_error ("%s is not available", __func__); - return -1; + NOT_AVAILABLE (-1); #endif } @@ -71,7 +85,6 @@ do_getcon (void) return r; /* caller frees */ #else - reply_with_error ("%s is not available", __func__); - return NULL; + NOT_AVAILABLE (NULL); #endif }