Skip to content

Commit

Permalink
BUILD: get rid of --with-semanage ./configure switch
Browse files Browse the repository at this point in the history
:relnote:Explicit `--with-semanage` ./configure switch was removed,
going forward `--with-selinux` includes this.

Resolves: #6647

Reviewed-by: Alejandro López <[email protected]>
Reviewed-by: Justin Stephenson <[email protected]>
  • Loading branch information
alexey-tikhonov committed Oct 2, 2023
1 parent 61bf109 commit 0a254e4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 34 deletions.
12 changes: 6 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
])

Expand Down
18 changes: 0 additions & 18 deletions src/conf_macros.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
11 changes: 4 additions & 7 deletions src/util/sss_semanage.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@
*/

#include "config.h"
#include "util/util.h"

#if defined(HAVE_SELINUX)
#include <stdio.h>
#if defined(HAVE_SEMANAGE) && defined(HAVE_SELINUX)
#include <semanage/semanage.h>
#include <selinux/selinux.h>
#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,
Expand Down Expand Up @@ -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)
{
Expand All @@ -477,4 +474,4 @@ int sss_get_seuser(const char *linuxuser,
{
return EOK;
}
#endif /* HAVE_SEMANAGE */
#endif /* HAVE_SELINUX */

0 comments on commit 0a254e4

Please sign in to comment.