2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

Add --disable-shared-libutil configure option. It may only be used

in conjunction with the --enable-static-sudoers option.
This commit is contained in:
Todd C. Miller 2014-08-08 11:03:24 -06:00
parent 779946ea3a
commit 76a6dad424
5 changed files with 67 additions and 5 deletions

View File

@ -193,6 +193,15 @@ Compilation options:
not prevent other plugins from being used and the noexec
option will continue to function.
--disable-shared-libutil
Disable the use of the dynamic libsudo_util library. By
default, sudo, the sudoers plugin and the associated sudo
utilities are linked against a shared version of libsudo_util.
If the --disable-shared-libutil option is specified, a
static version of the libsudo_util library will be used
instead. This option may only be used in conjunction with
the --enable-static-sudoers option.
--enable-zlib[=location]
Enable the use of the zlib compress library when storing
I/O log files. If specified, location is the base directory

4
NEWS
View File

@ -30,7 +30,9 @@ What's new in Sudo 1.8.11
that of other gettext-enabled packages.
* Sudo and its associated programs now link against a shared version
of libsudo_util.
of libsudo_util. The --disable-shared-libutil configure option
may be used to force static linking if the --enable-static-sudoers
option is also specified.
* It is now possible to match an environment variable's value as
well as its name using env_keep and env_check. This can be used

28
configure vendored
View File

@ -780,6 +780,7 @@ SUDO_OBJS
SUDOERS_OBJS
COMMON_OBJS
LT_DEP_LIBS
LT_STATIC_LIBUTIL
LT_STATIC
LT_LDEXPORTS
LT_LDDEP
@ -937,6 +938,7 @@ enable_admin_flag
enable_nls
enable_rpath
enable_static_sudoers
enable_shared_libutil
with_selinux
enable_gss_krb5_ccache_name
enable_shared
@ -1605,6 +1607,8 @@ Optional Features:
--disable-rpath Disable passing of -Rpath to the linker
--enable-static-sudoers Build the sudoers policy module as part of the sudo
binary instead as a plugin
--disable-shared-libutil
Disable use of the libsudo_util shared library.
--enable-gss-krb5-ccache-name
Use GSS-API to set the Kerberos V cred cache name
--enable-shared[=PKGS] build shared libraries [default=yes]
@ -2976,6 +2980,7 @@ $as_echo "$as_me: Configuring Sudo version $PACKAGE_VERSION" >&6;}
#
@ -5794,6 +5799,14 @@ else
fi
# Check whether --enable-shared_libutil was given.
if test "${enable_shared_libutil+set}" = set; then :
enableval=$enable_shared_libutil;
else
enable_shared_libutil=yes
fi
# Check whether --with-selinux was given.
if test "${with_selinux+set}" = set; then :
@ -22047,6 +22060,21 @@ case "$lt_cv_dlopen" in
;;
esac
#
# We can only disable linking with the shared libsudo_util if
# sudoers is linked statically too.
#
if test "$enable_shared_libutil" = "no"; then
if test X"$STATIC_SUDOERS" = X""; then
as_fn_error $? "\"--disable-shared-libutil may only be specified with --enable-static-sudoers or when dynamic linking is disabled.\"" "$LINENO" 5
else
# Disable use shared version of libsudo_util.
LT_STATIC_LIBUTIL="--tag=disable-shared"
fi
else
LT_STATIC_LIBUTIL="$LT_STATIC"
fi
# On HP-UX, you cannot dlopen() a shared object that uses pthreads unless
# the main program is linked against -lpthread. We have no knowledge of
# what libraries a plugin may depend on (e.g. HP-UX LDAP which uses pthreads)

View File

@ -27,6 +27,7 @@ AC_SUBST([LT_LDOPT])
AC_SUBST([LT_LDDEP])
AC_SUBST([LT_LDEXPORTS])
AC_SUBST([LT_STATIC])
AC_SUBST([LT_STATIC_LIBUTIL])
AC_SUBST([LT_DEP_LIBS])
AC_SUBST([COMMON_OBJS])
AC_SUBST([SUDOERS_OBJS])
@ -1454,6 +1455,10 @@ AC_ARG_ENABLE(static-sudoers,
[AS_HELP_STRING([--enable-static-sudoers], [Build the sudoers policy module as part of the sudo binary instead as a plugin])],
[], [enable_static_sudoers=no])
AC_ARG_ENABLE(shared_libutil,
[AS_HELP_STRING([--disable-shared-libutil], [Disable use of the libsudo_util shared library.])],
[], [enable_shared_libutil=yes])
AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux], [enable SELinux support])],
[case $with_selinux in
yes) SELINUX_USAGE="[[-r role]] [[-t type]] "
@ -3611,6 +3616,21 @@ case "$lt_cv_dlopen" in
;;
esac
#
# We can only disable linking with the shared libsudo_util if
# sudoers is linked statically too.
#
if test "$enable_shared_libutil" = "no"; then
if test X"$STATIC_SUDOERS" = X""; then
AC_MSG_ERROR(["--disable-shared-libutil may only be specified with --enable-static-sudoers or when dynamic linking is disabled."])
else
# Disable use shared version of libsudo_util.
LT_STATIC_LIBUTIL="--tag=disable-shared"
fi
else
LT_STATIC_LIBUTIL="$LT_STATIC"
fi
# On HP-UX, you cannot dlopen() a shared object that uses pthreads unless
# the main program is linked against -lpthread. We have no knowledge of
# what libraries a plugin may depend on (e.g. HP-UX LDAP which uses pthreads)

View File

@ -45,7 +45,7 @@ shlib_opt = util.opt
# Compiler & tools to use
CC = @CC@
LIBTOOL = @LIBTOOL@ @LT_STATIC@
LIBTOOL = @LIBTOOL@ @LT_STATIC_LIBUTIL@
SED = @SED@
# Our install program supports extra flags...
@ -182,9 +182,12 @@ progname_test: $(PROGNAME_TEST_OBJS)
pre-install:
install: install-dirs
if [ X"$(shlib_enable)" = X"yes" ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_util.la $(DESTDIR)$(libexecdir)/sudo; \
fi
case "$(LIBTOOL)" in \
*disable-shared*) ;; \
*) if [ X"$(shlib_enable)" = X"yes" ]; then \
INSTALL_BACKUP='~' $(LIBTOOL) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_util.la $(DESTDIR)$(libexecdir)/sudo; \
fi;; \
esac
install-dirs:
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir)/sudo