X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fselinux.c;h=2db05ee8ecb513f0eb6c43e634885ea509f91d22;hb=8bc6e9d6a89672bbe1e7469774abe889354deb67;hp=3b4b9ba61d7663db72b3dc6056f2f8587215321d;hpb=9f7bec212fc7d146b4fd4be6e8b3e98677dc0a0a;p=libguestfs.git diff --git a/daemon/selinux.c b/daemon/selinux.c index 3b4b9ba..2db05ee 100644 --- a/daemon/selinux.c +++ b/daemon/selinux.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -26,9 +26,24 @@ #include #endif -#include "../src/guestfs_protocol.h" +#include "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 }