summaryrefslogtreecommitdiff
path: root/src/sss_client
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-02-23 01:15:29 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-02-23 09:13:21 -0500
commit8d821f0508f495deb376617c165cbcbf396a058a (patch)
treed24881cf8d511fabd5ef59bfd091f597bbbc6580 /src/sss_client
parentfd9847469ce7056d88baea965af70c467ef80331 (diff)
downloadsssd-8d821f0508f495deb376617c165cbcbf396a058a.tar.gz
sssd-8d821f0508f495deb376617c165cbcbf396a058a.tar.bz2
sssd-8d821f0508f495deb376617c165cbcbf396a058a.zip
pam_sss: keep selinux optional
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
Diffstat (limited to 'src/sss_client')
-rw-r--r--src/sss_client/pam_sss.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c
index 45e31810..4fe4613a 100644
--- a/src/sss_client/pam_sss.c
+++ b/src/sss_client/pam_sss.c
@@ -41,7 +41,9 @@
#include <security/pam_modules.h>
#include <security/pam_ext.h>
#include <security/pam_modutil.h>
+#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
+#endif
#include "sss_pam_macros.h"
#include "sss_cli.h"
@@ -1083,11 +1085,13 @@ static int send_and_receive(pam_handle_t *pamh, struct pam_items *pi,
size_t replen;
int pam_status = PAM_SYSTEM_ERR;
+#ifdef HAVE_SELINUX
char *path = NULL;
char *tmp_path = NULL;
int pos, len;
int fd;
mode_t oldmask;
+#endif /* HAVE_SELINUX */
print_pam_items(pi);
@@ -1184,6 +1188,7 @@ static int send_and_receive(pam_handle_t *pamh, struct pam_items *pi,
break;
}
+#ifdef HAVE_SELINUX
if (asprintf(&path, "%s/logins/%s", selinux_policy_root(),
pi->pam_user) < 0 ||
asprintf(&tmp_path, "%sXXXXXX", path) < 0) {
@@ -1221,6 +1226,7 @@ static int send_and_receive(pam_handle_t *pamh, struct pam_items *pi,
free(path);
free(tmp_path);
umask(oldmask);
+#endif /* HAVE_SELINUX */
break;
case SSS_PAM_SETCRED:
case SSS_PAM_CLOSE_SESSION: