From c224d1e0ccb66c2e04e9291a8693c151d8e8116b Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 26 Sep 2023 17:11:36 +0200 Subject: [PATCH] BUILD: get rid of `--with-semanage` ./configure switch :relnote:Explicit `--with-semanage` ./configure switch was removed, going forward `--with-selinux` includes this. Resolves: https://github.com/SSSD/sssd/issues/6647 --- Makefile.am | 12 ++++++------ configure.ac | 3 --- src/conf_macros.m4 | 18 ------------------ src/util/sss_semanage.c | 11 ++++------- 4 files changed, 10 insertions(+), 34 deletions(-) diff --git a/Makefile.am b/Makefile.am index eb5d05cac51..f53aaa11618 100644 --- a/Makefile.am +++ b/Makefile.am @@ -183,7 +183,7 @@ endif if BUILD_SAMBA sssdlibexec_PROGRAMS += gpo_child endif -if BUILD_SEMANAGE +if BUILD_SELINUX sssdlibexec_PROGRAMS += selinux_child endif sssdlibexec_PROGRAMS += p11_child @@ -1339,7 +1339,7 @@ libsss_semanage_la_LIBADD = \ $(TALLOC_LIBS) \ libsss_debug.la \ $(NULL) -if BUILD_SEMANAGE +if BUILD_SELINUX libsss_semanage_la_LIBADD += $(SEMANAGE_LIBS) endif @@ -2228,7 +2228,7 @@ FILES_TESTS_LIBS = \ if BUILD_SELINUX FILES_TESTS_LIBS += $(SELINUX_LIBS) endif -if BUILD_SEMANAGE +if BUILD_SELINUX FILES_TESTS_LIBS += $(SEMANAGE_LIBS) endif @@ -4580,7 +4580,7 @@ libsss_ipa_la_SOURCES += \ src/providers/ipa/ipa_sudo_async.c endif -if BUILD_SEMANAGE +if BUILD_SELINUX libsss_ipa_la_SOURCES += \ src/providers/ipa/ipa_selinux.c \ src/providers/ipa/ipa_selinux_maps.c @@ -4723,7 +4723,7 @@ ldap_child_LDADD = \ $(DHASH_LIBS) \ $(KRB5_LIBS) -if BUILD_SEMANAGE +if BUILD_SELINUX selinux_child_SOURCES = \ src/providers/ipa/selinux_child.c \ src/util/sss_semanage.c \ @@ -5531,7 +5531,7 @@ if SSSD_USER chmod 4750 $(DESTDIR)$(sssdlibexecdir)/krb5_child -chgrp $(SSSD_USER) $(DESTDIR)$(sssdlibexecdir)/proxy_child chmod 4750 $(DESTDIR)$(sssdlibexecdir)/proxy_child -if BUILD_SEMANAGE +if BUILD_SELINUX -chgrp $(SSSD_USER) $(DESTDIR)$(sssdlibexecdir)/selinux_child chmod 4750 $(DESTDIR)$(sssdlibexecdir)/selinux_child endif diff --git a/configure.ac b/configure.ac index 270b8ef376d..d41f7c85158 100644 --- a/configure.ac +++ b/configure.ac @@ -412,9 +412,6 @@ AM_CONDITIONAL([BUILD_PYTHON_BINDINGS], AS_IF([test x$HAVE_SELINUX != x], [ AM_CHECK_SELINUX -]) - -AS_IF([test x$HAVE_SEMANAGE != x -a x$HAVE_SELINUX != x], [ AM_CHECK_SEMANAGE ]) diff --git a/src/conf_macros.m4 b/src/conf_macros.m4 index 5ef257908a2..e37dcd3fee3 100644 --- a/src/conf_macros.m4 +++ b/src/conf_macros.m4 @@ -465,24 +465,6 @@ AC_DEFUN([WITH_NSCD_CONF], AC_DEFINE_UNQUOTED([NSCD_CONF_PATH], ["$NSCD_CONF_PATH"], [NSCD configuration file]) ]) - -AC_DEFUN([WITH_SEMANAGE], - [ AC_ARG_WITH([semanage], - [AC_HELP_STRING([--with-semanage], - [Whether to build with SELinux user management support [yes]] - ) - ], - [], - with_semanage=yes - ) - if test x"$with_semanage" = xyes; then - HAVE_SEMANAGE=1 - AC_SUBST(HAVE_SEMANAGE) - AC_DEFINE_UNQUOTED(HAVE_SEMANAGE, 1, [Build with SELinux support]) - fi - AM_CONDITIONAL([BUILD_SEMANAGE], [test x"$with_semanage" = xyes]) - ]) - AC_DEFUN([WITH_GPO_CACHE_PATH], [ AC_ARG_WITH([gpo-cache-path], [AC_HELP_STRING([--with-gpo-cache-path=PATH], diff --git a/src/util/sss_semanage.c b/src/util/sss_semanage.c index 10a567c9a93..9aa635ea3ff 100644 --- a/src/util/sss_semanage.c +++ b/src/util/sss_semanage.c @@ -20,20 +20,17 @@ */ #include "config.h" +#include "util/util.h" +#if defined(HAVE_SELINUX) #include -#if defined(HAVE_SEMANAGE) && defined(HAVE_SELINUX) #include #include -#endif - -#include "util/util.h" #ifndef DEFAULT_SERANGE #define DEFAULT_SERANGE "s0" #endif -#if defined(HAVE_SEMANAGE) && defined(HAVE_SELINUX) /* turn libselinux messages into SSSD DEBUG() calls */ static void sss_semanage_error_callback(void *varg, semanage_handle_t *handle, @@ -459,7 +456,7 @@ int sss_del_seuser(const char *login_name) sss_semanage_close(handle); return ret; } -#else /* HAVE_SEMANAGE && HAVE_SELINUX */ +#else /* HAVE_SELINUX */ int sss_set_seuser(const char *login_name, const char *seuser_name, const char *mls) { @@ -477,4 +474,4 @@ int sss_get_seuser(const char *linuxuser, { return EOK; } -#endif /* HAVE_SEMANAGE */ +#endif /* HAVE_SELINUX */