>From 5f9908e8d61dc37ec714fd129a79b24b87f71b09 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 14 May 2013 08:44:11 +0200 Subject: [PATCH] Fix broken build with selinux. Header file selinux/selinux.h was removed in commit 245cc346 from file ipa_selinux.c, because it breaks build without selinux. But new error was introduced. This patch fixes compilation with selinux and include header file selinux/selinux.h only if both macros exist HAVE_SELINUX and HAVE_SELINUX_LOGIN_DIR. Now ipa_selinux.c should be correctly built with and without selinux. --- src/providers/ipa/ipa_selinux.c | 4 +++- src/providers/ipa/ipa_selinux.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/providers/ipa/ipa_selinux.c b/src/providers/ipa/ipa_selinux.c index eed0cd499d4fe2feb626eb7e1f233c654502b0b2..ce8f39cccaedc86771e6642a64ec88b33ab15c45 100644 --- a/src/providers/ipa/ipa_selinux.c +++ b/src/providers/ipa/ipa_selinux.c @@ -37,7 +37,8 @@ #include "providers/ipa/ipa_selinux_maps.h" #include "providers/ipa/ipa_subdomains.h" -#ifdef HAVE_SELINUX_LOGIN_DIR +#if defined HAVE_SELINUX && defined HAVE_SELINUX_LOGIN_DIR +#include static struct tevent_req * ipa_get_selinux_send(TALLOC_CTX *mem_ctx, @@ -1297,6 +1298,7 @@ ipa_get_selinux_recv(struct tevent_req *req, return EOK; } +/*end of #if defined HAVE_SELINUX && defined HAVE_SELINUX_LOGIN_DIR */ #else /* Simply return success if HAVE_SELINUX_LOGIN_DIR is not defined. */ void ipa_selinux_handler(struct be_req *be_req) diff --git a/src/providers/ipa/ipa_selinux.h b/src/providers/ipa/ipa_selinux.h index e8fd4a06a8c5f1d56ba6fb8758f61c4fccfc6900..08cdaef7e0ee72526a48ae847b0b4dcaf5dc8d43 100644 --- a/src/providers/ipa/ipa_selinux.h +++ b/src/providers/ipa/ipa_selinux.h @@ -32,7 +32,7 @@ #define ALL_SERVICES "*" #define selogin_path(mem_ctx, username) \ talloc_asprintf(mem_ctx, "%s/logins/%s", selinux_policy_root(), username) -#endif +#endif /* HAVE_SELINUX_LOGIN_DIR */ struct ipa_selinux_ctx { struct ipa_id_ctx *id_ctx; -- 1.8.1.4