[SSSD] [PATCH] Build SELinux code in responder conditionally
Jakub Hrozek
jhrozek at redhat.com
Wed Aug 15 13:13:00 UTC 2012
https://fedorahosted.org/sssd/ticket/1480
I've tested by removing libselinux-devel, reconfiguring
--without-selinux. Then "make" and a simple sanity check (login still
worked) passed.
-------------- next part --------------
>From a966d43fb91bfcbce905f75ea1a74cf67e20b2d2 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Wed, 15 Aug 2012 15:10:42 +0200
Subject: [PATCH] Build SELinux code in responder conditionally
https://fedorahosted.org/sssd/ticket/1480
---
src/responder/pam/pamsrv_cmd.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index 92cd734079be76f6c40873c00278f75d5947d686..8c9dd9b557982e04989bf9e63fd93ea294979252 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -33,7 +33,9 @@
#include "responder/pam/pam_helpers.h"
#include "db/sysdb.h"
#include "db/sysdb_selinux.h"
+#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
+#endif
enum pam_verbosity {
PAM_VERBOSITY_NO_MESSAGES = 0,
@@ -354,6 +356,8 @@ fail:
return ret;
}
+#ifdef HAVE_SELINUX
+
#define ALL_SERVICES "*"
static errno_t write_selinux_string(const char *username, char *string)
@@ -595,6 +599,7 @@ done:
talloc_free(tmp_ctx);
return ret;
}
+#endif
static errno_t filter_responses(struct confdb_ctx *cdb,
struct response_data *resp_list)
@@ -791,6 +796,7 @@ static void pam_reply(struct pam_auth_req *preq)
return;
}
+#ifdef HAVE_SELINUX
if (pd->cmd == SSS_PAM_ACCT_MGMT &&
pd->pam_status == PAM_SUCCESS) {
/* Try to fetch data from sysdb
@@ -800,6 +806,7 @@ static void pam_reply(struct pam_auth_req *preq)
pd->pam_status = PAM_SYSTEM_ERR;
}
}
+#endif
ret = sss_packet_new(cctx->creq, 0, sss_packet_get_cmd(cctx->creq->in),
&cctx->creq->out);
--
1.7.11.2
More information about the sssd-devel
mailing list