URL: https://github.com/SSSD/sssd/pull/523
Author: lslebodn
 Title: #523: IPA: Drop unused ifdef HAVE_SELINUX_LOGIN_DIR
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/523/head:pr523
git checkout pr523
From 7a1fb530c6b47abb5ebfdb79f53bcf662956066b Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lsleb...@redhat.com>
Date: Fri, 23 Feb 2018 19:54:19 +0100
Subject: [PATCH 1/2] IPA: Drop unused ifdef HAVE_SELINUX_LOGIN_DIR

Macros ALL_SERVICES and selogin_path were conditionally defined
in case of existing selinux login directory at configure time
(defined macro AVE_SELINUX_LOGIN_DIR)
However, these macros were unused for quite a long 2.5 year
and last usage was removed in commit 9c47c8c59b5c9078f342f82367cd0ad7857acef8
"IPA: Use set_seuser instead of writing selinux login file"
---
 configure.ac                    | 1 -
 src/external/selinux.m4         | 9 ---------
 src/providers/ipa/ipa_init.c    | 2 +-
 src/providers/ipa/ipa_selinux.h | 7 -------
 4 files changed, 1 insertion(+), 18 deletions(-)

diff --git a/configure.ac b/configure.ac
index fafb73500..69deb811e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -377,7 +377,6 @@ AM_PYTHON2_MODULE([ldap])
 
 if test x$HAVE_SELINUX != x; then
     AM_CHECK_SELINUX
-    AM_CHECK_SELINUX_LOGIN_DIR
 fi
 
 if test x$HAVE_SEMANAGE != x -a x$HAVE_SELINUX != x; then
diff --git a/src/external/selinux.m4 b/src/external/selinux.m4
index 1f41b3128..d1b961a49 100644
--- a/src/external/selinux.m4
+++ b/src/external/selinux.m4
@@ -23,12 +23,3 @@ AC_DEFUN([AM_CHECK_SEMANAGE],
                      [AC_MSG_ERROR([libsemanage is missing])])
     AC_SUBST(SEMANAGE_LIBS)
 ])
-
-dnl Check if the SELinux login directory exists
-AC_DEFUN([AM_CHECK_SELINUX_LOGIN_DIR],
-[
-  AC_CHECK_FILE(/etc/selinux/targeted/logins/,
-                [AC_DEFINE([HAVE_SELINUX_LOGIN_DIR], [1],
-                           [The directory to store SELinux user login is available])],
-                [AC_MSG_WARN([SELinux login directory is not available])])
-])
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index 3edab59bb..cdf58b322 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -853,7 +853,7 @@ errno_t sssm_ipa_selinux_init(TALLOC_CTX *mem_ctx,
                               void *module_data,
                               struct dp_method *dp_methods)
 {
-#if defined HAVE_SELINUX && defined HAVE_SELINUX_LOGIN_DIR
+#if defined HAVE_SELINUX
     struct ipa_selinux_ctx *selinux_ctx;
     struct ipa_init_ctx *init_ctx;
     struct ipa_options *opts;
diff --git a/src/providers/ipa/ipa_selinux.h b/src/providers/ipa/ipa_selinux.h
index 65ca037ee..dea87759e 100644
--- a/src/providers/ipa/ipa_selinux.h
+++ b/src/providers/ipa/ipa_selinux.h
@@ -27,13 +27,6 @@
 
 #include "providers/ldap/ldap_common.h"
 
-#ifdef HAVE_SELINUX_LOGIN_DIR
-
-#define ALL_SERVICES "*"
-#define selogin_path(mem_ctx, username) \
-    talloc_asprintf(mem_ctx, "%s/logins/%s", selinux_policy_root(), username)
-#endif /* HAVE_SELINUX_LOGIN_DIR */
-
 struct ipa_selinux_ctx {
     struct ipa_id_ctx *id_ctx;
     time_t last_update;

From 23c34fcdb5ac10737492d83d0877337012cc3beb Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lsleb...@redhat.com>
Date: Mon, 26 Feb 2018 13:04:01 +0100
Subject: [PATCH 2/2] IPA: Fix typo in debug message in sssm_ipa_selinux_init

It was probably a copy&paste mistake.
---
 src/providers/ipa/ipa_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index cdf58b322..cd2227896 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -879,7 +879,7 @@ errno_t sssm_ipa_selinux_init(TALLOC_CTX *mem_ctx,
     return EOK;
 #else
     DEBUG(SSSDBG_MINOR_FAILURE, "SELinux init handler called but SSSD is "
-                                "built without SSH support, ignoring\n");
+                                "built without SELinux support, ignoring\n");
     return EOK;
 #endif
 }
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to