Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUILD: get rid of --with-semanage ./configure switch #6961

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the comment should not be removed, but modified to reflect the new situation (/* HAVE_SELINUX */). This else is about 400 lines away from its corresponding if, making it hard to know at a single glance what it is doing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, added.

#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 */
Loading