1996-07-24 06:19:16 +00:00
dnl
2013-11-13 15:00:28 -07:00
dnl Use the top-level autogen.sh script to generate configure and config.h.in
1996-07-24 06:19:16 +00:00
dnl
2019-04-29 07:21:51 -06:00
dnl SPDX-License-Identifier: ISC
dnl
2021-01-08 19:52:45 -07:00
dnl Copyright (c) 1994-1996, 1998-2021 Todd C. Miller <Todd.Miller@sudo.ws>
2019-04-29 07:21:51 -06:00
dnl
dnl Permission to use, copy, modify, and distribute this software for any
dnl purpose with or without fee is hereby granted, provided that the above
dnl copyright notice and this permission notice appear in all copies.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
dnl WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
dnl MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
dnl ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1999-04-06 03:25:46 +00:00
dnl
2013-11-13 14:45:47 -07:00
AC_PREREQ([2.59])
2021-02-17 09:56:04 -07:00
AC_INIT([sudo], [1.9.6], [https://bugzilla.sudo.ws/], [sudo])
2020-07-15 10:12:55 -06:00
AC_CONFIG_HEADERS([config.h pathnames.h])
2013-11-13 14:45:47 -07:00
AC_CONFIG_SRCDIR([src/sudo.c])
1994-03-09 23:51:22 +00:00
dnl
2010-11-09 10:34:08 -05:00
dnl Note: this must come after AC_INIT
1995-12-18 03:22:10 +00:00
dnl
2009-05-19 21:24:05 +00:00
AC_MSG_NOTICE([Configuring Sudo version $PACKAGE_VERSION])
1995-12-18 03:22:10 +00:00
dnl
2000-08-13 21:09:22 +00:00
dnl Variables that get substituted in the Makefile and man pages
1994-03-09 23:51:22 +00:00
dnl
2010-05-21 21:29:44 -04:00
AC_SUBST([SHELL])
2010-05-21 19:25:17 -04:00
AC_SUBST([LIBTOOL])
AC_SUBST([CFLAGS])
AC_SUBST([PROGS])
AC_SUBST([CPPFLAGS])
AC_SUBST([LDFLAGS])
2015-05-15 15:48:24 -06:00
AC_SUBST([SUDO_LDFLAGS])
2010-05-21 19:25:17 -04:00
AC_SUBST([SUDOERS_LDFLAGS])
2014-10-01 14:32:30 -06:00
AC_SUBST([LIBUTIL_LDFLAGS])
2014-10-27 14:39:07 -06:00
AC_SUBST([ZLIB_LDFLAGS])
2012-06-14 11:35:02 -04:00
AC_SUBST([LT_LDFLAGS])
2012-06-20 12:58:16 -04:00
AC_SUBST([LT_LDDEP])
2012-06-14 11:35:02 -04:00
AC_SUBST([LT_LDEXPORTS])
2014-07-29 13:06:18 -06:00
AC_SUBST([LT_STATIC])
AC_SUBST([LT_DEP_LIBS])
2010-06-29 13:08:05 -04:00
AC_SUBST([COMMON_OBJS])
2010-05-21 19:25:17 -04:00
AC_SUBST([SUDOERS_OBJS])
AC_SUBST([SUDO_OBJS])
AC_SUBST([LIBS])
AC_SUBST([SUDO_LIBS])
AC_SUBST([SUDOERS_LIBS])
2014-01-22 14:47:27 -07:00
AC_SUBST([STATIC_SUDOERS])
2010-05-21 19:25:17 -04:00
AC_SUBST([NET_LIBS])
AC_SUBST([AFS_LIBS])
AC_SUBST([REPLAY_LIBS])
AC_SUBST([GETGROUPS_LIB])
AC_SUBST([AUTH_OBJS])
AC_SUBST([MANTYPE])
2012-07-19 13:41:14 -04:00
AC_SUBST([MANDIRTYPE])
2012-05-31 14:03:41 -04:00
AC_SUBST([MANCOMPRESS])
AC_SUBST([MANCOMPRESSEXT])
2014-07-08 20:19:09 -06:00
AC_SUBST([SHLIB_ENABLE])
2012-06-11 10:45:34 -04:00
AC_SUBST([SHLIB_MODE])
2010-05-21 19:25:17 -04:00
AC_SUBST([SUDOERS_MODE])
AC_SUBST([SUDOERS_UID])
AC_SUBST([SUDOERS_GID])
2011-12-02 13:43:02 -05:00
AC_SUBST([DEVEL])
2010-05-21 19:25:17 -04:00
AC_SUBST([BAMAN])
AC_SUBST([LCMAN])
2012-07-26 13:49:21 -04:00
AC_SUBST([PSMAN])
2010-05-21 19:25:17 -04:00
AC_SUBST([SEMAN])
AC_SUBST([devdir])
AC_SUBST([mansectsu])
AC_SUBST([mansectform])
AC_SUBST([NOEXECFILE])
AC_SUBST([NOEXECDIR])
AC_SUBST([noexec_file])
2013-03-14 20:13:54 -04:00
AC_SUBST([sesh_file])
2016-07-08 12:37:41 -06:00
AC_SUBST([INSTALL_BACKUP])
2010-05-21 19:25:17 -04:00
AC_SUBST([INSTALL_NOEXEC])
2016-11-14 14:21:08 -07:00
AC_SUBST([CHECK_NOEXEC])
2010-05-21 19:25:17 -04:00
AC_SUBST([DONT_LEAK_PATH_INFO])
AC_SUBST([BSDAUTH_USAGE])
AC_SUBST([SELINUX_USAGE])
AC_SUBST([LDAP])
AC_SUBST([LOGINCAP_USAGE])
AC_SUBST([ZLIB])
2010-10-28 11:17:40 -04:00
AC_SUBST([ZLIB_SRC])
2010-05-21 17:59:47 -04:00
AC_SUBST([LIBTOOL_DEPS])
2010-06-11 10:53:44 -04:00
AC_SUBST([CONFIGURE_ARGS])
2010-07-06 13:34:05 -04:00
AC_SUBST([LIBDL])
2015-03-02 16:05:57 -07:00
AC_SUBST([LIBRT])
2011-05-17 16:38:40 -04:00
AC_SUBST([LIBINTL])
2014-04-09 16:31:13 -06:00
AC_SUBST([LIBMD])
2019-11-15 13:19:28 -07:00
AC_SUBST([LIBTLS])
2018-05-24 21:04:23 -06:00
AC_SUBST([LIBPTHREAD])
2011-06-18 13:11:27 -04:00
AC_SUBST([SUDO_NLS])
2012-11-08 14:45:22 -05:00
AC_SUBST([LOCALEDIR_SUFFIX])
2012-01-16 10:40:11 -05:00
AC_SUBST([COMPAT_TEST_PROGS])
2014-08-08 11:19:20 -06:00
AC_SUBST([SUDOERS_TEST_PROGS])
2012-06-20 13:38:17 -04:00
AC_SUBST([CROSS_COMPILING])
2016-11-15 10:15:36 -07:00
AC_SUBST([ASAN_LDFLAGS])
AC_SUBST([ASAN_CFLAGS])
2012-07-02 10:12:41 -04:00
AC_SUBST([PIE_LDFLAGS])
AC_SUBST([PIE_CFLAGS])
2013-01-03 14:20:49 -05:00
AC_SUBST([SSP_LDFLAGS])
AC_SUBST([SSP_CFLAGS])
2014-02-16 10:22:43 -07:00
AC_SUBST([INIT_SCRIPT])
AC_SUBST([INIT_DIR])
AC_SUBST([RC_LINK])
2014-07-29 10:52:43 -06:00
AC_SUBST([COMPAT_EXP])
2015-04-07 15:35:01 -06:00
AC_SUBST([TMPFILES_D])
2015-04-06 15:10:26 -06:00
AC_SUBST([exampledir])
2018-05-24 21:04:07 -06:00
AC_SUBST([DIGEST])
2017-05-30 10:44:11 -06:00
AC_SUBST([devsearch])
2019-08-19 08:37:08 -06:00
AC_SUBST([SIGNAME])
2020-09-03 06:44:43 -06:00
AC_SUBST([PYTHON_PLUGIN])
2019-10-22 13:16:22 +02:00
AC_SUBST([PYTHON_PLUGIN_SRC])
2020-09-03 06:44:43 -06:00
AC_SUBST([LOGSRV])
2020-09-03 06:03:28 -06:00
AC_SUBST([LOGSRV_SRC])
AC_SUBST([LOGSRVD_SRC])
2020-04-08 08:54:27 -06:00
AC_SUBST([LOGSRVD_CONF])
2020-09-03 06:44:43 -06:00
AC_SUBST([LIBLOGSRV])
2020-04-07 14:03:58 -06:00
AC_SUBST([PPFILES])
2021-02-07 05:52:45 -07:00
AC_SUBST([FUZZ_ENGINE])
AC_SUBST([FUZZ_LD])
2019-10-22 13:16:22 +02:00
2000-02-13 18:28:04 +00:00
dnl
2000-08-13 21:09:22 +00:00
dnl Variables that get substituted in docs (not overridden by environment)
dnl
2010-12-10 14:13:51 -05:00
AC_SUBST([iolog_dir])dnl real initial value from SUDO_IO_LOGDIR
2020-01-30 13:25:52 -07:00
AC_SUBST([log_dir])dnl real initial value from SUDO_LOGDIR
AC_SUBST([logpath])dnl real initial value from SUDO_LOGFILE
2014-02-01 05:57:34 -07:00
AC_SUBST([rundir])dnl real initial value from SUDO_RUNDIR
AC_SUBST([vardir])dnl real initial value from SUDO_VARDIR
2010-05-21 19:25:17 -04:00
AC_SUBST([timeout])
AC_SUBST([password_timeout])
AC_SUBST([sudo_umask])
2010-09-14 17:18:55 -04:00
AC_SUBST([umask_override])
2010-05-21 19:25:17 -04:00
AC_SUBST([passprompt])
AC_SUBST([long_otp_prompt])
AC_SUBST([lecture])
AC_SUBST([logfac])
AC_SUBST([goodpri])
AC_SUBST([badpri])
AC_SUBST([loglen])
AC_SUBST([ignore_dot])
AC_SUBST([mail_no_user])
AC_SUBST([mail_no_host])
AC_SUBST([mail_no_perms])
AC_SUBST([mailto])
AC_SUBST([mailsub])
AC_SUBST([badpass_message])
AC_SUBST([fqdn])
AC_SUBST([runas_default])
AC_SUBST([env_editor])
2011-01-28 16:52:25 -05:00
AC_SUBST([env_reset])
2010-05-21 19:25:17 -04:00
AC_SUBST([passwd_tries])
2017-08-01 16:14:54 -06:00
AC_SUBST([timestamp_type])
2010-05-21 19:25:17 -04:00
AC_SUBST([insults])
AC_SUBST([root_sudo])
AC_SUBST([path_info])
AC_SUBST([ldap_conf])
AC_SUBST([ldap_secret])
2012-08-10 11:59:26 -04:00
AC_SUBST([sssd_lib])
2010-05-21 19:25:17 -04:00
AC_SUBST([nsswitch_conf])
AC_SUBST([netsvc_conf])
AC_SUBST([secure_path])
2010-07-14 09:33:53 -04:00
AC_SUBST([editor])
2013-02-24 06:15:37 -05:00
AC_SUBST([pam_session])
2013-08-06 11:01:36 -06:00
AC_SUBST([pam_login_service])
2019-07-03 13:15:47 -06:00
AC_SUBST([plugindir])
2010-06-11 18:34:24 -04:00
#
# Begin initial values for man page substitution
#
2010-12-10 14:13:51 -05:00
iolog_dir=/var/log/sudo-io
2020-01-30 13:25:52 -07:00
log_dir=/var/log
logpath=/var/log/sudo.log
2014-02-01 05:57:34 -07:00
rundir=/var/run/sudo
vardir=/var/adm/sudo
2000-08-13 21:09:22 +00:00
timeout=5
password_timeout=5
sudo_umask=0022
2010-09-14 17:18:55 -04:00
umask_override=off
2014-09-27 10:24:19 -06:00
passprompt="Password: "
2000-08-13 21:09:22 +00:00
long_otp_prompt=off
2003-12-30 22:34:28 +00:00
lecture=once
2010-07-22 17:50:21 -04:00
logfac=auth
2000-08-13 21:09:22 +00:00
goodpri=notice
badpri=alert
loglen=80
ignore_dot=off
mail_no_user=on
mail_no_host=off
mail_no_perms=off
mailto=root
2010-06-11 18:34:24 -04:00
mailsub="*** SECURITY information for %h ***"
badpass_message="Sorry, try again."
2000-08-13 21:09:22 +00:00
fqdn=off
runas_default=root
2019-06-20 11:51:47 -06:00
env_editor=on
2011-01-28 16:52:25 -05:00
env_reset=on
2010-07-14 09:33:53 -04:00
editor=vi
2000-08-13 21:09:22 +00:00
passwd_tries=3
2017-08-01 16:14:54 -06:00
timestamp_type=tty
2000-08-13 21:09:22 +00:00
insults=off
2004-02-01 20:20:30 +00:00
root_sudo=on
2007-07-22 22:43:28 +00:00
path_info=on
2010-06-11 18:34:24 -04:00
ldap_conf=/etc/ldap.conf
ldap_secret=/etc/ldap.secret
netsvc_conf=/etc/netsvc.conf
2019-07-03 13:13:04 -06:00
noexec_file="$libexecdir/sudo/sudo_noexec.so"
sesh_file="$libexecdir/sudo/sesh"
2010-06-11 18:34:24 -04:00
nsswitch_conf=/etc/nsswitch.conf
2009-09-25 01:11:49 +00:00
secure_path="not set"
2013-02-24 06:15:37 -05:00
pam_session=on
2013-08-06 11:01:36 -06:00
pam_login_service=sudo
2019-07-03 13:15:47 -06:00
plugindir="$libexecdir/sudo"
2018-05-24 21:04:07 -06:00
DIGEST=digest.lo
2017-05-30 10:44:11 -06:00
devsearch="/dev/pts:/dev/vt:/dev/term:/dev/zcons:/dev/pty:/dev"
2010-06-11 18:34:24 -04:00
#
# End initial values for man page substitution
#
2000-08-13 21:09:22 +00:00
dnl
2000-02-13 18:28:04 +00:00
dnl Initial values for Makefile variables listed above
2000-08-13 21:09:22 +00:00
dnl May be overridden by environment variables..
2000-02-13 18:28:04 +00:00
dnl
2016-07-08 12:37:41 -06:00
INSTALL_BACKUP=
2010-06-11 18:34:24 -04:00
INSTALL_NOEXEC=
2016-11-14 14:21:08 -07:00
CHECK_NOEXEC=
2015-04-06 15:10:26 -06:00
exampledir='$(docdir)/examples'
2010-06-11 18:34:24 -04:00
devdir='$(srcdir)'
2010-04-27 11:56:51 -04:00
PROGS="sudo"
2012-07-19 13:41:14 -04:00
: ${MANDIRTYPE='man'}
2012-06-11 10:45:34 -04:00
: ${SHLIB_MODE='0644'}
2005-01-14 18:35:06 +00:00
: ${SUDOERS_MODE='0440'}
: ${SUDOERS_UID='0'}
: ${SUDOERS_GID='0'}
2020-06-25 20:55:02 -06:00
: ${PKG_CONFIG='pkg-config'}
2011-12-02 13:43:02 -05:00
DEVEL=
2008-01-09 17:08:30 +00:00
LDAP="#"
2010-05-25 16:13:04 -04:00
BAMAN=0
LCMAN=0
2012-07-26 13:49:21 -04:00
PSMAN=0
2010-05-25 16:13:04 -04:00
SEMAN=0
2011-05-17 16:38:40 -04:00
LIBINTL=
2014-04-09 16:31:13 -06:00
LIBMD=
2019-11-15 13:19:28 -07:00
LIBTLS=
2009-10-22 23:50:16 +00:00
ZLIB=
2010-10-28 11:17:40 -04:00
ZLIB_SRC=
2007-09-02 20:35:52 +00:00
AUTH_OBJS=
2007-09-05 22:16:22 +00:00
AUTH_REG=
AUTH_EXCL=
AUTH_EXCL_DEF=
AUTH_DEF=passwd
2011-06-18 13:11:27 -04:00
SUDO_NLS=disabled
2012-11-08 14:45:22 -05:00
LOCALEDIR_SUFFIX=
2012-06-20 12:58:16 -04:00
LT_LDEXPORTS="-export-symbols \$(shlib_exp)"
LT_LDDEP="\$(shlib_exp)"
2012-11-11 07:11:22 -05:00
OS_INIT=os_init_common
2014-02-16 10:22:43 -07:00
INIT_SCRIPT=
INIT_DIR=
RC_LINK=
2014-07-29 10:52:43 -06:00
COMPAT_EXP=
2019-08-19 08:37:08 -06:00
SIGNAME=
2021-02-07 05:52:45 -07:00
FUZZ_ENGINE=
FUZZ_LD='$(CC)'
2000-02-13 18:28:04 +00:00
dnl
2020-05-07 07:49:54 -06:00
dnl Other variables
2000-02-13 18:28:04 +00:00
dnl
2015-02-17 06:42:10 -07:00
WEAK_ALIAS=no
1998-10-25 04:48:50 +00:00
CHECKSHADOW=true
2005-03-19 03:07:27 +00:00
shadow_funcs=
shadow_libs=
2015-04-07 15:35:01 -06:00
TMPFILES_D=
2010-06-11 10:53:44 -04:00
CONFIGURE_ARGS="$@"
2020-09-03 06:44:43 -06:00
PYTHON_PLUGIN=#
LOGSRVD=
2020-09-03 06:03:28 -06:00
LOGSRVD_SRC=logsrvd
LOGSRV_SRC=lib/logsrv
2020-09-03 06:44:43 -06:00
LOGSRVD_CONF='$(srcdir)/sudo_logsrvd.conf'
2020-02-26 13:17:40 -07:00
LIBLOGSRV='$(top_builddir)/lib/logsrv/liblogsrv.la'
2020-04-08 08:54:27 -06:00
PPFILES='$(srcdir)/etc/sudo.pp'
1995-11-19 02:27:39 +00:00
2012-02-21 13:26:02 -05:00
dnl
dnl LD_PRELOAD equivalents
dnl
RTLD_PRELOAD_VAR="LD_PRELOAD"
RTLD_PRELOAD_ENABLE_VAR=
RTLD_PRELOAD_DELIM=":"
RTLD_PRELOAD_DEFAULT=
2010-02-20 09:41:49 -05:00
dnl
2014-06-26 15:51:02 -06:00
dnl libc replacement functions live in libsudo_util.a
2010-02-20 09:41:49 -05:00
dnl
2014-06-26 15:51:02 -06:00
AC_CONFIG_LIBOBJ_DIR(lib/util)
2010-02-20 09:41:49 -05:00
2015-06-17 17:00:21 -06:00
dnl
dnl We must call AC_USE_SYSTEM_EXTENSIONS before the compiler is run.
dnl
AC_USE_SYSTEM_EXTENSIONS
2013-02-06 14:06:51 -05:00
#
# Prior to sudo 1.8.7, sudo stored libexec files in $libexecdir.
# Starting with sudo 1.8.7, $libexecdir/sudo is used so strip
# off an extraneous "/sudo" from libexecdir.
#
case "$libexecdir" in
*/sudo)
AC_MSG_WARN([libexecdir should not include the "sudo" subdirectory])
libexecdir=`expr "$libexecdir" : '\\(.*\\)/sudo$'`
;;
esac
1999-08-14 15:34:55 +00:00
dnl
dnl Deprecated --with options (these all warn or generate an error)
dnl
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(otp-only, [AS_HELP_STRING([--with-otp-only], [deprecated])],
1999-08-14 15:34:55 +00:00
[case $with_otp_only in
2007-09-02 20:35:52 +00:00
yes) with_passwd="no"
2003-03-19 21:16:57 +00:00
AC_MSG_NOTICE([--with-otp-only option deprecated, treating as --without-passwd])
1999-08-14 15:34:55 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(alertmail, [AS_HELP_STRING([--with-alertmail], [deprecated])],
1999-10-07 21:21:08 +00:00
[case $with_alertmail in
*) with_mailto="$with_alertmail"
2003-03-19 21:16:57 +00:00
AC_MSG_NOTICE([--with-alertmail option deprecated, treating as --mailto])
1999-10-07 21:21:08 +00:00
;;
esac])
2017-09-18 10:45:02 -06:00
AC_ARG_WITH(pc-insults, [AS_HELP_STRING([--with-pc-insults], [deprecated])],
[case $with_pc_insults in
yes) enable_offensive_insults=no
AC_MSG_NOTICE([--with-pc-insults option deprecated, it is now the default])
;;
no) enable_offensive_insults=yes
AC_MSG_NOTICE([--without-pc-insults option deprecated, use --enable-offensive-insults])
;;
esac])
1994-03-09 23:51:22 +00:00
dnl
1995-01-27 01:28:02 +00:00
dnl Options for --with
1994-06-26 20:35:48 +00:00
dnl
1995-06-18 17:58:42 +00:00
2010-07-28 09:24:55 -04:00
AC_ARG_WITH(devel, [AS_HELP_STRING([--with-devel], [add development options])],
[case $with_devel in
yes) AC_MSG_NOTICE([Setting up for development: -Wall, flex, yacc])
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-DSUDO_DEVEL], [CPPFLAGS])
2011-12-02 13:43:02 -05:00
DEVEL="true"
2010-07-28 09:24:55 -04:00
devdir=.
;;
no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --with-devel: $with_devel])
;;
esac])
2011-09-16 09:04:58 -04:00
AC_ARG_WITH(CC, [AS_HELP_STRING([--with-CC], [C compiler to use])],
[case $with_CC in
2020-01-30 13:25:52 -07:00
*) AC_MSG_ERROR([the --with-CC option is no longer supported, please pass CC=$with_CC to configure instead.])
2011-09-16 09:04:58 -04:00
;;
esac])
2013-03-18 09:27:07 -04:00
AC_ARG_WITH(rpath, [AS_HELP_STRING([--with-rpath], [deprecated, use --disable-rpath])],
[AC_MSG_WARN([--with-rpath deprecated, rpath is now the default])])
2003-03-21 19:01:05 +00:00
2015-12-16 14:57:37 -07:00
AC_ARG_WITH(blibpath, [AS_HELP_STRING([--with-blibpath[[=PATH]]], [deprecated])],
2013-03-18 09:27:07 -04:00
[AC_MSG_WARN([--with-blibpath deprecated, use --with-libpath])])
2003-03-20 19:40:58 +00:00
2009-02-11 01:18:02 +00:00
dnl
dnl Handle BSM auditing support.
dnl
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(bsm-audit, [AS_HELP_STRING([--with-bsm-audit], [enable BSM audit support])],
2009-02-11 01:18:02 +00:00
[case $with_bsm_audit in
yes) AC_DEFINE(HAVE_BSM_AUDIT)
2010-04-30 12:01:15 -04:00
SUDOERS_LIBS="${SUDOERS_LIBS} -lbsm"
2010-06-16 11:17:02 -04:00
SUDOERS_OBJS="${SUDOERS_OBJS} bsm_audit.lo"
2009-02-11 01:18:02 +00:00
;;
no) ;;
*) AC_MSG_ERROR(["--with-bsm-audit does not take an argument."])
;;
esac])
2010-06-16 11:17:02 -04:00
dnl
dnl Handle Linux auditing support.
dnl
AC_ARG_WITH(linux-audit, [AS_HELP_STRING([--with-linux-audit], [enable Linux audit support])],
[case $with_linux_audit in
2010-06-24 15:29:38 -04:00
yes) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libaudit.h>]], [[int i = AUDIT_USER_CMD; (void)i;]])], [
AC_DEFINE(HAVE_LINUX_AUDIT)
SUDO_LIBS="${SUDO_LIBS} -laudit"
2011-03-08 09:46:35 -05:00
SUDOERS_LIBS="${SUDO_LIBS} -laudit"
2010-06-24 15:29:38 -04:00
SUDOERS_OBJS="${SUDOERS_OBJS} linux_audit.lo"
], [
AC_MSG_ERROR([unable to find AUDIT_USER_CMD in libaudit.h for --with-linux-audit])
])
2010-06-16 11:17:02 -04:00
;;
no) ;;
*) AC_MSG_ERROR(["--with-linux-audit does not take an argument."])
;;
esac])
2014-06-27 16:01:40 -06:00
dnl
dnl Handle Solaris auditing support.
dnl
AC_ARG_WITH(solaris-audit, [AS_HELP_STRING([--with-solaris-audit], [enable Solaris audit support])],
[case $with_solaris_audit in
yes) AC_DEFINE(HAVE_SOLARIS_AUDIT)
SUDOERS_LIBS="${SUDOERS_LIBS} -lbsm"
SUDOERS_OBJS="${SUDOERS_OBJS} solaris_audit.lo"
;;
no) ;;
*) AC_MSG_ERROR(["--with-solaris-audit does not take an argument."])
;;
esac])
2012-08-10 11:59:26 -04:00
dnl
dnl Handle SSSD support.
dnl
AC_ARG_WITH(sssd, [AS_HELP_STRING([--with-sssd], [enable SSSD support])],
[case $with_sssd in
yes) SUDOERS_OBJS="${SUDOERS_OBJS} sssd.lo"
2018-02-09 18:21:40 -07:00
case "$SUDOERS_OBJS" in
2018-02-28 14:24:33 -07:00
*ldap_util.lo*) ;;
*) SUDOERS_OBJS="${SUDOERS_OBJS} ldap_util.lo";;
2018-02-09 18:21:40 -07:00
esac
2012-08-10 11:59:26 -04:00
AC_DEFINE(HAVE_SSSD)
;;
no) ;;
*) AC_MSG_ERROR(["--with-sssd does not take an argument."])
;;
esac])
2016-06-04 19:52:10 -06:00
AC_ARG_WITH(sssd-conf, [AS_HELP_STRING([--with-sssd-conf], [path to the SSSD config file])])
sssd_conf="/etc/sssd/sssd.conf"
test -n "$with_sssd_conf" && sssd_conf="$with_sssd_conf"
SUDO_DEFINE_UNQUOTED(_PATH_SSSD_CONF, "$sssd_conf", [Path to the SSSD config file])
2012-08-10 11:59:26 -04:00
AC_ARG_WITH(sssd-lib, [AS_HELP_STRING([--with-sssd-lib], [path to the SSSD library])])
sssd_lib="\"LIBDIR\""
test -n "$with_sssd_lib" && sssd_lib="$with_sssd_lib"
SUDO_DEFINE_UNQUOTED(_PATH_SSSD_LIB, "$sssd_lib", [Path to the SSSD library])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(incpath, [AS_HELP_STRING([--with-incpath], [additional places to look for include files])],
2004-09-08 15:49:26 +00:00
[case $with_incpath in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-incpath an argument."])
1998-10-18 21:45:02 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-incpath not supported."])
1998-10-18 21:45:02 +00:00
;;
2003-03-19 21:16:57 +00:00
*) AC_MSG_NOTICE([Adding ${with_incpath} to CPPFLAGS])
1998-10-18 21:45:02 +00:00
for i in ${with_incpath}; do
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${i}], [CPPFLAGS])
1998-10-18 21:45:02 +00:00
done
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(libpath, [AS_HELP_STRING([--with-libpath], [additional places to look for libraries])],
2004-09-08 15:49:26 +00:00
[case $with_libpath in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-libpath an argument."])
1998-10-18 21:45:02 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-libpath not supported."])
1998-10-18 21:45:02 +00:00
;;
2003-03-19 21:16:57 +00:00
*) AC_MSG_NOTICE([Adding ${with_libpath} to LDFLAGS])
1998-10-18 21:45:02 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(libraries, [AS_HELP_STRING([--with-libraries], [additional libraries to link with])],
2004-09-08 15:49:26 +00:00
[case $with_libraries in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-libraries an argument."])
1998-10-18 21:45:02 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-libraries not supported."])
1998-10-18 21:45:02 +00:00
;;
2003-03-19 21:16:57 +00:00
*) AC_MSG_NOTICE([Adding ${with_libraries} to LIBS])
1998-10-18 21:45:02 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(efence, [AS_HELP_STRING([--with-efence], [link with -lefence for malloc() debugging])],
2004-09-08 15:49:26 +00:00
[case $with_efence in
2003-03-19 21:16:57 +00:00
yes) AC_MSG_NOTICE([Sudo will link with -lefence (Electric Fence)])
2002-01-15 20:48:34 +00:00
LIBS="${LIBS} -lefence"
if test -f /usr/local/lib/libefence.a; then
2003-03-20 19:40:58 +00:00
with_libpath="${with_libpath} /usr/local/lib"
2002-01-15 20:48:34 +00:00
fi
;;
no) ;;
2003-03-19 21:16:57 +00:00
*) AC_MSG_WARN([Ignoring unknown argument to --with-efence: $with_efence])
2002-01-15 20:48:34 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(csops, [AS_HELP_STRING([--with-csops], [add CSOps standard options])],
2004-09-08 15:49:26 +00:00
[case $with_csops in
2003-03-19 21:16:57 +00:00
yes) AC_MSG_NOTICE([Adding CSOps standard options])
1998-10-25 04:48:50 +00:00
CHECKSIA=false
1998-10-18 22:12:36 +00:00
with_ignore_dot=yes
2000-08-13 21:09:22 +00:00
insults=on
1998-10-18 22:12:36 +00:00
with_classic_insults=yes
with_csops_insults=yes
with_env_editor=yes
2005-01-14 18:35:06 +00:00
: ${mansectsu='8'}
: ${mansectform='5'}
1998-10-18 21:45:02 +00:00
;;
no) ;;
2003-03-19 21:16:57 +00:00
*) AC_MSG_WARN([Ignoring unknown argument to --with-csops: $with_csops])
1998-10-18 21:45:02 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(passwd, [AS_HELP_STRING([--without-passwd], [don't use passwd/shadow file for authentication])],
1999-07-22 12:46:29 +00:00
[case $with_passwd in
2007-09-02 20:35:52 +00:00
yes|no) AC_MSG_CHECKING(whether to use shadow/passwd file authentication)
AC_MSG_RESULT($with_passwd)
2007-09-05 22:16:22 +00:00
AUTH_DEF=""
test "$with_passwd" = "yes" && AUTH_REG="$AUTH_REG passwd"
1999-07-22 12:46:29 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["Sorry, --with-passwd does not take an argument."])
1999-07-22 12:46:29 +00:00
;;
esac])
2015-12-16 14:57:37 -07:00
AC_ARG_WITH(skey, [AS_HELP_STRING([--with-skey[[=DIR]]], [enable S/Key support ])],
1996-04-02 23:48:08 +00:00
[case $with_skey in
2011-04-06 09:33:07 -04:00
no) ;;
2007-09-05 22:16:22 +00:00
*) AC_DEFINE(HAVE_SKEY)
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to try S/Key authentication)
AC_MSG_RESULT(yes)
2007-09-05 22:16:22 +00:00
AUTH_REG="$AUTH_REG S/Key"
1996-04-02 23:48:08 +00:00
;;
esac])
2015-12-16 14:57:37 -07:00
AC_ARG_WITH(opie, [AS_HELP_STRING([--with-opie[[=DIR]]], [enable OPIE support ])],
1996-10-05 03:59:53 +00:00
[case $with_opie in
2011-04-06 09:33:07 -04:00
no) ;;
2007-09-05 22:16:22 +00:00
*) AC_DEFINE(HAVE_OPIE)
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to try NRL OPIE authentication)
AC_MSG_RESULT(yes)
2007-09-05 22:16:22 +00:00
AUTH_REG="$AUTH_REG NRL_OPIE"
1996-10-05 03:59:53 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(long-otp-prompt, [AS_HELP_STRING([--with-long-otp-prompt], [use a two line OTP (skey/opie) prompt])],
1998-10-18 05:09:37 +00:00
[case $with_long_otp_prompt in
2004-09-08 15:49:26 +00:00
yes) AC_DEFINE(LONG_OTP_PROMPT)
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to use a two line prompt for OTP authentication)
AC_MSG_RESULT(yes)
2000-08-13 21:09:22 +00:00
long_otp_prompt=on
;;
no) long_otp_prompt=off
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-long-otp-prompt does not take an argument."])
1998-10-15 03:31:26 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(SecurID, [AS_HELP_STRING([--with-SecurID[[=DIR]]], [enable SecurID support])],
1996-04-02 23:48:08 +00:00
[case $with_SecurID in
2011-04-06 09:33:07 -04:00
no) ;;
2004-09-08 15:49:26 +00:00
*) AC_DEFINE(HAVE_SECURID)
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to use SecurID for authentication)
AC_MSG_RESULT(yes)
2007-09-05 22:16:22 +00:00
AUTH_EXCL="$AUTH_EXCL SecurID"
1996-04-02 23:48:08 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(fwtk, [AS_HELP_STRING([--with-fwtk[[=DIR]]], [enable FWTK AuthSRV support])],
1999-07-22 12:46:29 +00:00
[case $with_fwtk in
2011-04-06 09:33:07 -04:00
no) ;;
2004-09-08 15:49:26 +00:00
*) AC_DEFINE(HAVE_FWTK)
1999-01-20 01:24:41 +00:00
AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication)
AC_MSG_RESULT(yes)
2007-09-05 22:16:22 +00:00
AUTH_EXCL="$AUTH_EXCL FWTK"
1999-01-19 02:04:41 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(kerb5, [AS_HELP_STRING([--with-kerb5[[=DIR]]], [enable Kerberos V support])],
1996-04-02 23:48:08 +00:00
[case $with_kerb5 in
2011-04-06 09:33:07 -04:00
no) ;;
2003-03-19 21:16:57 +00:00
*) AC_MSG_CHECKING(whether to try Kerberos V authentication)
1998-10-18 21:45:02 +00:00
AC_MSG_RESULT(yes)
2007-09-05 22:16:22 +00:00
AUTH_REG="$AUTH_REG kerb5"
1998-10-18 21:45:02 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(aixauth, [AS_HELP_STRING([--with-aixauth], [enable AIX general authentication support])],
2005-01-21 15:29:05 +00:00
[case $with_aixauth in
2007-09-05 22:16:22 +00:00
yes) AUTH_EXCL="$AUTH_EXCL AIX_AUTH";;
no) ;;
2005-01-21 15:29:05 +00:00
*) AC_MSG_ERROR(["--with-aixauth does not take an argument."])
1996-04-02 23:48:08 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(pam, [AS_HELP_STRING([--with-pam], [enable PAM support])],
1998-09-11 23:19:53 +00:00
[case $with_pam in
2007-09-05 22:16:22 +00:00
yes) AUTH_EXCL="$AUTH_EXCL PAM";;
no) ;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-pam does not take an argument."])
1998-09-11 23:19:53 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(AFS, [AS_HELP_STRING([--with-AFS], [enable AFS support])],
1996-04-02 23:48:08 +00:00
[case $with_AFS in
2004-09-08 15:49:26 +00:00
yes) AC_DEFINE(HAVE_AFS)
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to try AFS (kerberos) authentication)
AC_MSG_RESULT(yes)
2007-09-05 22:16:22 +00:00
AUTH_REG="$AUTH_REG AFS"
1996-04-02 23:48:08 +00:00
;;
no) ;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-AFS does not take an argument."])
1998-02-17 05:37:26 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(DCE, [AS_HELP_STRING([--with-DCE], [enable DCE support])],
1996-04-02 23:48:08 +00:00
[case $with_DCE in
2004-09-08 15:49:26 +00:00
yes) AC_DEFINE(HAVE_DCE)
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to try DCE (kerberos) authentication)
AC_MSG_RESULT(yes)
2007-09-05 22:16:22 +00:00
AUTH_REG="$AUTH_REG DCE"
1996-04-02 23:48:08 +00:00
;;
no) ;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-DCE does not take an argument."])
1996-04-02 23:48:08 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(logincap, [AS_HELP_STRING([--with-logincap], [enable BSD login class support])],
2000-03-07 04:29:46 +00:00
[case $with_logincap in
2000-10-26 16:42:40 +00:00
yes|no) ;;
2000-03-07 04:29:46 +00:00
*) AC_MSG_ERROR(["--with-logincap does not take an argument."])
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(bsdauth, [AS_HELP_STRING([--with-bsdauth], [enable BSD authentication support])],
2000-10-26 16:42:40 +00:00
[case $with_bsdauth in
2007-09-05 22:16:22 +00:00
yes) AUTH_EXCL="$AUTH_EXCL BSD_AUTH";;
no) ;;
2000-10-26 16:42:40 +00:00
*) AC_MSG_ERROR(["--with-bsdauth does not take an argument."])
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(project, [AS_HELP_STRING([--with-project], [enable Solaris project support])],
2007-06-19 22:24:51 +00:00
[case $with_project in
yes|no) ;;
no) ;;
*) AC_MSG_ERROR(["--with-project does not take an argument."])
;;
esac])
1999-08-05 21:38:19 +00:00
AC_MSG_CHECKING(whether to lecture users the first time they run sudo)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(lecture, [AS_HELP_STRING([--without-lecture], [don't print lecture for first-time sudoer])],
2004-09-08 15:49:26 +00:00
[case $with_lecture in
2003-12-30 22:34:28 +00:00
yes|short|always) lecture=once
1998-10-15 06:24:42 +00:00
;;
2003-12-30 22:34:28 +00:00
no|none|never) lecture=never
1998-10-15 06:24:42 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["unknown argument to --with-lecture: $with_lecture"])
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
2003-12-30 22:34:28 +00:00
if test "$lecture" = "once"; then
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(yes)
else
2004-09-08 15:49:26 +00:00
AC_DEFINE(NO_LECTURE)
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(no)
fi
1998-10-15 06:24:42 +00:00
1999-11-08 22:45:42 +00:00
AC_MSG_CHECKING(whether sudo should log via syslog or to a file by default)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(logging, [AS_HELP_STRING([--with-logging], [log via syslog, file, or both])],
2004-09-08 15:49:26 +00:00
[case $with_logging in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-logging an argument."])
1998-03-28 00:46:12 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-logging not supported."])
1998-03-28 00:46:12 +00:00
;;
2004-09-08 15:49:26 +00:00
syslog) AC_DEFINE(LOGGING, SLOG_SYSLOG)
1998-10-18 21:45:02 +00:00
AC_MSG_RESULT(syslog)
1998-10-15 06:24:42 +00:00
;;
file) AC_DEFINE(LOGGING, SLOG_FILE)
1998-10-18 21:45:02 +00:00
AC_MSG_RESULT(file)
1998-10-15 06:24:42 +00:00
;;
both) AC_DEFINE(LOGGING, SLOG_BOTH)
1998-10-18 21:45:02 +00:00
AC_MSG_RESULT(both)
1998-10-15 06:24:42 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["unknown argument to --with-logging: $with_logging"])
1998-10-15 06:24:42 +00:00
;;
1998-10-18 21:45:02 +00:00
esac], [AC_DEFINE(LOGGING, SLOG_SYSLOG) AC_MSG_RESULT(syslog)])
1998-10-15 06:24:42 +00:00
2010-07-22 17:50:21 -04:00
AC_ARG_WITH(logfac, [AS_HELP_STRING([--with-logfac], [syslog facility to log with (default is "auth")])],
2004-09-08 15:49:26 +00:00
[case $with_logfac in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-logfac an argument."])
1998-10-15 06:24:42 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-logfac not supported."])
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
authpriv|auth|daemon|user|local0|local1|local2|local3|local4|local5|local6|local7) logfac=$with_logfac
1998-10-15 06:24:42 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["$with_logfac is not a supported syslog facility."])
;;
2000-08-13 21:09:22 +00:00
esac])
1998-10-15 06:24:42 +00:00
1999-08-05 14:30:57 +00:00
AC_MSG_CHECKING(at which syslog priority to log commands)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(goodpri, [AS_HELP_STRING([--with-goodpri], [syslog priority for commands (def is "notice")])],
2004-09-08 15:49:26 +00:00
[case $with_goodpri in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-goodpri an argument."])
1999-08-05 14:30:57 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-goodpri not supported."])
1999-08-05 14:30:57 +00:00
;;
2000-08-13 21:09:22 +00:00
alert|crit|debug|emerg|err|info|notice|warning)
goodpri=$with_goodpri
1999-08-05 14:30:57 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["$with_goodpri is not a supported syslog priority."])
;;
2000-08-13 21:09:22 +00:00
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri", [The syslog priority sudo will use for successful attempts.])
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT($goodpri)
1999-08-05 14:30:57 +00:00
AC_MSG_CHECKING(at which syslog priority to log failures)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(badpri, [AS_HELP_STRING([--with-badpri], [syslog priority for failures (def is "alert")])],
2004-09-08 15:49:26 +00:00
[case $with_badpri in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-badpri an argument."])
1999-08-05 14:30:57 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-badpri not supported."])
1999-08-05 14:30:57 +00:00
;;
2000-08-13 21:09:22 +00:00
alert|crit|debug|emerg|err|info|notice|warning)
badpri=$with_badpri
1999-08-05 14:30:57 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR([$with_badpri is not a supported syslog priority.])
;;
2000-08-13 21:09:22 +00:00
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri", [The syslog priority sudo will use for unsuccessful attempts/errors.])
2002-04-26 19:12:34 +00:00
AC_MSG_RESULT($badpri)
1999-08-05 14:30:57 +00:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(logpath, [AS_HELP_STRING([--with-logpath], [path to the sudo log file])],
2004-09-08 15:49:26 +00:00
[case $with_logpath in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-logpath an argument."])
1998-10-17 04:30:21 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-logpath not supported."])
1998-10-17 04:30:21 +00:00
;;
esac])
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(how long a line in the log file should be)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(loglen, [AS_HELP_STRING([--with-loglen], [maximum length of a log file line (default is 80)])],
2004-09-08 15:49:26 +00:00
[case $with_loglen in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-loglen an argument."])
1998-10-15 06:24:42 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-loglen not supported."])
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
[[0-9]]*) loglen=$with_loglen
1998-10-15 06:24:42 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["you must enter a number, not $with_loglen"])
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen, [The max number of chars per log file line (for line wrapping).])
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT($loglen)
1998-10-15 03:31:26 +00:00
1998-10-18 22:12:36 +00:00
AC_MSG_CHECKING(whether sudo should ignore '.' or '' in \$PATH)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(ignore-dot, [AS_HELP_STRING([--with-ignore-dot], [ignore '.' in the PATH])],
2004-09-08 15:49:26 +00:00
[case $with_ignore_dot in
2000-08-13 21:09:22 +00:00
yes) ignore_dot=on
1998-10-18 21:45:02 +00:00
;;
2000-08-13 21:09:22 +00:00
no) ignore_dot=off
1998-10-15 06:24:42 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-ignore-dot does not take an argument."])
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
if test "$ignore_dot" = "on"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(IGNORE_DOT_PATH)
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
1998-10-15 06:24:42 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to send mail when a user is not in sudoers)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(mail-if-no-user, [AS_HELP_STRING([--without-mail-if-no-user], [do not send mail if user not in sudoers])],
2004-09-08 15:49:26 +00:00
[case $with_mail_if_no_user in
2000-08-13 21:09:22 +00:00
yes) mail_no_user=on
1998-10-18 21:45:02 +00:00
;;
2000-08-13 21:09:22 +00:00
no) mail_no_user=off
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
*) AC_MSG_ERROR(["--with-mail-if-no-user does not take an argument."])
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
if test "$mail_no_user" = "on"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(SEND_MAIL_WHEN_NO_USER)
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
1998-10-15 06:24:42 +00:00
1999-08-19 16:30:09 +00:00
AC_MSG_CHECKING(whether to send mail when user listed but not for this host)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(mail-if-no-host, [AS_HELP_STRING([--with-mail-if-no-host], [send mail if user in sudoers but not for this host])],
2004-09-08 15:49:26 +00:00
[case $with_mail_if_no_host in
2000-08-13 21:09:22 +00:00
yes) mail_no_host=on
1999-08-19 16:30:09 +00:00
;;
2000-08-13 21:09:22 +00:00
no) mail_no_host=off
1999-08-19 16:30:09 +00:00
;;
2000-08-13 21:09:22 +00:00
*) AC_MSG_ERROR(["--with-mail-if-no-host does not take an argument."])
1999-08-19 16:30:09 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
if test "$mail_no_host" = "on"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(SEND_MAIL_WHEN_NO_HOST)
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
1999-08-19 16:30:09 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to send mail when a user tries a disallowed command)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(mail-if-noperms, [AS_HELP_STRING([--with-mail-if-noperms], [send mail if user not allowed to run command])],
2004-09-08 15:49:26 +00:00
[case $with_mail_if_noperms in
2000-08-13 21:09:22 +00:00
yes) mail_noperms=on
1998-10-18 21:45:02 +00:00
;;
2000-08-13 21:09:22 +00:00
no) mail_noperms=off
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
*) AC_MSG_ERROR(["--with-mail-if-noperms does not take an argument."])
1998-10-15 06:24:42 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
if test "$mail_noperms" = "on"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(SEND_MAIL_WHEN_NOT_OK)
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(who should get the mail that sudo sends)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(mailto, [AS_HELP_STRING([--with-mailto], [who should get sudo mail (default is "root")])],
2004-09-08 15:49:26 +00:00
[case $with_mailto in
2000-08-13 21:09:22 +00:00
yes) AC_MSG_ERROR(["must give --with-mailto an argument."])
;;
no) AC_MSG_ERROR(["--without-mailto not supported."])
;;
*) mailto=$with_mailto
;;
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(MAILTO, "$mailto", [The user or email address that sudo mail is sent to.])
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT([$mailto])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(mailsubject, [AS_HELP_STRING([--with-mailsubject], [subject of sudo mail])],
2004-09-08 15:49:26 +00:00
[case $with_mailsubject in
2000-08-13 21:09:22 +00:00
yes) AC_MSG_ERROR(["must give --with-mailsubject an argument."])
;;
2003-03-19 21:16:57 +00:00
no) AC_MSG_WARN([Sorry, --without-mailsubject not supported.])
2000-08-13 21:09:22 +00:00
;;
*) mailsub="$with_mailsubject"
AC_MSG_CHECKING(sudo mail subject)
AC_MSG_RESULT([Using alert mail subject: $mailsub])
;;
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub", [The subject of the mail sent by sudo to the MAILTO user/address.])
1998-10-15 06:24:42 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(for bad password prompt)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(passprompt, [AS_HELP_STRING([--with-passprompt], [default password prompt])],
2004-09-08 15:49:26 +00:00
[case $with_passprompt in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-passprompt an argument."])
1998-10-15 03:31:26 +00:00
;;
2003-03-19 21:16:57 +00:00
no) AC_MSG_WARN([Sorry, --without-passprompt not supported.])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
*) passprompt="$with_passprompt"
esac])
AC_MSG_RESULT($passprompt)
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt", [The default password prompt.])
1998-10-15 03:31:26 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(for bad password message)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(badpass-message, [AS_HELP_STRING([--with-badpass-message], [message the user sees when the password is wrong])],
2004-09-08 15:49:26 +00:00
[case $with_badpass_message in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["Must give --with-badpass-message an argument."])
1998-10-15 03:31:26 +00:00
;;
2003-03-19 21:16:57 +00:00
no) AC_MSG_WARN([Sorry, --without-badpass-message not supported.])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
*) badpass_message="$with_badpass_message"
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message", [The message given when a bad password is entered.])
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT([$badpass_message])
1998-10-15 03:31:26 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to expect fully qualified hosts in sudoers)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(fqdn, [AS_HELP_STRING([--with-fqdn], [expect fully qualified hosts in sudoers])],
2004-09-08 15:49:26 +00:00
[case $with_fqdn in
2000-08-13 21:09:22 +00:00
yes) fqdn=on
1998-10-18 21:45:02 +00:00
;;
2000-08-13 21:09:22 +00:00
no) fqdn=off
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-fqdn does not take an argument."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
if test "$fqdn" = "on"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(FQDN)
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
1998-10-15 03:31:26 +00:00
2014-02-01 05:57:34 -07:00
AC_ARG_WITH(timedir, [AS_HELP_STRING([--with-timedir=DIR], [deprecated])],
2004-09-08 15:49:26 +00:00
[case $with_timedir in
2014-02-01 05:57:34 -07:00
*) AC_MSG_ERROR(["--without-timedir no longer supported, see --with-rundir."])
1998-03-28 00:46:12 +00:00
;;
2014-02-01 05:57:34 -07:00
esac])
2018-02-19 11:27:30 -07:00
AC_ARG_WITH(rundir, [AS_HELP_STRING([--with-rundir=DIR], [directory for sudo-specific files that do not survive a system reboot, e.g. `/var/run/sudo'])],
2014-02-01 05:57:34 -07:00
[case $with_rundir in
yes) AC_MSG_ERROR(["must give --with-rundir an argument."])
;;
no) AC_MSG_ERROR(["--without-rundir not supported."])
1998-03-28 00:46:12 +00:00
;;
esac])
2018-02-19 11:27:30 -07:00
AC_ARG_WITH(vardir, [AS_HELP_STRING([--with-vardir=DIR], [directory for sudo-specific files that survive a system reboot, e.g. `/var/db/sudo' or `/var/lib/sudo'])],
2014-02-01 05:57:34 -07:00
[case $with_vardir in
2015-04-06 15:10:26 -06:00
yes) AC_MSG_ERROR(["must give --with-vardir an argument."])
2014-01-30 15:50:40 -07:00
;;
2015-04-06 15:10:26 -06:00
no) AC_MSG_ERROR(["--without-vardir not supported."])
2014-01-30 15:50:40 -07:00
;;
esac])
2010-12-13 16:58:33 -05:00
AC_ARG_WITH(iologdir, [AS_HELP_STRING([--with-iologdir=DIR], [directory to store sudo I/O log files in])],
2010-05-30 10:31:38 -04:00
[case $with_iologdir in
2010-03-04 08:12:36 -05:00
yes) ;;
2010-06-04 09:09:19 -04:00
no) AC_MSG_ERROR(["--without-iologdir not supported."])
2010-03-04 08:12:36 -05:00
;;
esac])
2015-02-06 11:01:05 -07:00
AC_ARG_WITH(tzdir, [AS_HELP_STRING([--with-tzdir=DIR], [path to the time zone data directory])],
[case $with_tzdir in
yes) AC_MSG_ERROR(["must give --with-tzdir an argument."])
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(sendmail, [AS_HELP_STRING([--with-sendmail], [set path to sendmail])
AS_HELP_STRING([--without-sendmail], [do not send mail at all])],
2004-09-08 15:49:26 +00:00
[case $with_sendmail in
1998-10-15 03:31:26 +00:00
yes) with_sendmail=""
;;
1999-02-24 00:43:51 +00:00
no) ;;
2002-01-02 22:36:50 +00:00
*) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail")
1998-10-15 03:31:26 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(sudoers-mode, [AS_HELP_STRING([--with-sudoers-mode], [mode of sudoers file (defaults to 0440)])],
2004-09-08 15:49:26 +00:00
[case $with_sudoers_mode in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-sudoers-mode an argument."])
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-sudoers-mode not supported."])
1998-10-15 03:31:26 +00:00
;;
1999-09-14 07:42:16 +00:00
[[1-9]]*) SUDOERS_MODE=0${with_sudoers_mode}
;;
0*) SUDOERS_MODE=$with_sudoers_mode
1998-10-17 04:30:21 +00:00
;;
2003-03-15 20:16:58 +00:00
*) AC_MSG_ERROR(["you must use an octal mode, not a name."])
1998-10-15 03:31:26 +00:00
;;
1998-10-17 04:30:21 +00:00
esac])
1998-10-15 03:31:26 +00:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(sudoers-uid, [AS_HELP_STRING([--with-sudoers-uid], [uid that owns sudoers file (defaults to 0)])],
2004-09-08 15:49:26 +00:00
[case $with_sudoers_uid in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-sudoers-uid an argument."])
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-sudoers-uid not supported."])
1998-10-15 03:31:26 +00:00
;;
1998-11-24 04:29:50 +00:00
[[0-9]]*) SUDOERS_UID=$with_sudoers_uid
1998-10-15 03:31:26 +00:00
;;
2003-03-15 20:16:58 +00:00
*) AC_MSG_ERROR(["you must use an unsigned numeric uid, not a name."])
1998-10-15 03:31:26 +00:00
;;
1998-10-17 04:30:21 +00:00
esac])
1998-10-15 03:31:26 +00:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(sudoers-gid, [AS_HELP_STRING([--with-sudoers-gid], [gid that owns sudoers file (defaults to 0)])],
2004-09-08 15:49:26 +00:00
[case $with_sudoers_gid in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-sudoers-gid an argument."])
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-sudoers-gid not supported."])
1998-10-15 03:31:26 +00:00
;;
1998-11-24 04:29:50 +00:00
[[0-9]]*) SUDOERS_GID=$with_sudoers_gid
1998-10-15 03:31:26 +00:00
;;
2003-03-15 20:16:58 +00:00
*) AC_MSG_ERROR(["you must use an unsigned numeric gid, not a name."])
1998-10-15 03:31:26 +00:00
;;
1998-10-17 04:30:21 +00:00
esac])
1998-10-15 03:31:26 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(for umask programs should be run with)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(umask, [AS_HELP_STRING([--with-umask], [umask with which the prog should run (default is 022)])
AS_HELP_STRING([--without-umask], [Preserves the umask of the user invoking sudo.])],
2004-09-08 15:49:26 +00:00
[case $with_umask in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-umask an argument."])
1998-10-15 03:31:26 +00:00
;;
2002-01-02 22:36:50 +00:00
no) sudo_umask=0777
1998-10-18 21:45:02 +00:00
;;
2002-01-02 22:36:50 +00:00
[[0-9]]*) sudo_umask=$with_umask
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["you must enter a numeric mask."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
2010-09-14 17:18:55 -04:00
AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask, [The umask that the sudo-run prog should use.])
2000-08-13 21:09:22 +00:00
if test "$sudo_umask" = "0777"; then
AC_MSG_RESULT(user)
else
AC_MSG_RESULT($sudo_umask)
fi
1998-10-15 03:31:26 +00:00
2010-09-14 17:18:55 -04:00
AC_ARG_WITH(umask-override, [AS_HELP_STRING([--with-umask-override], [Use the umask specified in sudoers even if it is less restrictive than the user's.])],
[case $with_umask_override in
yes) AC_DEFINE(UMASK_OVERRIDE)
umask_override=on
;;
no) umask_override=off
;;
*) AC_MSG_ERROR(["--with-umask-override does not take an argument."])
;;
esac])
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(for default user to run commands as)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(runas-default, [AS_HELP_STRING([--with-runas-default], [User to run commands as (default is "root")])],
2004-09-08 15:49:26 +00:00
[case $with_runas_default in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-runas-default an argument."])
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-runas-default not supported."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
*) runas_default="$with_runas_default"
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default", [The user sudo should run commands as by default.])
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT([$runas_default])
1998-10-15 03:31:26 +00:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(exempt, [AS_HELP_STRING([--with-exempt=group], [no passwd needed for users in this group])],
2004-09-08 15:49:26 +00:00
[case $with_exempt in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-exempt an argument."])
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-exempt not supported."])
1998-10-15 03:31:26 +00:00
;;
2002-01-02 22:36:50 +00:00
*) AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt", [If defined, users in this group need not enter a passwd (ie "sudo").])
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(for group to be exempt from password)
AC_MSG_RESULT([$with_exempt])
1998-10-15 03:31:26 +00:00
;;
esac])
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(for editor that visudo should use)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(editor, [AS_HELP_STRING([--with-editor=path], [Default editor for visudo (defaults to vi)])],
2004-09-08 15:49:26 +00:00
[case $with_editor in
1999-11-08 22:45:42 +00:00
yes) AC_MSG_ERROR(["must give --with-editor an argument."])
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-editor not supported."])
1998-10-15 03:31:26 +00:00
;;
2002-01-02 22:36:50 +00:00
*) AC_DEFINE_UNQUOTED(EDITOR, "$with_editor", [A colon-separated list of pathnames to be used as the editor for visudo.])
1998-10-18 21:45:02 +00:00
AC_MSG_RESULT([$with_editor])
2010-07-14 09:33:53 -04:00
editor="$with_editor"
1998-10-15 03:31:26 +00:00
;;
1998-10-18 21:45:02 +00:00
esac], [AC_DEFINE(EDITOR, _PATH_VI) AC_MSG_RESULT(vi)])
1998-10-15 03:31:26 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(whether to obey EDITOR and VISUAL environment variables)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(env-editor, [AS_HELP_STRING([--with-env-editor], [Use the environment variable EDITOR for visudo])],
2004-09-08 15:49:26 +00:00
[case $with_env_editor in
2000-08-13 21:09:22 +00:00
yes) env_editor=on
1998-10-18 21:45:02 +00:00
;;
2000-08-13 21:09:22 +00:00
no) env_editor=off
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-env-editor does not take an argument."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
if test "$env_editor" = "on"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(ENV_EDITOR)
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
1998-10-15 03:31:26 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(number of tries a user gets to enter their password)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(passwd-tries, [AS_HELP_STRING([--with-passwd-tries], [number of tries to enter password (default is 3)])],
2004-09-08 15:49:26 +00:00
[case $with_passwd_tries in
2000-08-13 21:09:22 +00:00
yes) ;;
1999-11-08 22:45:42 +00:00
no) AC_MSG_ERROR(["--without-editor not supported."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
[[1-9]]*) passwd_tries=$with_passwd_tries
1998-10-15 03:31:26 +00:00
;;
2020-05-07 07:49:54 -06:00
*) AC_MSG_ERROR(["you must enter the number of tries, > 0"])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries, [The number of tries a user gets to enter their password.])
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT($passwd_tries)
1998-10-15 03:31:26 +00:00
1998-10-18 21:45:02 +00:00
AC_MSG_CHECKING(time in minutes after which sudo will ask for a password again)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(timeout, [AS_HELP_STRING([--with-timeout], [minutes before sudo asks for passwd again (def is 5 minutes)])],
2004-09-08 15:49:26 +00:00
[case $with_timeout in
2000-08-13 21:09:22 +00:00
yes) ;;
no) timeout=0
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
[[0-9]]*) timeout=$with_timeout
1998-10-15 03:31:26 +00:00
;;
2020-05-07 07:49:54 -06:00
*) AC_MSG_ERROR(["you must enter the number of minutes."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(TIMEOUT, $timeout, [The number of minutes before sudo asks for a password again.])
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT($timeout)
1998-10-15 03:31:26 +00:00
1998-10-18 22:12:36 +00:00
AC_MSG_CHECKING(time in minutes after the password prompt will time out)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(password-timeout, [AS_HELP_STRING([--with-password-timeout], [passwd prompt timeout in minutes (default is 5 minutes)])],
2004-09-08 15:49:26 +00:00
[case $with_password_timeout in
2000-08-13 21:09:22 +00:00
yes) ;;
no) password_timeout=0
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
[[0-9]]*) password_timeout=$with_password_timeout
1998-10-15 03:31:26 +00:00
;;
2020-05-07 07:49:54 -06:00
*) AC_MSG_ERROR(["you must enter the number of minutes."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
2002-01-02 22:36:50 +00:00
AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout, [The passwd prompt timeout (in minutes).])
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT($password_timeout)
1998-10-15 03:31:26 +00:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(tty-tickets, [AS_HELP_STRING([--with-tty-tickets], [use a different ticket file for each tty])],
2004-09-08 15:49:26 +00:00
[case $with_tty_tickets in
2017-08-01 16:14:54 -06:00
yes) timestamp_type=tty
1998-10-18 22:12:36 +00:00
;;
2017-08-01 16:14:54 -06:00
no) timestamp_type=global
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-tty-tickets does not take an argument."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
1998-10-15 03:31:26 +00:00
1998-10-18 22:12:36 +00:00
AC_MSG_CHECKING(whether to include insults)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(insults, [AS_HELP_STRING([--with-insults], [insult the user for entering an incorrect password])],
2004-09-08 15:49:26 +00:00
[case $with_insults in
2000-08-13 21:09:22 +00:00
yes) insults=on
1998-10-18 22:12:36 +00:00
with_classic_insults=yes
with_csops_insults=yes
;;
2010-07-12 18:04:16 -04:00
disabled) insults=off
with_classic_insults=yes
with_csops_insults=yes
;;
2000-08-13 21:09:22 +00:00
no) insults=off
1998-10-15 03:31:26 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-insults does not take an argument."])
1998-10-15 03:31:26 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
if test "$insults" = "on"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(USE_INSULTS)
2000-08-13 21:09:22 +00:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
1998-10-18 22:12:36 +00:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(all-insults, [AS_HELP_STRING([--with-all-insults], [include all the sudo insult sets])],
2004-09-08 15:49:26 +00:00
[case $with_all_insults in
1998-10-18 22:12:36 +00:00
yes) with_classic_insults=yes
with_csops_insults=yes
with_hal_insults=yes
with_goons_insults=yes
2018-04-17 07:10:43 -06:00
with_python_insults=yes
1998-10-18 22:12:36 +00:00
;;
no) ;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-all-insults does not take an argument."])
1998-10-18 22:12:36 +00:00
;;
1998-10-15 03:31:26 +00:00
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(classic-insults, [AS_HELP_STRING([--with-classic-insults], [include the insults from the "classic" sudo])],
2004-09-08 15:49:26 +00:00
[case $with_classic_insults in
yes) AC_DEFINE(CLASSIC_INSULTS)
1998-10-15 03:31:26 +00:00
;;
no) ;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-classic-insults does not take an argument."])
1998-10-15 03:31:26 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(csops-insults, [AS_HELP_STRING([--with-csops-insults], [include CSOps insults])],
2004-09-08 15:49:26 +00:00
[case $with_csops_insults in
yes) AC_DEFINE(CSOPS_INSULTS)
1998-10-17 04:30:21 +00:00
;;
no) ;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-csops-insults does not take an argument."])
1998-10-17 04:30:21 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(hal-insults, [AS_HELP_STRING([--with-hal-insults], [include 2001-like insults])],
2004-09-08 15:49:26 +00:00
[case $with_hal_insults in
yes) AC_DEFINE(HAL_INSULTS)
1998-10-15 03:31:26 +00:00
;;
no) ;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-hal-insults does not take an argument."])
1998-10-15 03:31:26 +00:00
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(goons-insults, [AS_HELP_STRING([--with-goons-insults], [include the insults from the "Goon Show"])],
2004-09-08 15:49:26 +00:00
[case $with_goons_insults in
yes) AC_DEFINE(GOONS_INSULTS)
1998-10-15 03:31:26 +00:00
;;
no) ;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-goons-insults does not take an argument."])
1998-10-15 03:31:26 +00:00
;;
esac])
2018-04-17 07:10:43 -06:00
AC_ARG_WITH(python-insults, [AS_HELP_STRING([--with-python-insults], [include the insults from "Monty Python's Flying Circus"])],
[case $with_python_insults in
yes) AC_DEFINE(PYTHON_INSULTS)
;;
no) ;;
*) AC_MSG_ERROR(["--with-python-insults does not take an argument."])
;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(nsswitch, [AS_HELP_STRING([--with-nsswitch[[=PATH]]], [path to nsswitch.conf])],
2008-01-01 18:22:03 +00:00
[case $with_nsswitch in
no) ;;
yes) with_nsswitch="/etc/nsswitch.conf"
;;
*) ;;
esac])
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(ldap, [AS_HELP_STRING([--with-ldap[[=DIR]]], [enable LDAP support])],
2004-02-13 02:08:27 +00:00
[case $with_ldap in
2009-04-10 20:59:42 +00:00
no) ;;
2004-09-08 15:49:26 +00:00
*) AC_DEFINE(HAVE_LDAP)
2004-02-13 02:08:27 +00:00
AC_MSG_CHECKING(whether to use sudoers from LDAP)
AC_MSG_RESULT(yes)
;;
esac])
2008-01-01 18:22:03 +00:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(ldap-conf-file, [AS_HELP_STRING([--with-ldap-conf-file], [path to LDAP configuration file])])
2010-06-11 18:34:24 -04:00
test -n "$with_ldap_conf_file" && ldap_conf="$with_ldap_conf_file"
SUDO_DEFINE_UNQUOTED(_PATH_LDAP_CONF, "$ldap_conf", [Path to the ldap.conf file])
2008-01-01 18:22:03 +00:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(ldap-secret-file, [AS_HELP_STRING([--with-ldap-secret-file], [path to LDAP secret password file])])
2010-06-11 18:34:24 -04:00
test -n "$with_ldap_secret_file" && ldap_secret="$with_ldap_secret_file"
SUDO_DEFINE_UNQUOTED(_PATH_LDAP_SECRET, "$ldap_secret", [Path to the ldap.secret file])
2004-02-13 02:08:27 +00:00
1998-10-18 22:12:36 +00:00
dnl include all insult sets on one line
2000-08-13 21:09:22 +00:00
if test "$insults" = "on"; then
1998-10-18 22:12:36 +00:00
AC_MSG_CHECKING(which insult sets to include)
i=""
2018-04-17 07:10:43 -06:00
test "$with_python_insults" = "yes" && i="python ${i}"
1998-10-18 22:12:36 +00:00
test "$with_goons_insults" = "yes" && i="goons ${i}"
1998-10-18 23:42:52 +00:00
test "$with_hal_insults" = "yes" && i="hal ${i}"
test "$with_csops_insults" = "yes" && i="csops ${i}"
test "$with_classic_insults" = "yes" && i="classic ${i}"
1998-10-18 22:12:36 +00:00
AC_MSG_RESULT([$i])
fi
AC_MSG_CHECKING(whether to override the user's path)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(secure-path, [AS_HELP_STRING([--with-secure-path], [override the user's path with a built-in one])],
2004-09-08 15:49:26 +00:00
[case $with_secure_path in
2009-09-25 01:11:49 +00:00
yes) with_secure_path="/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc"
AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
AC_MSG_RESULT([$with_secure_path])
secure_path="set to $with_secure_path"
1998-10-18 22:12:36 +00:00
;;
no) AC_MSG_RESULT(no)
1998-10-15 03:31:26 +00:00
;;
1998-10-18 05:09:37 +00:00
*) AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
1998-10-18 22:12:36 +00:00
AC_MSG_RESULT([$with_secure_path])
2009-09-25 01:11:49 +00:00
secure_path="set to F<$with_secure_path>"
1998-10-15 03:31:26 +00:00
;;
1998-10-18 22:12:36 +00:00
esac], AC_MSG_RESULT(no))
1998-10-15 03:31:26 +00:00
1998-10-18 22:12:36 +00:00
AC_MSG_CHECKING(whether to get ip addresses from the network interfaces)
2020-11-24 07:40:38 -07:00
AC_ARG_WITH(interfaces, [AS_HELP_STRING([--without-interfaces], [don't try to read the ip addr of network interfaces])],
2004-09-08 15:49:26 +00:00
[case $with_interfaces in
1998-10-18 22:12:36 +00:00
yes) AC_MSG_RESULT(yes)
;;
2004-09-08 15:49:26 +00:00
no) AC_DEFINE(STUB_LOAD_INTERFACES)
1998-10-18 22:12:36 +00:00
AC_MSG_RESULT(no)
1998-10-15 06:24:42 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--with-interfaces does not take an argument."])
1998-10-15 06:24:42 +00:00
;;
1998-10-18 22:12:36 +00:00
esac], AC_MSG_RESULT(yes))
1998-10-15 06:24:42 +00:00
2008-03-04 22:16:49 +00:00
AC_MSG_CHECKING(whether to use an askpass helper)
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(askpass, [AS_HELP_STRING([--with-askpass=PATH], [Fully qualified pathname of askpass helper])],
2008-03-02 14:31:57 +00:00
[case $with_askpass in
2008-03-04 22:16:49 +00:00
yes) AC_MSG_ERROR(["--with-askpass takes a path as an argument."])
2008-03-02 14:31:57 +00:00
;;
no) ;;
2013-03-14 16:49:42 -04:00
*) ;;
esac], [
with_askpass=no
AC_MSG_RESULT(no)
])
if test X"$with_askpass" != X"no"; then
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_ASKPASS, "$with_askpass")
else
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_ASKPASS, NULL)
fi
2008-03-02 14:31:57 +00:00
2015-04-06 15:10:26 -06:00
AC_ARG_WITH(exampledir, [AS_HELP_STRING([--with-exampledir=DIR], [path to install sudo examples in])],
[case $with_exampledir in
yes) AC_MSG_ERROR(["must give --with-exampledir an argument."])
;;
no) AC_MSG_ERROR(["--without-exampledir not supported."])
;;
*) exampledir="$with_exampledir"
esac])
2014-02-01 05:57:34 -07:00
AC_ARG_WITH(plugindir, [AS_HELP_STRING([--with-plugindir=DIR], [set directory to load plugins from])],
2011-04-06 12:02:49 -04:00
[case $with_plugindir in
2019-07-03 13:13:04 -06:00
yes) AC_MSG_ERROR(["must give --with-plugindir an argument."])
2010-02-20 09:41:49 -05:00
;;
2019-07-03 13:13:04 -06:00
no) AC_MSG_ERROR(["--without-plugindir not supported."])
;;
2019-07-03 13:15:47 -06:00
*) plugindir="$with_plugindir"
2019-07-03 13:13:04 -06:00
;;
esac])
2010-02-20 09:41:49 -05:00
2012-07-19 13:41:14 -04:00
AC_ARG_WITH(man, [AS_HELP_STRING([--with-man], [manual pages use man macros])],
[case $with_man in
yes) MANTYPE=man
;;
no) AC_MSG_ERROR(["--without-man not supported."])
;;
*) AC_MSG_ERROR(["ignoring unknown argument to --with-man: $with_man."])
;;
esac])
AC_ARG_WITH(mdoc, [AS_HELP_STRING([--with-mdoc], [manual pages use mdoc macros])],
[case $with_mdoc in
yes) MANTYPE=mdoc
;;
no) AC_MSG_ERROR(["--without-mdoc not supported."])
;;
*) AC_MSG_ERROR(["ignoring unknown argument to --with-mdoc: $with_mdoc."])
;;
esac])
1998-10-15 03:31:26 +00:00
dnl
dnl Options for --enable
dnl
1999-08-12 14:37:27 +00:00
AC_MSG_CHECKING(whether to do user authentication by default)
AC_ARG_ENABLE(authentication,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-authentication], [Do not require authentication by default])],
1999-08-12 14:37:27 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
;;
no) AC_MSG_RESULT(no)
2004-09-08 15:49:26 +00:00
AC_DEFINE(NO_AUTHENTICATION)
1999-08-12 14:37:27 +00:00
;;
*) AC_MSG_RESULT(no)
2003-03-19 21:16:57 +00:00
AC_MSG_WARN([Ignoring unknown argument to --enable-authentication: $enableval])
1999-08-12 14:37:27 +00:00
;;
esac
], AC_MSG_RESULT(yes))
2002-01-16 21:26:13 +00:00
AC_MSG_CHECKING(whether to disable running the mailer as root)
AC_ARG_ENABLE(root-mailer,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-root-mailer], [Don't run the mailer as root, run as the user])],
2002-01-16 21:26:13 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(no)
;;
no) AC_MSG_RESULT(yes)
2004-09-08 15:49:26 +00:00
AC_DEFINE(NO_ROOT_MAILER)
2002-01-16 21:26:13 +00:00
;;
*) AC_MSG_RESULT(no)
2003-03-19 21:16:57 +00:00
AC_MSG_WARN([Ignoring unknown argument to --enable-root-mailer: $enableval])
2002-01-16 21:26:13 +00:00
;;
esac
], AC_MSG_RESULT(no))
2002-01-22 02:01:09 +00:00
AC_ARG_ENABLE(setreuid,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-setreuid], [Don't try to use the setreuid() function])],
2002-01-22 02:01:09 +00:00
[ case "$enableval" in
2002-11-22 19:07:04 +00:00
no) SKIP_SETREUID=yes
;;
*) ;;
esac
])
AC_ARG_ENABLE(setresuid,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-setresuid], [Don't try to use the setresuid() function])],
2002-11-22 19:07:04 +00:00
[ case "$enableval" in
no) SKIP_SETRESUID=yes
2002-01-22 02:01:09 +00:00
;;
*) ;;
esac
])
1998-10-15 03:31:26 +00:00
AC_MSG_CHECKING(whether to disable shadow password support)
1998-10-22 00:35:32 +00:00
AC_ARG_ENABLE(shadow,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-shadow], [Never use shadow passwords])],
1998-10-15 03:31:26 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(no)
;;
no) AC_MSG_RESULT(yes)
CHECKSHADOW="false"
;;
*) AC_MSG_RESULT(no)
2003-03-19 21:16:57 +00:00
AC_MSG_WARN([Ignoring unknown argument to --enable-shadow: $enableval])
1998-10-15 03:31:26 +00:00
;;
esac
], AC_MSG_RESULT(no))
1998-10-18 22:12:36 +00:00
AC_MSG_CHECKING(whether root should be allowed to use sudo)
1998-10-18 21:45:02 +00:00
AC_ARG_ENABLE(root-sudo,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-root-sudo], [Don't allow root to run sudo])],
2004-09-08 15:49:26 +00:00
[ case "$enableval" in
1998-10-18 21:45:02 +00:00
yes) AC_MSG_RESULT(yes)
;;
2004-09-08 15:49:26 +00:00
no) AC_DEFINE(NO_ROOT_SUDO)
1998-10-18 21:45:02 +00:00
AC_MSG_RESULT(no)
2004-02-01 20:20:30 +00:00
root_sudo=off
1998-10-18 21:45:02 +00:00
;;
1999-11-08 22:45:42 +00:00
*) AC_MSG_ERROR(["--enable-root-sudo does not take an argument."])
1998-10-18 21:45:02 +00:00
;;
esac
], AC_MSG_RESULT(yes))
1998-10-15 03:31:26 +00:00
AC_MSG_CHECKING(whether to log the hostname in the log file)
AC_ARG_ENABLE(log-host,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--enable-log-host], [Log the hostname in the log file])],
1998-10-15 03:31:26 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
2004-09-08 15:49:26 +00:00
AC_DEFINE(HOST_IN_LOG)
1998-10-15 03:31:26 +00:00
;;
no) AC_MSG_RESULT(no)
;;
*) AC_MSG_RESULT(no)
2003-03-19 21:16:57 +00:00
AC_MSG_WARN([Ignoring unknown argument to --enable-log-host: $enableval])
1998-10-15 03:31:26 +00:00
;;
esac
], AC_MSG_RESULT(no))
1998-10-15 06:24:42 +00:00
AC_MSG_CHECKING(whether to invoke a shell if sudo is given no arguments)
AC_ARG_ENABLE(noargs-shell,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--enable-noargs-shell], [If sudo is given no arguments run a shell])],
1998-10-15 06:24:42 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
2004-09-08 15:49:26 +00:00
AC_DEFINE(SHELL_IF_NO_ARGS)
1998-10-15 06:24:42 +00:00
;;
no) AC_MSG_RESULT(no)
;;
*) AC_MSG_RESULT(no)
2003-03-19 21:16:57 +00:00
AC_MSG_WARN([Ignoring unknown argument to --enable-noargs-shell: $enableval])
1998-10-15 06:24:42 +00:00
;;
esac
], AC_MSG_RESULT(no))
AC_MSG_CHECKING(whether to set \$HOME to target user in shell mode)
AC_ARG_ENABLE(shell-sets-home,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--enable-shell-sets-home], [Set $HOME to target user in shell mode])],
1998-10-15 06:24:42 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
2004-09-08 15:49:26 +00:00
AC_DEFINE(SHELL_SETS_HOME)
1998-10-15 06:24:42 +00:00
;;
no) AC_MSG_RESULT(no)
;;
*) AC_MSG_RESULT(no)
2003-03-19 21:16:57 +00:00
AC_MSG_WARN([Ignoring unknown argument to --enable-shell-sets-home: $enableval])
1998-10-15 06:24:42 +00:00
;;
esac
], AC_MSG_RESULT(no))
1998-11-08 20:56:52 +00:00
AC_MSG_CHECKING(whether to disable 'command not found' messages)
AC_ARG_ENABLE(path_info,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-path-info], [Print 'command not allowed' not 'command not found'])],
1998-11-08 20:56:52 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(no)
;;
no) AC_MSG_RESULT(yes)
2004-09-08 15:49:26 +00:00
AC_DEFINE(DONT_LEAK_PATH_INFO)
2007-07-22 22:43:28 +00:00
path_info=off
1998-11-08 20:56:52 +00:00
;;
*) AC_MSG_RESULT(no)
2003-03-19 21:16:57 +00:00
AC_MSG_WARN([Ignoring unknown argument to --enable-path-info: $enableval])
1998-11-08 20:56:52 +00:00
;;
esac
], AC_MSG_RESULT(no))
2009-03-08 20:57:01 +00:00
AC_MSG_CHECKING(whether to enable environment debugging)
AC_ARG_ENABLE(env_debug,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--enable-env-debug], [Whether to enable environment debugging.])],
2009-03-08 20:57:01 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
AC_DEFINE(ENV_DEBUG)
;;
no) AC_MSG_RESULT(no)
;;
*) AC_MSG_RESULT(no)
AC_MSG_WARN([Ignoring unknown argument to --enable-env-debug: $enableval])
;;
esac
], AC_MSG_RESULT(no))
2010-03-04 08:12:36 -05:00
AC_ARG_ENABLE(zlib,
[AS_HELP_STRING([--enable-zlib[[=PATH]]], [Whether to enable or disable zlib])],
2011-05-29 14:33:18 -04:00
[], [enable_zlib=yes])
2018-05-17 09:31:48 -06:00
AX_APPEND_FLAG([-DZLIB_CONST], [CPPFLAGS])
2009-09-25 20:39:09 +00:00
2011-01-28 16:52:25 -05:00
AC_MSG_CHECKING(whether to enable environment resetting by default)
AC_ARG_ENABLE(env_reset,
[AS_HELP_STRING([--enable-env-reset], [Whether to enable environment resetting by default.])],
[ case "$enableval" in
yes) env_reset=on
;;
no) env_reset=off
;;
*) env_reset=on
AC_MSG_WARN([Ignoring unknown argument to --enable-env-reset: $enableval])
;;
esac
])
if test "$env_reset" = "on"; then
AC_MSG_RESULT(yes)
2011-12-02 11:27:33 -05:00
AC_DEFINE(ENV_RESET, 1)
2011-01-28 16:52:25 -05:00
else
AC_MSG_RESULT(no)
2011-12-02 11:27:33 -05:00
AC_DEFINE(ENV_RESET, 0)
2011-01-28 16:52:25 -05:00
fi
2010-05-30 11:16:31 -04:00
AC_ARG_ENABLE(warnings,
[AS_HELP_STRING([--enable-warnings], [Whether to enable compiler warnings])],
[ case "$enableval" in
2011-08-29 14:49:10 -04:00
yes) ;;
2010-05-30 11:16:31 -04:00
no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-warnings: $enableval])
;;
esac
])
2011-08-23 10:15:28 -04:00
AC_ARG_ENABLE(werror,
[AS_HELP_STRING([--enable-werror], [Whether to enable the -Werror compiler option])],
[ case "$enableval" in
2011-08-29 14:49:10 -04:00
yes) ;;
2011-08-23 10:15:28 -04:00
no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-werror: $enableval])
;;
esac
])
2017-02-20 16:44:12 -07:00
AC_ARG_ENABLE(openssl,
2020-07-16 07:32:13 -06:00
[AS_HELP_STRING([--enable-openssl], [Use OpenSSL's TLS and sha2 functions])])
2017-02-20 16:44:12 -07:00
2017-02-20 16:44:12 -07:00
AC_ARG_ENABLE(gcrypt,
2020-07-16 07:32:13 -06:00
[AS_HELP_STRING([--enable-gcrypt], [Use GNU crypt's sha2 functions])], [
if test "${enable_openssl-no}" != no; then
AC_MSG_WARN([Ignoring --enable-gcrypt when OpenSSL is enabled.])
enable_gcrypt=no
fi
2017-02-20 16:44:12 -07:00
])
2021-02-18 13:58:09 -07:00
AC_ARG_ENABLE(ssp,
[AS_HELP_STRING([--disable-ssp], [Do not compile using the -fstack-protector option.])],
[], [enable_ssp=yes])
2012-05-22 13:23:19 -04:00
AC_ARG_ENABLE(hardening,
[AS_HELP_STRING([--disable-hardening], [Do not use compiler/linker exploit mitigation options])],
[], [enable_hardening=yes])
2012-07-02 10:12:41 -04:00
AC_ARG_ENABLE(pie,
2013-05-28 14:40:45 -04:00
[AS_HELP_STRING([--enable-pie], [Build sudo as a position independent executable.])])
2012-07-02 10:12:41 -04:00
2021-02-06 12:42:11 -07:00
AC_ARG_ENABLE(sanitizer,
[AS_HELP_STRING([--enable-sanitizer], [Build sudo with sanitizer support.])], [
if test X"$enable_sanitizer" = X"yes"; then
enable_sanitizer="-fsanitize=address,undefined"
fi
], [enable_sanitizer=no])
2016-01-27 15:37:25 -07:00
2021-02-06 13:28:39 -07:00
AC_ARG_ENABLE(fuzzer,
[AS_HELP_STRING([--enable-fuzzer], [Build sudo with LLVM libFuzzer support.])],
[], [enable_fuzzer=no])
2021-02-07 05:52:45 -07:00
AC_ARG_ENABLE(fuzzer-engine,
[AS_HELP_STRING([--enable-fuzzer-engine], [Link fuzz targets with the specified fuzzer engine instead of the default.])],
[ case "$enableval" in
yes) AC_MSG_ERROR(["must give --enable-fuzzer-engine an argument."])
;;
no) ;;
*) FUZZ_ENGINE="$enableval"
;;
esac
])
AC_ARG_ENABLE(fuzzer-linker,
[AS_HELP_STRING([--enable-fuzzer-linker], [Use the specified linker when building fuzz targets instead of the default C compiler.])],
[ case "$enableval" in
yes) AC_MSG_ERROR(["must give --enable-fuzzer-linker an argument."])
;;
no) ;;
*) FUZZ_LD="$enableval"
;;
esac
])
2021-01-30 06:01:48 -07:00
AC_ARG_ENABLE(leaks,
[AS_HELP_STRING([--disable-leaks], [Prevent some harmless memory leaks.])],
[ case "$enableval" in
yes) ;;
no) AC_DEFINE(NO_LEAKS)
;;
*) AC_MSG_WARN([Ignoring unknown argument to --disable-leaks: $enableval])
;;
esac
])
2013-10-12 05:53:43 -06:00
AC_ARG_ENABLE(poll,
[AS_HELP_STRING([--disable-poll], [Use select() instead of poll().])])
2010-07-28 16:34:11 -04:00
AC_ARG_ENABLE(admin-flag,
2021-02-16 13:20:02 -07:00
[AS_HELP_STRING([--enable-admin-flag[[=PATH]]], [Whether to create a Ubuntu-style admin flag file])],
2010-07-28 16:34:11 -04:00
[ case "$enableval" in
2021-02-16 13:20:02 -07:00
yes) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_ADMIN_FLAG, "~/.sudo_as_admin_successful")
2010-07-28 16:34:11 -04:00
;;
no) ;;
2021-02-16 13:20:02 -07:00
*) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_ADMIN_FLAG, "$enableval")
2010-07-28 16:34:11 -04:00
;;
esac
])
2011-05-09 10:58:52 -04:00
AC_ARG_ENABLE(nls,
[AS_HELP_STRING([--disable-nls], [Disable natural language support using gettext])],
2011-05-29 14:33:18 -04:00
[], [enable_nls=yes])
2011-05-09 10:58:52 -04:00
2013-03-18 09:27:07 -04:00
AC_ARG_ENABLE(rpath,
[AS_HELP_STRING([--disable-rpath], [Disable passing of -Rpath to the linker])],
[], [enable_rpath=yes])
2013-11-22 16:35:15 -07:00
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])
2014-08-08 11:03:24 -06:00
AC_ARG_ENABLE(shared_libutil,
[AS_HELP_STRING([--disable-shared-libutil], [Disable use of the libsudo_util shared library.])],
[], [enable_shared_libutil=yes])
2015-04-07 15:35:01 -06:00
AC_ARG_ENABLE(tmpfiles.d,
[AS_HELP_STRING([--enable-tmpfiles.d=DIR], [Set the path to the systemd tmpfiles.d directory.])],
[case $enableval in
yes) TMPFILES_D=/usr/lib/tmpfiles.d
;;
no) TMPFILES_D=
;;
*) TMPFILES_D="$enableval"
esac], [
test -f /usr/lib/tmpfiles.d/systemd.conf && TMPFILES_D=/usr/lib/tmpfiles.d
])
2017-05-30 10:44:11 -06:00
AC_ARG_ENABLE(devsearch,
2020-05-07 07:49:54 -06:00
[AS_HELP_STRING([--enable-devsearch=PATH], [The colon-delimited path to search for device nodes when determining the tty name.])],
2017-05-30 10:44:11 -06:00
[case $enableval in
yes) # use default value
;;
no) AC_MSG_WARN([Ignoring attempt to disable the device search path])
;;
*) devsearch="$enableval"
2017-06-29 18:10:53 -06:00
;;
2017-05-30 10:44:11 -06:00
esac])
2017-06-29 18:10:53 -06:00
ds="`echo \"$devsearch\"|sed 's@/dev/*\([[^:]]*:*\)@_PATH_DEV \"\1\" @g'`"
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_DEVSEARCH, $ds)
2017-05-30 10:44:11 -06:00
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux], [enable SELinux support])],
2008-02-09 14:30:06 +00:00
[case $with_selinux in
yes) SELINUX_USAGE="[[-r role]] [[-t type]] "
AC_DEFINE(HAVE_SELINUX)
SUDO_LIBS="${SUDO_LIBS} -lselinux"
SUDO_OBJS="${SUDO_OBJS} selinux.o"
PROGS="${PROGS} sesh"
2010-05-25 16:13:04 -04:00
SEMAN=1
2010-06-24 15:31:05 -04:00
AC_CHECK_LIB([selinux], [setkeycreatecon],
[AC_DEFINE(HAVE_SETKEYCREATECON)])
2008-02-09 14:30:06 +00:00
;;
no) ;;
*) AC_MSG_ERROR(["--with-selinux does not take an argument."])
;;
2013-03-14 16:49:42 -04:00
esac], [with_selinux=no])
2008-02-09 14:30:06 +00:00
2017-07-28 13:52:55 -06:00
AC_ARG_ENABLE(sasl,
[AS_HELP_STRING([--enable-sasl], [Enable/disable LDAP SASL support])],
[ case "$enableval" in
yes|no) ;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-sasl: $enableval])
;;
esac
])
2017-08-01 16:14:54 -06:00
AC_ARG_ENABLE(timestamp-type,
[AS_HELP_STRING([--timestamp-type=TYPE], [Set the default time stamp record type to global, ppid or tty.])],
[ case "$enableval" in
global|ppid|tty)
timestamp_type=$enableval
;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-timestamp-type: $enableval])
;;
esac
])
AC_DEFINE_UNQUOTED(TIMESTAMP_TYPE, $timestamp_type)
2017-09-18 10:45:02 -06:00
AC_ARG_ENABLE(offensive_insults,
[AS_HELP_STRING([--enable-offensive-insults], [Enable potentially offensive sudo insults.])],
[], [enable_offensive_insults=no])
if test "$enable_offensive_insults" = "yes"; then
AC_DEFINE(OFFENSIVE_INSULTS)
fi
2018-08-22 08:09:46 -06:00
AC_ARG_ENABLE(package_build,
[AS_HELP_STRING([--enable-package-build], [Enable options for package building.])],
[], [enable_package_build=no])
2008-02-27 14:26:28 +00:00
dnl
dnl gss_krb5_ccache_name() may not work on Heimdal so we don't use it by default
dnl
2009-06-13 20:52:50 +00:00
AC_ARG_ENABLE(gss_krb5_ccache_name,
[AS_HELP_STRING([--enable-gss-krb5-ccache-name], [Use GSS-API to set the Kerberos V cred cache name])],
[check_gss_krb5_ccache_name=$enableval], [check_gss_krb5_ccache_name=no])
2008-02-27 14:26:28 +00:00
2018-10-21 08:46:09 -06:00
AC_ARG_ENABLE(pvs-studio,
[AS_HELP_STRING([--enable-pvs-studio], [Create a PVS-Studio.cfg file.])])
2020-02-26 13:17:40 -07:00
AC_ARG_ENABLE(log-server,
[AS_HELP_STRING([--disable-log-server], [Disable building the sudo_logsrvd log server.])],
[ case "$enableval" in
yes)
;;
no)
2020-09-03 06:44:43 -06:00
LOGSRV=#
2020-09-03 06:03:28 -06:00
LOGSRVD_SRC=
2020-04-08 08:54:27 -06:00
LOGSRVD_CONF=
2020-02-26 13:17:40 -07:00
;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-log-server: $enableval])
;;
esac
])
AC_ARG_ENABLE(log-client,
[AS_HELP_STRING([--disable-log-client], [Disable sudoers support for using the sudo_logsrvd log server.])],
[ case "$enableval" in
yes)
2020-11-09 17:13:04 -07:00
AC_DEFINE([SUDOERS_LOG_CLIENT])
2020-02-26 13:17:40 -07:00
;;
no)
;;
*) AC_MSG_WARN([Ignoring unknown argument to --enable-log-client: $enableval])
;;
esac
2020-11-09 17:13:04 -07:00
], [AC_DEFINE([SUDOERS_LOG_CLIENT])])
2020-02-26 13:17:40 -07:00
if test X"$enable_log_server" = X"no" -a X"$enable_log_client" = X"no"; then
# No need for liblogsrv.la
2020-09-03 06:03:28 -06:00
LOGSRV_SRC=
2020-02-26 13:17:40 -07:00
LIBLOGSRV=
fi
2020-09-03 06:03:28 -06:00
if test X"$LOGSRVD_SRC" != X""; then
2020-04-07 14:03:58 -06:00
PPFILES="$PPFILES "'$(srcdir)/etc/sudo-logsrvd.pp'
fi
2020-02-26 13:17:40 -07:00
1995-03-30 02:12:19 +00:00
dnl
1994-03-09 23:51:22 +00:00
dnl C compiler checks
dnl
AC_PROG_CPP
2009-09-26 15:34:46 +00:00
AC_CHECK_TOOL(AR, ar, false)
AC_CHECK_TOOL(RANLIB, ranlib, :)
2010-11-16 10:03:18 -05:00
if test X"$AR" = X"false"; then
AC_MSG_ERROR([the "ar" utility is required to build sudo])
fi
1995-06-18 17:58:42 +00:00
2010-02-27 10:04:39 -05:00
if test "x$ac_cv_prog_cc_c89" = "xno"; then
AC_MSG_ERROR([Sudo version $PACKAGE_VERSION requires an ANSI C compiler to build.])
fi
2011-10-12 08:24:13 -04:00
dnl
dnl If the user specified --disable-static, override them or we'll
dnl be unable to build the executables in the sudoers plugin dir.
dnl
if test "$enable_static" = "no"; then
AC_MSG_WARN([Ignoring --disable-static, sudo does not install static libs])
enable_static=yes
fi
2004-01-05 20:03:09 +00:00
dnl
2014-07-13 20:14:02 -06:00
dnl Set host variables and m4 macro dir
2004-01-05 20:03:09 +00:00
dnl
AC_CANONICAL_HOST
2010-05-21 17:59:47 -04:00
AC_CONFIG_MACRO_DIR([m4])
2014-07-13 20:14:02 -06:00
dnl
dnl On AIX we need to force libtool to install .so files for the plugins
dnl instead of a .a file that contains the .so. We do this by enabling
dnl runtime linking (where the .so file is installed). This must happen
dnl before the call to LT_INIT
dnl
case "$host_os" in
aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-Wl,-brtl], [LDFLAGS])
2014-07-13 20:14:02 -06:00
;;
esac
2020-09-05 15:38:33 -06:00
dnl
dnl On HP-UX 11.11 and higher (and hiuxmpp) we prefer dlopen()
dnl over shl_load(). Libtool defaults to shl_load() so we need
dnl to prime the cache to override that default.
dnl
case "$host_os" in
hiuxmpp*|hpux11.1[[1-9]]|hpux11.[[2-9]][[0-9]]|hpux1[[2-9]].*)
# Prefer dlopen() over shl_load()
: ${ac_cv_func_shl_load='no'}
: ${ac_cv_lib_dld_shl_load='no'}
;;
esac
2014-07-13 20:14:02 -06:00
dnl
dnl Libtool init, we require libtool 2.2.6b or higher
dnl
2010-05-21 17:59:47 -04:00
LT_PREREQ([2.2.6b])
LT_INIT([dlopen])
2004-01-05 20:03:09 +00:00
2012-10-28 12:58:48 -04:00
dnl
dnl Allow the user to specify an alternate libtool.
dnl XXX - should be able to skip LT_INIT if we are using a different libtool
dnl
AC_ARG_WITH(libtool, [AS_HELP_STRING([--with-libtool=PATH], [specify path to libtool])],
[case $with_libtool in
yes|builtin) ;;
no) AC_MSG_ERROR(["--without-libtool not supported."])
;;
system) LIBTOOL=libtool
;;
*) LIBTOOL="$with_libtool"
;;
esac])
2004-01-09 06:15:34 +00:00
dnl
dnl Defer with_noexec until after libtool magic runs
dnl
2004-01-09 07:58:04 +00:00
if test "$enable_shared" = "no"; then
with_noexec=no
2011-03-10 10:57:56 -05:00
enable_dlopen=no
lt_cv_dlopen=none
lt_cv_dlopen_libs=
2011-11-13 21:24:02 -05:00
ac_cv_func_dlopen=no
2013-03-18 10:15:48 -04:00
LT_LDFLAGS=-static
2004-01-09 07:58:04 +00:00
fi
2013-11-26 07:15:55 -07:00
LIBDL="$lt_cv_dlopen_libs"
2014-07-08 20:19:09 -06:00
SHLIB_ENABLE="$enable_dlopen"
2013-11-26 07:15:55 -07:00
2004-01-09 06:15:34 +00:00
AC_MSG_CHECKING(path to sudo_noexec.so)
2015-12-16 14:57:37 -07:00
AC_ARG_WITH(noexec, [AS_HELP_STRING([--with-noexec[[=PATH]]], [fully qualified pathname of sudo_noexec.so])],
2004-09-08 15:49:26 +00:00
[case $with_noexec in
2019-07-03 13:13:04 -06:00
yes) ;;
2004-01-09 06:15:34 +00:00
no) ;;
2019-07-03 13:13:04 -06:00
*) noexec_file="$with_noexec"
;;
esac], [with_noexec="$noexec_file"])
2004-01-09 06:15:34 +00:00
AC_MSG_RESULT($with_noexec)
2013-03-06 17:08:10 -05:00
NOEXECFILE="sudo_noexec.so"
2019-07-03 13:13:04 -06:00
NOEXECDIR="`echo $noexec_file|sed -e 's:^${\([[^}]]*\)}:$(\1):' -e 's:^\(.*\)/[[^/]]*:\1:'`"
2004-01-09 06:15:34 +00:00
1999-08-14 15:34:55 +00:00
dnl
dnl Find programs we use
1994-05-24 16:50:57 +00:00
dnl
2012-08-15 10:32:25 -04:00
AC_PATH_PROG(UNAMEPROG, [uname], [uname])
AC_PATH_PROG(TRPROG, [tr], [tr])
AC_PATH_PROG(MANDOCPROG, [mandoc], [mandoc])
if test "$MANDOCPROG" != "mandoc"; then
: ${MANTYPE='mdoc'}
2011-05-19 18:00:31 -04:00
else
2012-08-15 10:32:25 -04:00
AC_PATH_PROG(NROFFPROG, [nroff])
if test -n "$NROFFPROG"; then
test -n "$MANTYPE" && sudo_cv_var_mantype="$MANTYPE"
AC_CACHE_CHECK([which macro set to use for manual pages],
[sudo_cv_var_mantype],
[
sudo_cv_var_mantype="man"
echo ".Sh NAME" > conftest
echo ".Nm sudo" >> conftest
echo ".Nd sudo" >> conftest
echo ".Sh DESCRIPTION" >> conftest
echo "sudo" >> conftest
if $NROFFPROG -mdoc conftest >/dev/null 2>&1; then
sudo_cv_var_mantype="mdoc"
fi
rm -f conftest
]
)
MANTYPE="$sudo_cv_var_mantype"
2019-09-19 11:16:45 -06:00
else
: ${MANTYPE='mdoc'}
2012-08-15 10:32:25 -04:00
fi
1994-08-05 21:48:56 +00:00
fi
1995-06-18 17:58:42 +00:00
1994-05-24 16:50:57 +00:00
dnl
1996-07-24 05:59:28 +00:00
dnl What kind of beastie are we being run on?
dnl Barf if config.cache was generated on another host.
1994-03-09 23:51:22 +00:00
dnl
1996-07-26 03:45:27 +00:00
if test -n "$sudo_cv_prev_host"; then
if test "$sudo_cv_prev_host" != "$host"; then
2003-03-19 21:16:57 +00:00
AC_MSG_ERROR([config.cache was created on a different host; remove it and re-run configure.])
1996-07-26 03:45:27 +00:00
else
AC_MSG_CHECKING(previous host type)
AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
2003-03-19 21:16:57 +00:00
AC_MSG_RESULT([$sudo_cv_prev_host])
1996-07-26 03:45:27 +00:00
fi
else
# this will produce no output since there is no cached value
AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
1996-07-24 17:02:18 +00:00
fi
1996-07-24 05:59:28 +00:00
dnl
dnl We want to be able to differentiate between different rev's
dnl
if test -n "$host_os"; then
OS=`echo $host_os | sed 's/[[0-9]].*//'`
2005-01-21 15:29:05 +00:00
OSREV=`echo $host_os | sed 's/^[[^0-9\.]]*\([[0-9\.]]*\).*$/\1/'`
OSMAJOR=`echo $OSREV | sed 's/\..*$//'`
1996-07-24 05:59:28 +00:00
else
OS="unknown"
OSREV=0
2005-01-21 15:29:05 +00:00
OSMAJOR=0
1996-07-24 05:59:28 +00:00
fi
case "$host" in
*-*-solaris2*)
2016-03-09 09:39:46 -07:00
AC_DEFINE([PAM_SUN_CODEBASE])
2012-02-21 13:26:02 -05:00
# LD_PRELOAD is space-delimited
RTLD_PRELOAD_DELIM=" "
2021-02-09 08:59:11 -07:00
# illumos has a broken fmemopen(3)
if test X"`uname -o 2>/dev/null`" = X"illumos"; then
: ${ac_cv_func_fmemopen='no'}
fi
2012-11-11 07:11:22 -05:00
# Solaris-specific initialization
OS_INIT=os_init_solaris
SUDO_OBJS="${SUDO_OBJS} solaris.o"
1996-07-08 20:08:33 +00:00
# AFS support needs -lucb
if test "$with_AFS" = "yes"; then
AFS_LIBS="-lc -lucb"
fi
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
2007-09-05 22:16:22 +00:00
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([priv_set], [PSMAN=1])
1994-05-28 23:36:22 +00:00
;;
1996-07-24 05:59:28 +00:00
*-*-aix*)
2016-03-09 09:39:46 -07:00
AC_DEFINE([PAM_SUN_CODEBASE])
1999-08-28 09:36:32 +00:00
# To get all prototypes (so we pass -Wall)
2015-06-18 09:33:05 -06:00
AC_DEFINE([_LINUX_SOURCE_COMPAT])
2005-01-21 15:29:05 +00:00
2015-02-23 11:12:43 -07:00
# For AIX we build in support for both LAM and PAM
# and choose which to use based on auth_type in
# /etc/security/login.cfg
if test X"${with_pam}${with_aixauth}" = X""; then
AUTH_EXCL_DEF="AIX_AUTH PAM"
2011-09-16 13:05:21 -04:00
fi
2008-03-06 17:19:57 +00:00
2009-03-10 20:44:05 +00:00
# AIX analog of nsswitch.conf, enabled by default
2009-06-13 20:52:50 +00:00
AC_ARG_WITH(netsvc, [AS_HELP_STRING([--with-netsvc[[=PATH]]], [path to netsvc.conf])],
2009-03-10 20:44:05 +00:00
[case $with_netsvc in
no) ;;
yes) with_netsvc="/etc/netsvc.conf"
;;
*) ;;
esac])
if test -z "$with_nsswitch" -a -z "$with_netsvc"; then
with_netsvc="/etc/netsvc.conf"
fi
2011-09-16 13:05:21 -04:00
# LDR_PRELOAD is only supported in AIX 5.3 and later
2016-11-14 11:00:43 -07:00
case "$OSREV" in
[[1-4]].*) with_noexec=no;;
5.[[1-2]]*) with_noexec=no;;
*) RTLD_PRELOAD_VAR="LDR_PRELOAD";;
esac
2011-07-05 11:42:39 -04:00
2020-05-12 09:52:27 -06:00
# cfmakeraw is broken on AIX (and is not documented)
: ${ac_cv_func_cfmakeraw='no'}
2017-01-05 06:22:58 -07:00
# strnlen/strndup may be broken on AIX < 6 depending
# on the libc version, use our own.
if test $OSMAJOR -lt 6; then
ac_cv_func_strnlen=no
fi
2019-04-08 10:37:30 -06:00
# getdelim() may or may not be present on AIX <= 6.1.
# bos610 is missing getdelim but bos61J has it.
2018-08-22 08:09:46 -06:00
if test "$enable_package_build" = "yes"; then
if test $OSMAJOR -le 6; then
2019-04-08 10:37:30 -06:00
ac_cv_func_getdelim=no
2018-08-22 08:09:46 -06:00
fi
2018-05-15 09:53:46 -06:00
fi
# memset_s() may or may ont be present on AIX <= 7.1.
# bos710 is missing memset_s but bos71L has it.
2018-08-22 08:09:46 -06:00
if test "$enable_package_build" = "yes"; then
if test $OSMAJOR -le 7; then
ac_cv_func_memset_s=no
fi
2018-05-15 09:53:46 -06:00
fi
2014-02-16 10:22:43 -07:00
# Remove timedir on boot, AIX does not have /var/run
INIT_SCRIPT=aix.sh
INIT_DIR=/etc/rc.d/init.d
RC_LINK=/etc/rc.d/rc2.d/S90sudo
2008-03-06 17:19:57 +00:00
# AIX-specific functions
2016-01-22 17:04:58 -07:00
AC_CHECK_FUNCS([getuserattr setrlimit64])
AC_CHECK_FUNCS([setauthdb],
[AC_CHECK_TYPES([authdb_t], [], [], [#include <usersec.h>])])
2013-10-12 05:53:43 -06:00
COMMON_OBJS="${COMMON_OBJS} aix.lo"
2016-02-01 11:08:58 -07:00
SUDO_APPEND_COMPAT_EXP(aix_prep_user_v1 aix_restoreauthdb_v1 aix_setauthdb_v1 aix_setauthdb_v2 aix_getauthregistry_v1)
2015-02-03 07:33:25 -07:00
# These prototypes may be missing
AC_CHECK_DECLS([usrinfo], [], [], [
#include <sys/types.h>
#include <uinfo.h>
])
AC_CHECK_DECLS([setauthdb], [], [], [
#include <sys/types.h>
#include <usersec.h>
])
1994-05-28 23:36:22 +00:00
;;
1998-09-07 16:41:48 +00:00
*-*-hiuxmpp*)
2016-03-09 09:39:46 -07:00
AC_DEFINE([PAM_SUN_CODEBASE])
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
2012-06-11 10:45:34 -04:00
2014-02-16 11:00:41 -07:00
# HP-UX does not clear /var/run so we need to do it
INIT_SCRIPT=hpux.sh
2014-02-16 14:49:15 -07:00
INIT_DIR=/sbin/init.d
2014-02-16 11:00:41 -07:00
RC_LINK=/sbin/rc2.d/S900sudo
2014-07-08 10:03:47 -06:00
# HP-UX shared libs must be executable.
# Load time is much greater if writable so use 0555.
SHLIB_MODE=0555
2014-02-16 11:00:41 -07:00
2016-07-08 12:37:41 -06:00
# HP-UX won't unlink a shared lib that is open
INSTALL_BACKUP='~'
2018-08-20 10:56:34 -06:00
AC_CHECK_FUNCS([pstat_getproc gethrtime])
1998-09-07 16:41:48 +00:00
;;
1996-07-24 05:59:28 +00:00
*-*-hpux*)
2016-03-09 09:39:46 -07:00
AC_DEFINE([PAM_SUN_CODEBASE])
1996-07-24 05:59:28 +00:00
# AFS support needs -lBSD
if test "$with_AFS" = "yes"; then
AFS_LIBS="-lc -lBSD"
fi
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
2004-01-09 08:29:33 +00:00
2014-02-16 10:22:43 -07:00
# HP-UX does not clear /var/run so we need to do it
INIT_SCRIPT=hpux.sh
2014-02-16 14:49:15 -07:00
INIT_DIR=/sbin/init.d
2014-02-16 10:22:43 -07:00
RC_LINK=/sbin/rc2.d/S900sudo
2014-07-08 10:03:47 -06:00
# HP-UX shared libs must be executable.
# Load time is much greater if writable so use 0555.
SHLIB_MODE=0555
2012-06-11 10:45:34 -04:00
2016-07-08 12:37:41 -06:00
# HP-UX won't unlink a shared lib that is open
INSTALL_BACKUP='~'
2011-05-19 17:34:38 -04:00
# The HP bundled compiler cannot generate shared libs
if test -z "$GCC"; then
AC_CACHE_CHECK([for HP bundled C compiler],
[sudo_cv_var_hpccbundled],
[if $CC -V 2>&1 | grep '^(Bundled)' >/dev/null 2>&1; then
sudo_cv_var_hpccbundled=yes
else
sudo_cv_var_hpccbundled=no
fi]
)
if test "$sudo_cv_var_hpccbundled" = "yes"; then
AC_MSG_ERROR([The HP bundled C compiler is unable to build Sudo, you must use gcc or the HP ANSI C compiler instead.])
fi
fi
2011-05-09 10:02:16 -04:00
# Build PA-RISC1.1 objects for better portability
case "$host_cpu" in
2011-09-16 13:05:21 -04:00
hppa[[2-9]]*)
2010-07-28 16:27:45 -04:00
_CFLAGS="$CFLAGS"
2011-05-09 10:02:16 -04:00
if test -n "$GCC"; then
portable_flag="-march=1.1"
else
portable_flag="+DAportable"
fi
CFLAGS="$CFLAGS $portable_flag"
AC_CACHE_CHECK([whether $CC understands $portable_flag],
2010-07-28 16:27:45 -04:00
[sudo_cv_var_daportable],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[sudo_cv_var_daportable=yes],
[sudo_cv_var_daportable=no]
)
]
2010-05-21 15:53:39 -04:00
)
2010-07-28 16:27:45 -04:00
if test X"$sudo_cv_var_daportable" != X"yes"; then
CFLAGS="$_CFLAGS"
fi
;;
2011-05-09 10:02:16 -04:00
esac
2009-05-27 00:49:07 +00:00
2013-03-19 15:59:23 -04:00
case "$host_os" in
hpux10.*)
2005-03-19 03:07:27 +00:00
shadow_funcs="getprpwnam iscomsec"
shadow_libs="-lsec"
2016-11-14 16:42:16 -07:00
# HP-UX 10.x doesn't support LD_PRELOAD
with_noexec=no
2004-01-09 08:29:33 +00:00
;;
*)
2005-03-19 03:07:27 +00:00
shadow_funcs="getspnam iscomsec"
shadow_libs="-lsec"
2007-09-05 22:16:22 +00:00
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
2004-01-09 08:29:33 +00:00
;;
esac
2018-08-20 10:56:34 -06:00
AC_CHECK_FUNCS([pstat_getproc gethrtime])
1996-07-24 05:59:28 +00:00
;;
*-dec-osf*)
# ignore envariables wrt dynamic lib path
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-Wl,-no_library_replacement], [SUDO_LDFLAGS])
1996-07-24 05:59:28 +00:00
2007-09-06 11:17:43 +00:00
: ${CHECKSIA='true'}
1998-10-25 04:48:50 +00:00
AC_MSG_CHECKING(whether to disable sia support on Digital UNIX)
AC_ARG_ENABLE(sia,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-sia], [Disable SIA on Digital UNIX])],
1998-10-25 04:48:50 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(no)
2007-09-06 11:17:43 +00:00
CHECKSIA=true
1998-10-25 04:48:50 +00:00
;;
no) AC_MSG_RESULT(yes)
CHECKSIA=false
;;
*) AC_MSG_RESULT(no)
2003-03-19 21:16:57 +00:00
AC_MSG_WARN([Ignoring unknown argument to --enable-sia: $enableval])
1998-10-25 04:48:50 +00:00
;;
esac
], AC_MSG_RESULT(no))
2005-03-19 03:07:27 +00:00
shadow_funcs="getprpwnam dispcrypt"
# OSF/1 4.x and higher need -ldb too
if test $OSMAJOR -lt 4; then
shadow_libs="-lsecurity -laud -lm"
else
shadow_libs="-lsecurity -ldb -laud -lm"
fi
# use SIA by default, if we have it
2007-09-05 22:16:22 +00:00
test "$CHECKSIA" = "true" && AUTH_EXCL_DEF="SIA"
#
# Some versions of Digital Unix ship with a broken
# copy of prot.h, which we need for shadow passwords.
# XXX - make should remove this as part of distclean
#
AC_MSG_CHECKING([for broken prot.h])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1998-10-19 20:30:05 +00:00
#include <sys/types.h>
#include <sys/security.h>
#include <prot.h>
2020-06-20 13:51:02 -06:00
]], [[return(0);]])], [AC_MSG_RESULT(no)], [AC_MSG_RESULT([yes, fixing locally])
2007-09-05 22:16:22 +00:00
sed 's:<acl.h>:<sys/acl.h>:g' < /usr/include/prot.h > prot.h
])
2012-02-21 13:26:02 -05:00
# ":DEFAULT" must be appended to _RLD_LIST
RTLD_PRELOAD_VAR="_RLD_LIST"
RTLD_PRELOAD_DEFAULT="DEFAULT"
2005-01-14 18:35:06 +00:00
: ${mansectsu='8'}
: ${mansectform='4'}
1994-05-28 23:36:22 +00:00
;;
1996-07-24 05:59:28 +00:00
*-*-irix*)
2015-06-18 09:33:05 -06:00
AC_DEFINE([_BSD_TYPES])
2019-06-20 13:15:46 -06:00
if test "$prefix" = "/usr/local" -a "$mandir" = '${datarootdir}/man'; then
if test -d "/usr/share/man/local"; then
mandir="/usr/share/man/local"
else
mandir="/usr/man/local"
1994-08-05 23:43:56 +00:00
fi
1994-08-05 21:48:56 +00:00
fi
1999-02-22 20:10:51 +00:00
# IRIX <= 4 needs -lsun
2005-01-21 15:29:05 +00:00
if test "$OSMAJOR" -le 4; then
1999-08-26 13:16:06 +00:00
AC_CHECK_LIB(sun, getpwnam, [LIBS="${LIBS} -lsun"])
1999-02-22 20:10:51 +00:00
fi
2012-02-21 13:26:02 -05:00
# ":DEFAULT" must be appended to _RLD_LIST
RTLD_PRELOAD_VAR="_RLD_LIST"
RTLD_PRELOAD_DEFAULT="DEFAULT"
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
1994-05-28 23:36:22 +00:00
;;
2008-02-15 20:23:54 +00:00
*-*-linux*|*-*-k*bsd*-gnu)
2005-03-19 03:07:27 +00:00
shadow_funcs="getspnam"
2007-09-05 22:16:22 +00:00
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
2016-10-09 11:24:29 -06:00
# Check for SECCOMP_SET_MODE_FILTER in linux/seccomp.h
AC_CHECK_DECLS([SECCOMP_SET_MODE_FILTER], [], [], [
#include <sys/types.h>
#include <sys/prctl.h>
#include <asm/unistd.h>
#include <linux/seccomp.h>
#include <linux/filter.h>
])
2018-08-22 15:12:11 -06:00
# We call getrandom via syscall(3) in case it is not in libc
AC_CHECK_HEADERS([linux/random.h])
1994-05-28 23:36:22 +00:00
;;
2014-05-09 10:03:17 -06:00
*-*-gnu*)
2015-09-07 06:06:08 -06:00
# lockf() is broken on the Hurd
2014-05-09 10:03:17 -06:00
ac_cv_func_lockf=no
;;
1996-07-24 05:59:28 +00:00
*-*-riscos*)
LIBS="${LIBS} -lsun -lbsd"
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I/usr/include], [CPPFLAGS])
AX_APPEND_FLAG([-I/usr/include/bsd], [CPPFLAGS])
AX_APPEND_FLAG([-D_MIPS], [CPPFLAGS])
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
1996-07-18 22:27:10 +00:00
;;
1996-07-24 05:59:28 +00:00
*-*-isc*)
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-D_ISC], [CPPFLAGS])
2020-09-18 08:18:07 -06:00
ac_cv_search_crypt="-lcrypt"
1996-07-18 22:27:10 +00:00
2005-03-19 03:07:27 +00:00
shadow_funcs="getspnam"
shadow_libs="-lsec"
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
1995-04-13 17:19:40 +00:00
;;
2001-10-05 20:39:05 +00:00
*-*-sco*|*-sco-*)
2005-03-19 03:07:27 +00:00
shadow_funcs="getprpwnam"
shadow_libs="-lprot -lx"
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
1995-07-19 21:29:58 +00:00
;;
2002-01-07 18:59:47 +00:00
m88k-motorola-sysv*)
# motorolla's cc (a variant of gcc) does -O but not -O2
CFLAGS=`echo $CFLAGS | sed 's/-O2/-O/g'`
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
2002-01-07 18:59:47 +00:00
;;
1996-10-08 23:22:09 +00:00
*-sequent-sysv*)
2005-03-19 03:07:27 +00:00
shadow_funcs="getspnam"
shadow_libs="-lsec"
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
1996-10-08 23:22:09 +00:00
;;
2000-11-02 17:46:29 +00:00
*-ncr-sysv4*|*-ncr-sysvr4*)
2010-08-10 13:44:05 -04:00
AC_CHECK_LIB(c89, strcasecmp, [LIBS="${LIBS} -lc89"])
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
2000-11-02 17:46:29 +00:00
;;
*-ccur-sysv4*|*-ccur-sysvr4*)
1998-10-18 23:42:52 +00:00
LIBS="${LIBS} -lgen"
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
1998-03-31 04:54:50 +00:00
;;
1996-07-24 05:59:28 +00:00
*-*-bsdi*)
2002-11-22 19:07:04 +00:00
SKIP_SETREUID=yes
2011-09-08 09:36:24 -04:00
# Check for newer BSD auth API
2007-09-05 22:16:22 +00:00
if test -z "$with_bsdauth"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([auth_challenge], [AUTH_EXCL_DEF="BSD_AUTH"])
2005-01-21 15:29:05 +00:00
fi
1994-05-28 23:36:22 +00:00
;;
2000-03-07 04:29:46 +00:00
*-*-freebsd*)
2015-06-18 09:33:05 -06:00
AC_DEFINE([_BSD_SOURCE])
2002-01-18 19:18:39 +00:00
# FreeBSD has a real setreuid(2) starting with 2.1 and
# backported to 2.0.5. We just take 2.1 and above...
2005-01-21 15:29:05 +00:00
case "$OSREV" in
2002-01-18 19:18:39 +00:00
0.*|1.*|2.0*)
2002-11-22 19:07:04 +00:00
SKIP_SETREUID=yes
2002-01-18 19:18:39 +00:00
;;
esac
2011-04-06 09:33:07 -04:00
if test "${with_skey-'no'}" = "yes"; then
2011-03-04 08:26:48 -05:00
SUDOERS_LIBS="${SUDOERS_LIBS} -lmd"
2000-03-07 04:29:46 +00:00
fi
2007-09-02 20:25:53 +00:00
CHECKSHADOW="false"
2007-09-05 22:16:22 +00:00
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
2005-01-21 15:29:05 +00:00
: ${with_logincap='maybe'}
2015-04-06 15:10:26 -06:00
# Examples go in share/examples/sudo
if test X"$with_exampledir" = X""; then
exampledir='$(datarootdir)/examples/$(PACKAGE_TARNAME)'
fi
2000-03-07 04:29:46 +00:00
;;
2000-12-30 03:29:47 +00:00
*-*-*openbsd*)
2015-06-18 09:33:05 -06:00
AC_DEFINE([_BSD_SOURCE])
2012-11-11 07:11:22 -05:00
# OpenBSD-specific initialization
OS_INIT=os_init_openbsd
SUDO_OBJS="${SUDO_OBJS} openbsd.o"
2005-01-21 15:29:05 +00:00
# OpenBSD has a real setreuid(2) starting with 3.3 but
2011-09-21 09:46:52 -04:00
# we will use setresuid(2) instead.
2002-11-22 19:07:04 +00:00
SKIP_SETREUID=yes
2016-11-17 17:55:44 -07:00
2005-01-21 15:29:05 +00:00
# OpenBSD >= 3.0 supports BSD auth
2007-09-05 22:16:22 +00:00
if test -z "$with_bsdauth"; then
2011-09-16 13:05:21 -04:00
if test "$OSMAJOR" -ge 3; then
2007-09-05 22:16:22 +00:00
AUTH_EXCL_DEF="BSD_AUTH"
2011-09-16 13:05:21 -04:00
fi
2005-01-21 15:29:05 +00:00
fi
: ${with_logincap='maybe'}
2015-04-06 15:10:26 -06:00
2016-11-17 17:55:44 -07:00
# Newer OpenBSD only fills in pw_password for getpwnam_shadow()
shadow_funcs="getpwnam_shadow"
2015-04-06 15:10:26 -06:00
# Examples go in share/examples/sudo
if test X"$with_exampledir" = X""; then
exampledir='$(datarootdir)/examples/$(PACKAGE_TARNAME)'
fi
2000-12-30 03:29:47 +00:00
;;
*-*-*netbsd*)
2002-01-18 19:18:39 +00:00
# NetBSD has a real setreuid(2) starting with 1.3.2
2005-01-21 15:29:05 +00:00
case "$OSREV" in
2011-09-16 13:05:21 -04:00
0.9*|1.[[012]]*|1.3|1.3.1)
2002-11-22 19:07:04 +00:00
SKIP_SETREUID=yes
2002-01-18 19:18:39 +00:00
;;
esac
2007-09-02 20:25:53 +00:00
CHECKSHADOW="false"
2007-09-05 22:16:22 +00:00
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
2005-01-21 15:29:05 +00:00
: ${with_logincap='maybe'}
2015-04-06 15:10:26 -06:00
2019-12-25 11:21:49 -07:00
# For reallocarray()
AC_DEFINE([_OPENBSD_SOURCE])
2015-04-06 15:10:26 -06:00
# Examples go in share/examples/sudo
if test X"$with_exampledir" = X""; then
exampledir='$(datarootdir)/examples/$(PACKAGE_TARNAME)'
fi
2000-12-30 03:29:47 +00:00
;;
2005-06-25 18:33:01 +00:00
*-*-dragonfly*)
2015-06-18 09:33:05 -06:00
AC_DEFINE([_BSD_SOURCE])
2011-04-06 09:33:07 -04:00
if test "${with_skey-'no'}" = "yes"; then
2011-03-04 08:26:48 -05:00
SUDOERS_LIBS="${SUDOERS_LIBS} -lmd"
2005-06-25 18:33:01 +00:00
fi
2007-09-02 20:25:53 +00:00
CHECKSHADOW="false"
2007-09-05 22:16:22 +00:00
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
2005-06-25 18:33:01 +00:00
: ${with_logincap='yes'}
2015-04-06 15:10:26 -06:00
# Examples go in share/examples/sudo
if test X"$with_exampledir" = X""; then
exampledir='$(datarootdir)/examples/$(PACKAGE_TARNAME)'
fi
2005-06-25 18:33:01 +00:00
;;
1996-07-24 05:59:28 +00:00
*-*-*bsd*)
2007-09-02 20:25:53 +00:00
CHECKSHADOW="false"
2015-04-06 15:10:26 -06:00
# Examples go in share/examples/sudo
if test X"$with_exampledir" = X""; then
exampledir='$(datarootdir)/examples/$(PACKAGE_TARNAME)'
fi
1994-05-28 23:36:22 +00:00
;;
2003-05-06 04:53:21 +00:00
*-*-darwin*)
2010-04-18 12:42:52 -04:00
# Darwin has a real setreuid(2) starting with 9.0
if test $OSMAJOR -lt 9; then
SKIP_SETREUID=yes
fi
2007-09-02 20:25:53 +00:00
CHECKSHADOW="false"
2007-09-05 22:16:22 +00:00
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
2005-01-21 15:29:05 +00:00
: ${with_logincap='yes'}
2013-10-12 05:53:43 -06:00
# Darwin has a broken poll()
: ${enable_poll='no'}
2013-08-20 15:14:17 -06:00
# Darwin 8 and above can interpose library symbols cleanly
if test $OSMAJOR -ge 8; then
AC_DEFINE(HAVE___INTERPOSE)
2013-08-21 10:09:04 -06:00
dlyld_interpose=yes
2013-08-20 15:14:17 -06:00
else
RTLD_PRELOAD_ENABLE_VAR="DYLD_FORCE_FLAT_NAMESPACE"
fi
2012-02-21 13:26:02 -05:00
RTLD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
2015-04-06 15:10:26 -06:00
2018-08-19 09:55:08 -06:00
# Mach monotonic timer that runs while sleeping
AC_CHECK_FUNCS([mach_continuous_time])
2016-12-13 10:39:32 -07:00
# Undocumented API that dynamically allocates the groups.
AC_CHECK_FUNCS([getgrouplist_2], [AC_CHECK_DECLS([getgrouplist_2])])
2015-05-15 15:48:24 -06:00
# We need to force a flat namespace to make libc
# symbol hooking work like it does on ELF.
2016-11-17 10:16:51 -07:00
AX_CHECK_LINK_FLAG([-Wl,-force_flat_namespace], [AX_APPEND_FLAG([-Wl,-force_flat_namespace], [SUDO_LDFLAGS])])
2015-05-15 15:48:24 -06:00
2015-04-06 15:10:26 -06:00
# Examples go in share/examples/sudo
if test X"$with_exampledir" = X""; then
exampledir='$(datarootdir)/examples/$(PACKAGE_TARNAME)'
fi
2003-05-06 15:25:36 +00:00
;;
2001-04-04 17:14:13 +00:00
*-*-nextstep*)
2015-09-07 06:06:08 -06:00
# lockf() is broken on the NeXT
2001-04-04 17:14:13 +00:00
ac_cv_func_lockf=no
2012-02-21 13:26:02 -05:00
RTLD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
RTLD_PRELOAD_ENABLE_VAR="DYLD_FORCE_FLAT_NAMESPACE"
2001-04-04 17:14:13 +00:00
;;
2003-03-20 19:40:58 +00:00
*-*-*sysv4*)
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
2003-03-20 19:40:58 +00:00
;;
2020-09-05 19:29:06 -06:00
*-*-*sco3.2*) # SCO OpenServer 5
: ${mansectsu='1'}
: ${mansectform='4'}
shadow_funcs="getprpwnam"
shadow_libs="-lprot"
;;
# UnixWare 7.x, OpenUNIX 8
*-*-*sysv5*)
: ${mansectsu='1'}
: ${mansectform='4'}
case "$host" in
*-*-sysv5SCO_SV*) # SCO OpenServer 6.x
shadow_funcs="getprpwnam"
shadow_libs="-lprot"
;;
*) shadow_funcs="getspnam"
test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
;;
esac
;;
2000-03-23 00:35:59 +00:00
*-*-sysv*)
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
2000-03-23 00:35:59 +00:00
;;
1994-05-28 23:36:22 +00:00
esac
1995-06-18 17:58:42 +00:00
2018-10-21 08:46:09 -06:00
if test X"$enable_pvs_studio" = X"yes"; then
# Determine preprocessor type
case "$CC" in
*clang*) preprocessor=clang;;
*gcc*) preprocessor=gcc;;
*)
case `$CC --version 2>&1` in
*clang*) preprocessor=clang;;
*gcc*) preprocessor=gcc;;
*) AC_MSG_ERROR([Compiler must be gcc or clang for PVS-Studio.]);;
esac
;;
esac
# Determine platform (currently linux or macos)
case "$host" in
x86_64-*-linux*) pvs_platform=linux64;;
*86-*-linux*) pvs_platform=linux32;;
darwin*) pvs_platform=macos;;
*) AC_MSG_ERROR([PVS-Studio does not support $host_os.]);;
esac
# create basic PVS-Studio.cfg file
cat > PVS-Studio.cfg <<-EOF
preprocessor = $preprocessor
platform = $pvs_platform
analysis-mode = 4
language = C
EOF
fi
2012-02-21 13:26:02 -05:00
dnl
dnl Library preloading to support NOEXEC
dnl
2019-07-03 13:13:04 -06:00
if test X"$with_noexec" != X"no"; then
2012-02-21 13:26:02 -05:00
SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_VAR, "$RTLD_PRELOAD_VAR")
SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_DELIM, "$RTLD_PRELOAD_DELIM")
if test -n "$RTLD_PRELOAD_DEFAULT"; then
SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_DEFAULT, "$RTLD_PRELOAD_DEFAULT")
fi
if test -n "$RTLD_PRELOAD_ENABLE_VAR"; then
SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_ENABLE_VAR, "$RTLD_PRELOAD_ENABLE_VAR")
fi
fi
2007-09-05 22:16:22 +00:00
dnl
dnl Check for mixing mutually exclusive and regular auth methods
dnl
AUTH_REG=${AUTH_REG# }
AUTH_EXCL=${AUTH_EXCL# }
if test -n "$AUTH_EXCL"; then
if test -n "$AUTH_REG"; then
AC_MSG_ERROR([Cannot mix mutually exclusive ($AUTH_EXCL) and regular ($AUTH_REG) authentication methods])
fi
fi
dnl
dnl Only one of S/Key and OPIE may be specified
dnl
if test X"${with_skey}${with_opie}" = X"yesyes"; then
AC_MSG_ERROR(["cannot use both S/Key and OPIE"])
fi
2000-03-23 00:35:59 +00:00
dnl
dnl Use BSD-style man sections by default
dnl
2005-01-14 18:35:06 +00:00
: ${mansectsu='8'}
: ${mansectform='5'}
2000-03-23 00:35:59 +00:00
2003-03-20 19:40:58 +00:00
dnl
dnl Add in any libpaths or libraries specified via configure
dnl
2003-03-21 01:28:41 +00:00
if test -n "$with_libpath"; then
2003-03-20 19:40:58 +00:00
for i in ${with_libpath}; do
SUDO_APPEND_LIBPATH(LDFLAGS, [$i])
done
fi
2003-03-21 01:28:41 +00:00
if test -n "$with_libraries"; then
2003-03-20 19:40:58 +00:00
for i in ${with_libraries}; do
case $i in
-l*) ;;
*.a) ;;
*.o) ;;
*) i="-l${i}";;
esac
LIBS="${LIBS} ${i}"
done
fi
1994-11-08 01:40:52 +00:00
dnl
1994-05-28 23:36:22 +00:00
dnl C compiler checks (to be done after os checks)
1994-03-12 18:37:58 +00:00
dnl
1995-03-28 02:15:39 +00:00
AC_C_CONST
2015-06-30 10:16:56 -06:00
AC_C_INLINE
2001-12-14 06:52:44 +00:00
AC_C_VOLATILE
2013-11-18 09:10:09 -07:00
AC_MSG_CHECKING([for variadic macro support in cpp])
2012-03-01 13:05:03 -05:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
AC_INCLUDES_DEFAULT
#if defined(__GNUC__) && __GNUC__ == 2
# define sudo_fprintf(fp, fmt...) fprintf((fp), (fmt))
#else
# define sudo_fprintf(fp, ...) fprintf((fp), __VA_ARGS__)
#endif
2013-11-18 09:10:09 -07:00
], [sudo_fprintf(stderr, "a %s", "test");])], [AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_DEFINE([NO_VARIADIC_MACROS], [1], [Define if your C preprocessor does not support variadic macros.])
2014-07-29 10:52:43 -06:00
AC_MSG_WARN([Your C preprocessor doesn't support variadic macros, debugging support will be limited])
2014-10-27 05:26:08 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_debug_printf_nvm_v1)
2014-07-29 10:52:43 -06:00
])
2012-05-22 13:23:19 -04:00
1994-03-09 23:51:22 +00:00
dnl
1994-05-24 16:50:57 +00:00
dnl Program checks
1994-03-09 23:51:22 +00:00
dnl
2014-10-27 14:54:13 -06:00
AC_PROG_AWK
1994-03-09 23:51:22 +00:00
AC_PROG_YACC
2009-05-27 00:49:07 +00:00
AC_PATH_PROG([FLEX], [flex], [flex])
2000-04-02 15:44:06 +00:00
SUDO_PROG_MV
SUDO_PROG_BSHELL
1998-10-15 03:31:26 +00:00
if test -z "$with_sendmail"; then
SUDO_PROG_SENDMAIL
fi
2010-10-12 09:08:09 -04:00
SUDO_PROG_VI
1994-03-09 23:51:22 +00:00
dnl
2010-07-22 17:50:21 -04:00
dnl Check for authpriv support in syslog
dnl
AC_MSG_CHECKING(which syslog facility sudo should log with)
if test X"$with_logfac" = X""; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <syslog.h>]], [[int i = LOG_AUTHPRIV; (void)i;]])], [logfac=authpriv])
fi
AC_DEFINE_UNQUOTED(LOGFAC, "$logfac", [The syslog facility sudo will use.])
AC_MSG_RESULT($logfac)
dnl
1994-03-09 23:51:22 +00:00
dnl Header file checks
dnl
1995-03-28 02:15:39 +00:00
AC_HEADER_DIRENT
2012-01-30 09:28:11 -05:00
AC_HEADER_STDBOOL
2012-04-16 10:25:49 -04:00
AC_HEADER_MAJOR
2018-11-18 07:45:43 -07:00
AC_CHECK_HEADERS_ONCE([netgroup.h paths.h spawn.h wordexp.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h sys/sysmacros.h sys/syscall.h sys/statvfs.h])
AC_CHECK_HEADERS([utmps.h] [utmpx.h], [break])
2013-04-15 11:05:52 -04:00
AC_CHECK_HEADERS([endian.h] [sys/endian.h] [machine/endian.h], [break])
2015-01-15 21:00:01 -07:00
AC_CHECK_HEADERS([procfs.h] [sys/procfs.h], [AC_CHECK_MEMBERS(struct psinfo.pr_ttydev, [AC_CHECK_FUNCS([_ttyname_dev])], [], [AC_INCLUDES_DEFAULT
2012-04-10 15:53:41 -04:00
#ifdef HAVE_PROCFS_H
#include <procfs.h>
#endif
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
])]
break)
2013-11-12 15:13:54 -07:00
#
# Check for large file support.
#
2010-10-28 11:17:40 -04:00
AC_SYS_LARGEFILE
2013-11-12 15:13:54 -07:00
#
# HP-UX may need to define _XOPEN_SOURCE_EXTENDED to expose MSG_WAITALL.
# Also, HP-UX 11.23 has a broken sys/types.h when large files support
# is enabled and _XOPEN_SOURCE_EXTENDED is not also defined.
# The following test will define _XOPEN_SOURCE_EXTENDED in either case.
#
2013-03-19 15:59:23 -04:00
case "$host_os" in
2013-11-12 15:13:54 -07:00
hpux*)
AC_CACHE_CHECK([whether sys/socket.h needs _XOPEN_SOURCE_EXTENDED for MSG_WAITALL], [sudo_cv_xopen_source_extended],
2010-11-20 16:26:53 -05:00
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
2013-11-15 15:16:47 -07:00
# include <sys/socket.h>], [int a = MSG_WAITALL; return a;])],
2013-11-12 15:13:54 -07:00
[sudo_cv_xopen_source_extended=no], [
2010-11-20 16:26:53 -05:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#define _XOPEN_SOURCE_EXTENDED
AC_INCLUDES_DEFAULT
2016-06-27 05:55:31 -06:00
# include <sys/socket.h>
# include <net/if.h>], [int a = MSG_WAITALL; return a;])],
2013-11-12 15:13:54 -07:00
[sudo_cv_xopen_source_extended=yes],
2010-11-20 16:26:53 -05:00
[sudo_cv_xopen_source_extended=error])
])])
if test "$sudo_cv_xopen_source_extended" = "yes"; then
2015-06-18 09:33:05 -06:00
AC_DEFINE([_XOPEN_SOURCE_EXTENDED])
2010-11-20 16:26:53 -05:00
fi
;;
esac
2010-03-12 11:45:57 -05:00
AC_SYS_POSIX_TERMIOS
2010-06-09 11:09:55 -04:00
if test "$ac_cv_sys_posix_termios" != "yes"; then
AC_MSG_ERROR([Must have POSIX termios to build sudo])
1994-06-13 19:54:58 +00:00
fi
2010-07-19 12:50:59 -04:00
SUDO_MAILDIR
2005-01-21 15:29:05 +00:00
if test ${with_logincap-'no'} != "no"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_HEADERS([login_cap.h], [LOGINCAP_USAGE='[[-c class]] '; LCMAN=1
2007-10-21 13:29:18 +00:00
case "$OS" in
2011-03-08 09:46:35 -05:00
freebsd|netbsd)
SUDO_LIBS="${SUDO_LIBS} -lutil"
SUDOERS_LIBS="${SUDOERS_LIBS} -lutil"
;;
2007-10-21 13:29:18 +00:00
esac
])
2000-10-26 16:42:40 +00:00
fi
2007-06-19 22:24:51 +00:00
if test ${with_project-'no'} != "no"; then
2011-06-10 15:28:58 -04:00
AC_CHECK_HEADER(project.h, [
AC_CHECK_LIB(project, setproject, [
AC_DEFINE(HAVE_PROJECT_H)
SUDO_LIBS="${SUDO_LIBS} -lproject"
])
], [])
2007-06-19 22:24:51 +00:00
fi
1994-03-09 23:51:22 +00:00
dnl
dnl typedef checks
dnl
1995-03-28 02:15:39 +00:00
AC_TYPE_MODE_T
AC_TYPE_UID_T
2014-01-30 15:50:40 -07:00
AC_CHECK_TYPE([clockid_t], [], [AC_DEFINE(clockid_t, int)], [#include <sys/types.h>
#include <time.h>])
2008-10-03 13:59:39 +00:00
AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h>
2001-12-14 06:52:44 +00:00
#include <signal.h>])
2011-12-01 11:07:17 -05:00
AC_CHECK_TYPES([struct in6_addr], [], [], [#include <sys/types.h>
2007-10-24 16:41:19 +00:00
#include <netinet/in.h>])
2010-07-31 21:19:46 -04:00
AC_TYPE_LONG_LONG_INT
2013-04-16 14:36:42 -04:00
if test X"$ac_cv_type_long_long_int" != X"yes"; then
2013-12-10 16:23:21 -07:00
AC_MSG_ERROR(["C compiler does not appear to support the long long int type"])
2013-04-16 14:36:42 -04:00
fi
2015-02-21 16:52:14 -07:00
AC_CHECK_TYPE(intmax_t, long long)
AC_CHECK_TYPE(uintmax_t, unsigned long long)
2013-04-14 07:00:21 -04:00
AC_CHECK_TYPE(uint8_t, unsigned char)
AC_CHECK_TYPE(uint32_t, unsigned int)
AC_CHECK_TYPE(uint64_t, unsigned long long)
2011-12-01 11:27:57 -05:00
AC_CHECK_TYPE(socklen_t, [], [AC_DEFINE(socklen_t, unsigned int)], [
AC_INCLUDES_DEFAULT
#include <sys/socket.h>])
1995-07-23 21:48:17 +00:00
SUDO_UID_T_LEN
1995-07-01 20:04:39 +00:00
SUDO_SOCK_SA_LEN
2013-11-17 14:16:13 -07:00
SUDO_SOCK_SIN_LEN
2016-11-30 07:32:59 -07:00
AC_CHECK_SIZEOF([id_t])
AC_CHECK_SIZEOF([long long])
2017-02-18 15:35:48 -07:00
AC_CHECK_SIZEOF([time_t])
2018-11-18 07:45:43 -07:00
if test $ac_cv_header_utmps_h = "yes"; then
SUDO_CHECK_UTMP_MEMBERS([utmps])
elif test $ac_cv_header_utmpx_h = "yes"; then
SUDO_CHECK_UTMP_MEMBERS([utmpx])
2011-03-14 10:20:47 -04:00
else
2018-11-18 07:45:43 -07:00
SUDO_CHECK_UTMP_MEMBERS([utmp])
2011-03-14 10:20:47 -04:00
fi
2019-10-22 13:16:22 +02:00
dnl
dnl Python plugin support
dnl
AC_MSG_CHECKING(whether to compile python plugin support)
AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python], [Compile python plugin support])],
[ case "$enableval" in
yes|no)
AC_MSG_RESULT($enableval)
USE_PYTHON=$enableval
;;
*)
AC_MSG_WARN([Ignoring unknown argument to --enable-python: $enableval])
;;
esac
], AC_MSG_RESULT(no))
if test ${USE_PYTHON-'no'} = "yes"; then
AM_PATH_PYTHON([3])
AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
AC_ARG_VAR([PYTHON_LIBS], [Linker flags for python, bypassing python-config])
AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
AS_IF([test -z "$PYTHON_INCLUDE" || test -z "$PYTHON_LIBS"], [
AS_IF([test -z "$PYTHON_CONFIG"], [
AC_PATH_PROGS([PYTHON_CONFIG],
[python$PYTHON_VERSION-config python-config],
[no],
[`dirname $PYTHON`])
AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON.])])
])
])
AS_IF([test -z "$PYTHON_INCLUDE"], [
AC_MSG_CHECKING([python include flags])
2020-06-06 16:32:10 -06:00
# Pull out python include path, ignore other flags
PYTHON_INCLUDE=`$PYTHON_CONFIG --cflags | tr " " "\n" | grep "^-I" | sort -u | tr "\n" " "`
2019-10-22 13:16:22 +02:00
AC_MSG_RESULT([$PYTHON_INCLUDE])
])
AS_IF([test -z "$PYTHON_LIBS"], [
2020-05-03 12:56:26 -06:00
# Newer versions of python3-config need --embed to include libpython
if $PYTHON_CONFIG 2>&1 | grep embed >/dev/null; then
PY_EMBED=--embed
else
PY_EMBED=
fi
2019-10-22 13:16:22 +02:00
AC_MSG_CHECKING([python linker flags])
2020-05-03 12:56:26 -06:00
PYTHON_LIBS=`$PYTHON_CONFIG --ldflags $PY_EMBED`
2020-06-06 16:32:10 -06:00
PYTHON_LIBS=`$PYTHON_CONFIG --ldflags $PY_EMBED | tr " " "\n" | grep "^-[[lL]]" | tr "\n" " "`
2019-10-22 13:16:22 +02:00
AC_MSG_RESULT([$PYTHON_LIBS])
])
2020-04-07 14:03:58 -06:00
PPFILES="$PPFILES "'$(srcdir)/etc/sudo-python.pp'
2019-10-22 13:16:22 +02:00
PYTHON_PLUGIN_SRC=plugins/python
2020-09-03 06:44:43 -06:00
PYTHON_PLUGIN=
2020-08-03 10:15:28 -06:00
AC_CONFIG_FILES([$PYTHON_PLUGIN_SRC/Makefile])
2019-10-22 13:16:22 +02:00
fi
1994-05-25 03:07:49 +00:00
dnl
1994-05-24 16:50:57 +00:00
dnl Function checks
1994-03-09 23:51:22 +00:00
dnl
2007-11-27 23:40:50 +00:00
AC_FUNC_GETGROUPS
2021-02-07 13:56:15 -07:00
AC_CHECK_FUNCS_ONCE([fexecve fmemopen killpg nl_langinfo faccessat wordexp getauxval fseeko])
2016-01-13 11:10:33 -07:00
case "$host_os" in
hpux*)
if test X"$ac_cv_func_pread" = X"yes"; then
O_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
AC_CHECK_FUNCS([pread64 pwrite64], [
AC_DEFINE([_LARGEFILE64_SOURCE], [1], [Define to 1 to enable 64-bit versions of standard C functions on 32-bit systems.])
])
CPPFLAGS="$O_CPPFLAGS"
fi
;;
esac
2021-01-02 10:43:34 -07:00
AC_CHECK_FUNCS([pread], [], [
AC_LIBOBJ(pread)
SUDO_APPEND_COMPAT_EXP(sudo_pread)
])
AC_CHECK_FUNCS([pwrite], [], [
AC_LIBOBJ(pwrite)
SUDO_APPEND_COMPAT_EXP(sudo_pwrite)
])
2019-12-23 13:15:34 -07:00
AC_CHECK_FUNCS([cfmakeraw], [], [
AC_LIBOBJ(cfmakeraw)
SUDO_APPEND_COMPAT_EXP(sudo_cfmakeraw)
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([getgrouplist], [], [
2013-03-19 15:59:23 -04:00
case "$host_os" in
aix*)
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([getgrset])
2013-01-22 15:41:15 -05:00
;;
*)
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNC([nss_search], [
AC_CHECK_FUNC([_nss_XbyY_buf_alloc], [
2013-01-22 15:41:15 -05:00
# Solaris
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNC([_nss_initf_group], [
AC_CHECK_HEADERS([nss_dbdefs.h])
2013-01-22 15:41:15 -05:00
AC_DEFINE([HAVE_NSS_SEARCH])
AC_DEFINE([HAVE__NSS_XBYY_BUF_ALLOC])
AC_DEFINE([HAVE__NSS_INITF_GROUP])
2014-05-07 09:03:02 -06:00
], [
2015-01-15 21:00:01 -07:00
AC_CHECK_HEADERS([nss_dbdefs.h], [
2014-05-07 09:03:02 -06:00
# Older Solaris does not export _nss_initf_group
# but we can use our own.
AC_DEFINE([HAVE_NSS_SEARCH])
AC_DEFINE([HAVE__NSS_XBYY_BUF_ALLOC])
])
2013-01-22 15:41:15 -05:00
])
], [
# HP-UX
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNC([__nss_XbyY_buf_alloc], [
AC_CHECK_FUNC([__nss_initf_group], [
AC_CHECK_HEADERS([nss_dbdefs.h])
2013-01-22 15:41:15 -05:00
AC_DEFINE([HAVE_NSS_SEARCH])
AC_DEFINE([HAVE___NSS_XBYY_BUF_ALLOC])
AC_DEFINE([HAVE___NSS_INITF_GROUP])
])
])
])
])
;;
esac
2014-07-29 10:52:43 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_getgrouplist)
2013-01-22 15:41:15 -05:00
])
2020-06-06 18:45:27 -06:00
AC_CHECK_FUNCS([getdelim], [
# Out of date gcc fixed includes may result in missing getdelim() prototype
AC_CHECK_DECLS([getdelim])
], [
2019-04-08 10:37:30 -06:00
AC_LIBOBJ(getdelim)
SUDO_APPEND_COMPAT_EXP(sudo_getdelim)
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }getdelim_test"
2009-09-19 17:21:14 +00:00
])
2019-12-09 19:29:45 -07:00
AC_CHECK_FUNCS([getusershell], [], [
AC_LIBOBJ(getusershell)
SUDO_APPEND_COMPAT_EXP(sudo_getusershell)
])
2015-05-18 13:39:21 -06:00
AC_CHECK_FUNCS([reallocarray], [], [
2015-05-27 10:04:32 -06:00
AC_LIBOBJ(reallocarray)
2015-05-18 13:39:21 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_reallocarray)
])
2019-10-24 20:04:31 -06:00
AC_CHECK_FUNCS([arc4random], [
AC_CHECK_FUNCS([arc4random_uniform], [], [
AC_LIBOBJ(arc4random_uniform)
SUDO_APPEND_COMPAT_EXP(sudo_arc4random_uniform)
])
2020-01-30 13:12:25 -07:00
AC_CHECK_FUNCS([arc4random_buf], [], [
AC_LIBOBJ(arc4random_buf)
SUDO_APPEND_COMPAT_EXP(sudo_arc4random_buf)
])
2019-10-24 20:04:31 -06:00
], [
AC_LIBOBJ(arc4random)
SUDO_APPEND_COMPAT_EXP(sudo_arc4random)
2020-01-30 13:12:25 -07:00
SUDO_APPEND_COMPAT_EXP(sudo_arc4random_buf)
2018-05-24 21:04:23 -06:00
AC_LIBOBJ(arc4random_uniform)
SUDO_APPEND_COMPAT_EXP(sudo_arc4random_uniform)
2019-10-24 20:04:31 -06:00
# arc4random.c needs getentropy()
AC_CHECK_FUNCS([getentropy], [
AC_CHECK_HEADERS([sys/random.h])
], [
AC_LIBOBJ(getentropy)
SUDO_APPEND_COMPAT_EXP(sudo_getentropy)
])
# arc4random.c wants pthread_atfork
AC_CHECK_HEADERS([pthread.h], [
AC_CHECK_LIB(pthread, main, [LIBPTHREAD="-lpthread"])
AC_CHECK_FUNCS([pthread_atfork])
2018-05-24 21:04:23 -06:00
])
])
2012-01-30 10:09:23 -05:00
2011-03-15 11:56:49 -04:00
utmp_style=LEGACY
2018-11-18 07:45:43 -07:00
AC_CHECK_FUNCS([getutsid getutxid getutid], [utmp_style=POSIX; break])
2011-03-15 11:56:49 -04:00
if test "$utmp_style" = "LEGACY"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([getttyent ttyslot], [break])
2011-03-08 15:37:40 -05:00
fi
2009-12-10 16:59:27 +00:00
2018-01-11 10:49:20 -07:00
AC_CHECK_FUNCS([sysctl], [AC_CHECK_FUNCS([devname])
2018-03-05 17:35:02 -07:00
AC_CHECK_MEMBER([struct kinfo_proc.ki_structsize], [AC_DEFINE(HAVE_KINFO_PROC_FREEBSD)], [
AC_CHECK_MEMBER([struct kinfo_proc2.p_paddr], [AC_DEFINE(HAVE_KINFO_PROC2_NETBSD)], [
AC_CHECK_MEMBER([struct kinfo_proc.p_paddr], [AC_DEFINE(HAVE_KINFO_PROC_OPENBSD)], [
AC_CHECK_MEMBER([struct kinfo_proc.kp_proc], [AC_DEFINE(HAVE_KINFO_PROC_44BSD)], [], [
2013-11-15 15:16:47 -07:00
# include <sys/param.h>
# include <sys/sysctl.h>
2012-02-28 10:33:16 -05:00
])
], [
2013-11-15 15:16:47 -07:00
# include <sys/param.h>
# include <sys/sysctl.h>
2012-01-10 16:49:24 -05:00
])
],
[
2013-11-15 15:16:47 -07:00
# include <sys/param.h>
# include <sys/sysctl.h>
2012-01-10 16:49:24 -05:00
])
],
[
2013-11-15 15:16:47 -07:00
# include <sys/param.h>
# include <sys/sysctl.h>
# include <sys/user.h>
2012-01-10 16:49:24 -05:00
])
])
2012-01-10 13:02:55 -05:00
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([openpty], [AC_CHECK_HEADERS([libutil.h util.h pty.h], [break])], [
2009-08-06 15:53:21 +00:00
AC_CHECK_LIB(util, openpty, [
2015-01-15 21:00:01 -07:00
AC_CHECK_HEADERS([libutil.h util.h pty.h], [break])
2011-03-08 09:46:35 -05:00
case "$SUDO_LIBS" in
*-lutil*) ;;
*) SUDO_LIBS="${SUDO_LIBS} -lutil";;
esac
2009-08-06 15:53:21 +00:00
AC_DEFINE(HAVE_OPENPTY)
], [
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([_getpty], [], [
AC_CHECK_FUNCS([grantpt], [
AC_CHECK_FUNCS([posix_openpt])
2009-10-17 12:54:07 +00:00
], [
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([revoke])
2009-10-17 12:54:07 +00:00
])
2009-08-08 00:26:13 +00:00
])
2009-08-06 15:53:21 +00:00
])
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([unsetenv], [SUDO_FUNC_UNSETENV_VOID], [])
2012-03-07 16:35:42 -05:00
SUDO_FUNC_PUTENV_CONST
2002-11-22 19:07:04 +00:00
if test -z "$SKIP_SETRESUID"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([setresuid], [
2010-05-11 10:55:59 -04:00
SKIP_SETREUID=yes
2015-02-05 11:08:55 -07:00
AC_CHECK_DECLS([setresuid])
2015-02-06 11:33:30 -07:00
AC_CHECK_FUNCS([getresuid], [AC_CHECK_DECLS([getresuid])])
2010-05-11 10:55:59 -04:00
])
2002-11-22 19:07:04 +00:00
fi
if test -z "$SKIP_SETREUID"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([setreuid])
2000-12-30 03:29:47 +00:00
fi
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS_ONCE([seteuid])
2000-08-13 21:09:22 +00:00
if test X"$with_interfaces" != X"no"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([getifaddrs], [AC_CHECK_FUNCS([freeifaddrs])])
2000-08-13 21:09:22 +00:00
fi
2015-09-07 06:06:08 -06:00
AC_CHECK_FUNCS([lockf], [break])
2015-02-05 11:08:55 -07:00
AC_CHECK_FUNCS([innetgr], [
AC_CHECK_DECLS([innetgr], [], [], [
AC_INCLUDES_DEFAULT
#ifdef HAVE_NETGROUP_H
# include <netgroup.h>
#else
# include <netdb.h>
#endif /* HAVE_NETGROUP_H */
])], [
AC_CHECK_FUNCS([_innetgr], [
AC_CHECK_DECLS([_innetgr], [], [], [
AC_INCLUDES_DEFAULT
#ifdef HAVE_NETGROUP_H
# include <netgroup.h>
#else
# include <netdb.h>
#endif /* HAVE_NETGROUP_H */
])
])
])
AC_CHECK_FUNCS([getdomainname], [
2015-02-06 11:33:30 -07:00
AC_CHECK_DECLS([getdomainname], [], [], [
AC_INCLUDES_DEFAULT
#include <netdb.h>
])
2015-02-05 11:08:55 -07:00
], [
2015-02-03 07:33:24 -07:00
AC_CHECK_FUNCS([sysinfo], [AC_CHECK_HEADERS([sys/systeminfo.h])])
])
2015-03-02 13:58:50 -07:00
AC_CHECK_FUNCS([utimensat], [], [
AC_LIBOBJ(utimens)
SUDO_APPEND_COMPAT_EXP(sudo_utimensat)
AC_CHECK_FUNCS([utimes])
])
AC_CHECK_FUNCS([futimens], [], [
AC_LIBOBJ(utimens)
SUDO_APPEND_COMPAT_EXP(sudo_futimens)
AC_CHECK_FUNCS([futimes futimesat futime], [break])
2014-07-29 10:52:43 -06:00
])
2020-08-10 19:24:32 -06:00
AC_CHECK_FUNCS([explicit_bzero], [], [
AC_LIBOBJ(explicit_bzero)
SUDO_APPEND_COMPAT_EXP(sudo_explicit_bzero)
AC_CHECK_FUNCS([explicit_memset memset_explicit memset_s bzero], [break])
])
2014-07-29 10:52:43 -06:00
SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [
AC_LIBOBJ(fnmatch)
SUDO_APPEND_COMPAT_EXP(sudo_fnmatch)
2012-01-16 10:40:11 -05:00
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }fnm_test"
])
2001-12-12 00:31:07 +00:00
SUDO_FUNC_ISBLANK
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([glob], [], [
2014-07-29 10:52:43 -06:00
AC_LIBOBJ(glob)
SUDO_APPEND_COMPAT_EXP(sudo_glob sudo_globfree)
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([memrchr], [], [
2014-07-29 10:52:43 -06:00
AC_LIBOBJ(memrchr)
SUDO_APPEND_COMPAT_EXP(sudo_memrchr)
])
2020-08-10 19:24:33 -06:00
AC_CHECK_FUNCS([freezero], [], [
AC_LIBOBJ(freezero)
SUDO_APPEND_COMPAT_EXP(sudo_freezero)
])
2017-01-12 10:44:26 -07:00
AC_CHECK_FUNCS(nanosleep, [], [
# On Solaris, nanosleep is in librt
2017-01-13 21:29:02 -07:00
AC_CHECK_LIB(rt, nanosleep, [
AC_DEFINE(HAVE_NANOSLEEP)
LIBRT="-lrt"
], [
2017-01-13 20:40:26 -07:00
AC_LIBOBJ(nanosleep)
2017-01-13 21:02:31 -07:00
SUDO_APPEND_COMPAT_EXP(sudo_nanosleep)
2017-01-13 20:40:26 -07:00
])
2017-01-12 10:44:26 -07:00
])
2019-10-24 20:04:30 -06:00
AC_CHECK_FUNCS([openat], [], [
AC_LIBOBJ(openat)
SUDO_APPEND_COMPAT_EXP(sudo_openat)
])
AC_CHECK_FUNCS([unlinkat], [], [
AC_LIBOBJ(unlinkat)
SUDO_APPEND_COMPAT_EXP(sudo_unlinkat)
])
2019-10-24 20:04:33 -06:00
AC_CHECK_FUNCS([fchmodat], [], [
AC_LIBOBJ(fchmodat)
SUDO_APPEND_COMPAT_EXP(sudo_fchmodat)
])
AC_CHECK_FUNCS([fstatat], [], [
AC_LIBOBJ(fstatat)
SUDO_APPEND_COMPAT_EXP(sudo_fstatat)
])
2019-11-02 10:52:55 -06:00
AC_CHECK_FUNCS([dup3], [], [
AC_LIBOBJ(dup3)
SUDO_APPEND_COMPAT_EXP(sudo_dup3)
])
2017-03-13 12:11:51 -06:00
AC_CHECK_FUNCS([pipe2], [], [
AC_LIBOBJ(pipe2)
SUDO_APPEND_COMPAT_EXP(sudo_pipe2)
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([pw_dup], [], [
2014-07-29 10:52:43 -06:00
AC_LIBOBJ(pw_dup)
SUDO_APPEND_COMPAT_EXP(sudo_pw_dup)
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([strlcpy], [], [
2014-07-29 10:52:43 -06:00
AC_LIBOBJ(strlcpy)
SUDO_APPEND_COMPAT_EXP(sudo_strlcpy)
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([strlcat], [], [
2014-07-29 10:52:43 -06:00
AC_LIBOBJ(strlcat)
SUDO_APPEND_COMPAT_EXP(sudo_strlcat)
])
2015-06-19 09:54:12 -06:00
AC_CHECK_FUNC([strnlen], [AC_FUNC_STRNLEN], [AC_LIBOBJ(strnlen)])
2015-06-17 17:00:21 -06:00
if test X"$ac_cv_func_strnlen_working" = X"yes"; then
AC_DEFINE(HAVE_STRNLEN)
AC_CHECK_FUNCS([strndup], [], [
AC_LIBOBJ(strndup)
SUDO_APPEND_COMPAT_EXP(sudo_strndup)
])
else
2015-06-19 09:54:12 -06:00
# Broken or missing strnlen, use our own.
2015-06-17 17:00:21 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_strnlen)
# Avoid libc strndup() since it is usually implemented using strnlen()
2015-05-26 14:05:26 -06:00
AC_LIBOBJ(strndup)
SUDO_APPEND_COMPAT_EXP(sudo_strndup)
2015-06-17 17:00:21 -06:00
fi
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([clock_gettime], [], [
2014-01-30 15:50:40 -07:00
# On Solaris, clock_gettime is in librt
2014-02-02 08:34:53 -07:00
AC_CHECK_LIB(rt, clock_gettime, [
AC_DEFINE(HAVE_CLOCK_GETTIME)
2015-03-02 16:05:57 -07:00
LIBRT="-lrt"
2014-07-29 10:52:43 -06:00
])
2014-01-30 15:50:40 -07:00
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([getopt_long], [], [
2014-07-29 10:52:43 -06:00
AC_LIBOBJ(getopt_long)
SUDO_APPEND_COMPAT_EXP(sudo_getopt_long sudo_getopt_long_only)
2013-08-16 13:50:48 -06:00
AC_MSG_CHECKING([for optreset])
AC_CACHE_VAL(sudo_cv_optreset, [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern int optreset; optreset = 1; return optreset;]])], [sudo_cv_optreset=yes], [sudo_cv_optreset=no])])
if test "$sudo_cv_optreset" = "yes"; then
AC_DEFINE(HAVE_OPTRESET)
fi
AC_MSG_RESULT($sudo_cv_optreset)
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([closefrom], [], [AC_LIBOBJ(closefrom)
2020-09-06 15:27:21 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_closefrom)
2013-11-13 14:45:47 -07:00
AC_CHECK_DECL(F_CLOSEM, AC_DEFINE(HAVE_FCNTL_CLOSEM), [], [
# include <limits.h>
# include <fcntl.h> ])
2006-08-17 15:26:54 +00:00
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([mkstemps mkdtemp], [], [break])
2014-07-29 10:52:43 -06:00
if test X"$ac_cv_func_mkstemps$ac_cv_func_mkdtemp" != X"yesyes"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([arc4random random lrand48], [break])
2017-06-29 18:11:30 -06:00
if test X"$ac_cv_func_arc4random" != X"yes"; then
AC_CHECK_FUNCS([getentropy])
fi
2010-12-27 14:07:49 -05:00
AC_LIBOBJ(mktemp)
2014-10-29 13:03:39 -06:00
# If either mkdtemp() or mkstemps() is missing, replace both.
SUDO_APPEND_COMPAT_EXP(sudo_mkdtemp sudo_mkstemps)
2015-02-20 14:37:02 -07:00
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }mktemp_test"
2014-07-29 10:52:43 -06:00
fi
2013-11-19 10:40:25 -07:00
AX_FUNC_SNPRINTF
if test X"$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf" = X"yesyes"; then
2014-07-30 15:47:15 -06:00
# System has a C99-compliant v?snprintf(), check for v?asprintf()
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([asprintf], [], [
2013-11-19 10:40:25 -07:00
AC_LIBOBJ(snprintf)
2014-07-30 15:47:15 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_asprintf)
])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([vasprintf], [], [
2014-07-30 15:47:15 -06:00
AC_LIBOBJ(snprintf)
SUDO_APPEND_COMPAT_EXP(sudo_vasprintf)
])
else
# Missing or non-compliant v?snprintf(), assume missing/bad v?asprintf()
SUDO_APPEND_COMPAT_EXP(sudo_snprintf sudo_vsnprintf sudo_asprintf sudo_vasprintf)
2014-07-29 10:52:43 -06:00
fi
2017-02-18 15:35:48 -07:00
AC_CHECK_MEMBERS([struct tm.tm_gmtoff], [], [], [
AC_INCLUDES_DEFAULT
#include <errno.h>
])
2018-11-14 13:37:46 -07:00
AC_CHECK_MEMBER([struct stat.st_mtim],
[AC_DEFINE(HAVE_ST_MTIM)]
2015-09-09 11:13:22 -06:00
[AC_CHECK_MEMBER([struct stat.st_mtim.st__tim], AC_DEFINE(HAVE_ST__TIM))],
2018-11-14 13:37:46 -07:00
[AC_CHECK_MEMBER([struct stat.st_mtimespec],
[AC_DEFINE([HAVE_ST_MTIMESPEC])],
[AC_CHECK_MEMBER([struct stat.st_nmtime], AC_DEFINE(HAVE_ST_NMTIME))])
]
)
2016-10-19 11:32:36 -06:00
AC_CHECK_FUNCS([vsyslog], [], [
AC_LIBOBJ(vsyslog)
SUDO_APPEND_COMPAT_EXP(sudo_vsyslog)
2017-01-15 19:07:59 -07:00
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }vsyslog_test"
2016-10-19 11:32:36 -06:00
])
2013-08-21 10:09:04 -06:00
dnl
2018-02-20 13:22:59 -07:00
dnl 4.4BSD-based systems can force the password or group file to be held open
dnl
AC_CHECK_FUNCS([setpassent setgroupent])
dnl
2013-08-21 10:09:04 -06:00
dnl Function checks for sudo_noexec
dnl
if test X"$with_noexec" != X"no"; then
2015-09-28 21:20:37 -06:00
# Check for non-standard exec functions
AC_CHECK_FUNCS([exect execvP execvpe])
2016-01-04 10:35:18 -07:00
# Check for posix_spawn, and posix_spawnp
2016-02-24 16:00:08 -07:00
if test X"$ac_cv_header_spawn_h" = X"yes"; then
AC_CHECK_FUNCS([posix_spawn posix_spawnp])
fi
2013-08-21 10:09:04 -06:00
fi
1999-07-22 12:46:29 +00:00
dnl
2004-06-01 20:53:31 +00:00
dnl Check for the dirfd function/macro. If not found, look for dd_fd in DIR.
dnl
2005-06-25 18:04:30 +00:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2010-05-21 15:53:39 -04:00
#include <$ac_header_dirent>]], [[DIR *d; (void)dirfd(d);]])], [AC_DEFINE(HAVE_DIRFD)], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <$ac_header_dirent>]], [[DIR d; memset(&d, 0, sizeof(d)); return(d.dd_fd);]])], [AC_DEFINE(HAVE_DD_FD)], [])])
2015-07-02 09:24:48 -06:00
AC_CHECK_MEMBERS([struct dirent.d_type, struct dirent.d_namlen], [], [], [
2012-04-13 08:36:58 -04:00
AC_INCLUDES_DEFAULT
#include <$ac_header_dirent>
])
2004-06-01 20:53:31 +00:00
dnl
2020-01-21 13:27:40 -07:00
dnl Check for functions only present in OpenSSL 1.1 and above
dnl
if test "${enable_openssl-no}" != no; then
2020-07-16 07:32:13 -06:00
# Use OpenSSL's sha2 functions
AC_DEFINE(HAVE_OPENSSL)
DIGEST=digest_openssl.lo
2020-06-25 20:55:02 -06:00
# Use pkg-config to find the openssl cflags and libs if possible.
if test "$enable_openssl" != "yes"; then
PKG_CONFIG_LIBDIR="${enable_openssl}/lib/pkgconfig:${enable_openssl}/lib64/pkgconfig:${enable_openssl}/share/pkgconfig"
export PKG_CONFIG_LIBDIR
fi
if $PKG_CONFIG --exists openssl >/dev/null 2>&1; then
# Check whether --static is needed
O_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS `$PKG_CONFIG --libs-only-L openssl`"
AC_CHECK_LIB([ssl], [SSL_library_init], [STATIC=""], [STATIC="--static"], [-lcrypto])
LDFLAGS="$O_LDFLAGS"
# Use pkg-config to determine OpenSSL libs and cflags
LIBTLS=`$PKG_CONFIG $STATIC --libs openssl`
2020-07-16 08:15:02 -06:00
if $PKG_CONFIG --exists libcrypto >/dev/null 2>&1; then
LIBMD=`$PKG_CONFIG $STATIC --libs libcrypto`
else
# No separate pkg config for libcrypto
LIBMD="$LIBTLS"
fi
2020-06-25 20:55:02 -06:00
for f in `$PKG_CONFIG --cflags-only-I openssl`; do
AX_APPEND_FLAG([$f], [CPPFLAGS])
done
else
# No pkg-config file present, try to do it manually
if test "$enable_openssl" != "yes"; then
AX_APPEND_FLAG([-I${enable_openssl}/include], [CPPFLAGS])
SUDO_APPEND_LIBPATH(LIBMD, [${enable_openssl}/lib])
SUDO_APPEND_LIBPATH(LIBTLS, [${enable_openssl}/lib])
fi
LIBMD="${LIBMD} -lcrypto"
LIBTLS="${LIBTLS} -lcrypto -lssl"
fi
if test "$enable_openssl" != "yes"; then
unset PKG_CONFIG_LIBDIR
fi
2020-01-23 09:38:09 -07:00
OLIBS="$LIBS"
LIBS="$LIBS $LIBTLS"
2020-11-16 14:39:52 -07:00
AC_CHECK_FUNCS([X509_STORE_CTX_get0_cert ASN1_STRING_get0_data SSL_CTX_get0_certificate TLS_client_method TLS_server_method])
2020-01-23 09:38:09 -07:00
# SSL_CTX_set_min_proto_version may be a macro
AC_CHECK_DECL([SSL_CTX_set_min_proto_version], [AC_DEFINE(HAVE_SSL_CTX_SET_MIN_PROTO_VERSION)], [], [
AC_INCLUDES_DEFAULT
#include <openssl/ssl.h>
])
2020-11-16 14:39:52 -07:00
# LibreSSL TLS 1.3 support may not be enabled, check for declaration too.
AC_CHECK_FUNC([SSL_CTX_set_ciphersuites], [
AC_CHECK_DECL([SSL_CTX_set_ciphersuites], [AC_DEFINE(HAVE_SSL_CTX_SET_CIPHERSUITES)], [], [
AC_INCLUDES_DEFAULT
#include <openssl/ssl.h>
])
])
2020-01-23 09:38:09 -07:00
LIBS="$OLIBS"
2020-07-16 07:32:13 -06:00
elif test "${enable_gcrypt-no}" != no; then
# Use gcrypt's sha2 functions
AC_DEFINE(HAVE_GCRYPT)
DIGEST=digest_gcrypt.lo
LIBMD="-lgcrypt"
if test "$enable_gcrypt" != "yes"; then
AX_APPEND_FLAG([-I${enable_gcrypt}/include], [CPPFLAGS])
SUDO_APPEND_LIBPATH(LDFLAGS, [${enable_gcrypt}/lib])
fi
fi
dnl
dnl Check for sha2 functions if not using openssl or gcrypt
dnl
if test "$DIGEST" = "digest.lo"; then
FOUND_SHA2=no
AC_CHECK_HEADER([sha2.h], [
FOUND_SHA2=yes
AC_CHECK_FUNCS([SHA224Update], [SUDO_FUNC_SHA2_VOID_PTR], [
# On some systems, SHA224Update is in libmd
AC_CHECK_LIB(md, SHA224Update, [
AC_DEFINE(HAVE_SHA224UPDATE)
SUDO_FUNC_SHA2_VOID_PTR
LIBMD="-lmd"
], [
# Does not have SHA224Update
FOUND_SHA2=no
])
])
])
if test X"$FOUND_SHA2" = X"no"; then
AC_LIBOBJ(sha2)
SUDO_APPEND_COMPAT_EXP(sudo_SHA224Final sudo_SHA224Init sudo_SHA224Pad sudo_SHA224Transform sudo_SHA224Update sudo_SHA256Final sudo_SHA256Init sudo_SHA256Pad sudo_SHA256Transform sudo_SHA256Update sudo_SHA384Final sudo_SHA384Init sudo_SHA384Pad sudo_SHA384Transform sudo_SHA384Update sudo_SHA512Final sudo_SHA512Init sudo_SHA512Pad sudo_SHA512Transform sudo_SHA512Update)
fi
2020-01-21 13:27:40 -07:00
fi
2019-11-15 13:19:28 -07:00
dnl
1999-02-01 00:46:13 +00:00
dnl If socket(2) not in libc, check -lsocket and -linet
1999-01-19 01:00:20 +00:00
dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
1998-10-18 23:42:52 +00:00
dnl
2014-10-01 15:42:07 -06:00
OLIBS="$LIBS"
LIBS="${LIBS} ${NET_LIBS}"
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNC([socket], [], [
2012-01-19 14:19:37 -05:00
for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
_libs=
for lib in $libs; do
case "$NET_LIBS" in
*"$lib"*) ;;
*) _libs="$_libs $lib";;
esac
done
libs="${_libs# }"
test -z "$libs" && continue
lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
2014-07-29 13:06:18 -06:00
SUDO_CHECK_LIB($lib, socket, [NET_LIBS="${NET_LIBS} $libs"; break], [], [$extralibs])
2014-02-03 05:42:39 -07:00
done
])
2014-10-01 15:42:07 -06:00
LIBS="$OLIBS"
2014-02-03 05:42:39 -07:00
dnl
2015-06-30 10:57:42 -06:00
dnl If inet_pton(3) not in libc, check -lnsl and -linet
2014-07-28 16:11:39 -06:00
dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
2015-06-30 10:57:42 -06:00
dnl Some systems may have inet_pton() in libresolv.
2014-07-28 16:11:39 -06:00
dnl
2014-10-01 15:42:07 -06:00
OLIBS="$LIBS"
LIBS="${LIBS} ${NET_LIBS}"
2014-10-02 07:55:08 -06:00
found=false
2015-06-30 10:57:42 -06:00
INET_PTON_LIBS=
AC_CHECK_FUNC([inet_pton], [
2014-10-02 07:55:08 -06:00
found=true
2015-06-30 10:57:42 -06:00
AC_DEFINE(HAVE_INET_PTON)
2014-10-02 07:55:08 -06:00
], [
2014-07-28 16:11:39 -06:00
for libs in "-lsocket" "-linet" "-lsocket -lnsl" "-lresolv"; do
_libs=
for lib in $libs; do
case "$NET_LIBS" in
*"$lib"*) ;;
*) _libs="$_libs $lib";;
esac
done
libs="${_libs# }"
test -z "$libs" && continue
lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
2015-06-30 10:57:42 -06:00
SUDO_CHECK_LIB($lib, inet_pton, [
2014-10-02 07:55:08 -06:00
found=true
2015-06-30 10:57:42 -06:00
AC_DEFINE(HAVE_INET_PTON)
2014-07-28 16:11:39 -06:00
NET_LIBS="${NET_LIBS} $libs"
2015-06-30 10:57:42 -06:00
INET_PTON_LIBS="$libs"
2015-07-09 10:11:25 -06:00
case "$libs" in
*-lresolv*)
AC_DEFINE(NEED_RESOLV_H)
;;
esac
2014-07-28 16:11:39 -06:00
break
], [], [$extralibs])
done
])
2014-10-01 15:42:07 -06:00
LIBS="$OLIBS"
2014-10-23 15:44:03 -06:00
if test X"$found" != X"true"; then
2015-06-30 10:57:42 -06:00
AC_LIBOBJ(inet_pton)
SUDO_APPEND_COMPAT_EXP(sudo_inet_pton)
2014-10-23 15:44:03 -06:00
fi
2014-07-28 16:11:39 -06:00
dnl
2015-06-30 10:57:42 -06:00
dnl If inet_ntop(3) not in libc, check -lnsl and -linet
2014-02-03 05:42:39 -07:00
dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
2015-06-30 10:57:42 -06:00
dnl Some systems may have inet_ntop() in libresolv.
2014-02-03 05:42:39 -07:00
dnl
2014-10-01 15:42:07 -06:00
OLIBS="$LIBS"
LIBS="${LIBS} ${NET_LIBS}"
2014-07-29 10:52:43 -06:00
found=false
2015-06-30 10:57:42 -06:00
AC_CHECK_FUNC([inet_ntop], [
2014-07-29 10:52:43 -06:00
found=true
2015-06-30 10:57:42 -06:00
AC_DEFINE(HAVE_INET_NTOP)
2014-07-29 10:52:43 -06:00
], [
2014-02-02 08:34:53 -07:00
for libs in "-lsocket" "-linet" "-lsocket -lnsl" "-lresolv"; do
2014-01-26 13:23:09 -07:00
_libs=
for lib in $libs; do
case "$NET_LIBS" in
*"$lib"*) ;;
*) _libs="$_libs $lib";;
esac
2012-01-19 14:19:37 -05:00
done
2014-01-26 13:23:09 -07:00
libs="${_libs# }"
test -z "$libs" && continue
lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
2015-06-30 10:57:42 -06:00
SUDO_CHECK_LIB($lib, inet_ntop, [
2014-07-29 10:52:43 -06:00
found=true
2015-06-30 10:57:42 -06:00
AC_DEFINE(HAVE_INET_NTOP)
2014-02-05 10:00:07 -07:00
NET_LIBS="${NET_LIBS} $libs"
break
], [], [$extralibs])
2014-01-26 13:23:09 -07:00
done
2012-01-19 14:19:37 -05:00
])
2014-10-01 15:42:07 -06:00
LIBS="$OLIBS"
2014-07-29 10:52:43 -06:00
if test X"$found" != X"true"; then
2015-06-30 10:57:42 -06:00
AC_LIBOBJ(inet_ntop)
SUDO_APPEND_COMPAT_EXP(sudo_inet_ntop)
2014-02-05 10:00:07 -07:00
fi
1998-11-24 04:38:53 +00:00
dnl
1998-11-03 19:58:47 +00:00
dnl If syslog(3) not in libc, check -lsocket, -lnsl and -linet
dnl
2014-10-01 15:42:07 -06:00
OLIBS="$LIBS"
LIBS="${LIBS} ${NET_LIBS}"
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNC([syslog], [], [
2012-01-19 14:19:37 -05:00
for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
_libs=
for lib in $libs; do
case "$NET_LIBS" in
*"$lib"*) ;;
*) _libs="$_libs $lib";;
esac
done
libs="${_libs# }"
test -z "$libs" && continue
lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
2014-07-29 13:06:18 -06:00
SUDO_CHECK_LIB($lib, syslog, [NET_LIBS="${NET_LIBS} $libs"; break], [], [$extralibs])
2012-01-19 14:19:37 -05:00
done
])
2014-10-01 15:42:07 -06:00
LIBS="$OLIBS"
2013-11-20 12:04:47 -07:00
#
2014-07-30 15:08:05 -06:00
# Check for getaddrinfo and add any required libs to NET_LIBS.
# If it was added to LIBOBJS we need to export the symbols.
2013-11-20 12:04:47 -07:00
#
OLIBS="$LIBS"
2018-11-05 09:08:05 -07:00
GETADDRINFO_LIBS=
2013-11-20 12:04:47 -07:00
AX_FUNC_GETADDRINFO
2014-07-30 15:08:05 -06:00
case " $LIBOBJS " in
*" getaddrinfo.$ac_objext "* )
SUDO_APPEND_COMPAT_EXP(sudo_getaddrinfo sudo_freeaddrinfo sudo_gai_strerror)
# We need libsudo_util to pull in dependent libraries for
# inet_pton(), gethostbyname(), and getservbyname()
if test -n "${INET_PTON_LIBS}"; then
LT_DEP_LIBS="${LT_DEP_LIBS}${LT_DEP_LIBS+ }${INET_PTON_LIBS}"
LIBS="${LIBS}${LIBS+ }${INET_PTON_LIBS}"
fi
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNC([gethostbyname], [], [
2014-07-30 15:08:05 -06:00
for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
_libs=
for lib in $libs; do
case "$LT_DEP_LIBS" in
*"$lib"*) ;;
*) _libs="$_libs $lib";;
esac
done
libs="${_libs# }"
test -z "$libs" && continue
lib="`echo \"$libs\"|sed -e 's/^-l//' -e 's/ .*$//'`"
extralibs="`echo \"$libs\"|sed 's/^-l[[^ ]]*//'`"
SUDO_CHECK_LIB($lib, gethostbyname, [LT_DEP_LIBS="${LT_DEP_LIBS} $libs"; break], [], [$extralibs])
2014-07-29 13:06:18 -06:00
done
2014-07-30 15:08:05 -06:00
])
;;
*)
for lib in $LIBS; do
2018-11-05 09:08:05 -07:00
case "$OLIBS" in
2014-07-30 15:08:05 -06:00
*"$lib"*) ;;
2018-11-05 09:08:05 -07:00
*) GETADDRINFO_LIBS="${GETADDRINFO_LIBS}${GETADDRINFO_LIBS+ }$lib";;
2014-07-30 15:08:05 -06:00
esac
2014-07-29 13:06:18 -06:00
done
2018-11-05 09:08:05 -07:00
if test -n "${GETADDRINFO_LIBS}"; then
# We need libsudo_util to pull in dependent libraries for
# gai_strerror()
LT_DEP_LIBS="${LT_DEP_LIBS}${LT_DEP_LIBS+ }${GETADDRINFO_LIBS}"
LIBS="${LIBS}${LIBS+ }${GETADDRINFO_LIBS}"
# Add to NET_LIBS if necessary
for lib in $GETADDRINFO_LIBS; do
case "$NET_LIBS" in
*"$lib"*) ;;
*) NET_LIBS="${NET_LIBS}${NET_LIBS+ }$lib";;
esac
done
fi
2014-07-30 15:08:05 -06:00
;;
esac
2014-07-29 13:06:18 -06:00
LIBS="$OLIBS"
2014-07-29 10:52:43 -06:00
2012-01-06 20:02:12 -05:00
dnl
2021-01-06 13:01:09 -07:00
dnl Check for getprogname()/setprogname() or __progname
2003-04-02 18:15:25 +00:00
dnl
2021-01-06 13:01:09 -07:00
AC_CHECK_FUNCS([getprogname], [
AC_CHECK_FUNCS([setprogname], [], [SUDO_APPEND_COMPAT_EXP(sudo_setprogname)])
], [
2003-04-02 18:15:25 +00:00
AC_MSG_CHECKING([for __progname])
AC_CACHE_VAL(sudo_cv___progname, [
2020-06-20 13:51:02 -06:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *__progname; if (__progname[0] == '\0') return 1;]])], [sudo_cv___progname=yes], [sudo_cv___progname=no])])
2003-04-02 18:15:25 +00:00
if test "$sudo_cv___progname" = "yes"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(HAVE___PROGNAME)
2003-04-02 18:15:25 +00:00
fi
AC_MSG_RESULT($sudo_cv___progname)
2014-07-29 10:52:43 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_getprogname)
2021-01-06 13:01:09 -07:00
SUDO_APPEND_COMPAT_EXP(sudo_setprogname)
2003-04-02 18:15:25 +00:00
])
2011-10-22 14:20:52 -04:00
dnl
dnl Check for __func__ or __FUNCTION__
dnl
AC_MSG_CHECKING([for __func__])
AC_CACHE_VAL(sudo_cv___func__, [
2020-06-20 13:51:02 -06:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[if (__func__[0] == '\0') return 1;]])], [sudo_cv___func__=yes], [sudo_cv___func__=no])])
2011-10-22 14:20:52 -04:00
AC_MSG_RESULT($sudo_cv___func__)
if test "$sudo_cv___func__" = "yes"; then
AC_DEFINE(HAVE___FUNC__)
elif test -n "$GCC"; then
AC_MSG_CHECKING([for __FUNCTION__])
AC_CACHE_VAL(sudo_cv___FUNCTION__, [
2020-06-20 13:51:02 -06:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[if(__FUNCTION__[0] == '\0') return 1;]])], [sudo_cv___FUNCTION__=yes], [sudo_cv___FUNCTION__=no])])
2011-10-22 14:20:52 -04:00
AC_MSG_RESULT($sudo_cv___FUNCTION__)
if test "$sudo_cv___FUNCTION__" = "yes"; then
AC_DEFINE(HAVE___FUNC__)
2013-03-21 16:35:18 -04:00
AC_DEFINE(__func__, __FUNCTION__, [Define to __FUNCTION__ if your compiler supports __FUNCTION__ but not __func__])
2011-10-22 14:20:52 -04:00
fi
fi
2007-09-05 22:16:22 +00:00
2011-05-04 15:26:31 -04:00
# gettext() and friends may be located in libc (Linux and Solaris)
# or in libintl. However, it is possible to have libintl installed
# even when gettext() is present in libc. In the case of GNU libintl,
# gettext() will be defined to gettext_libintl in libintl.h.
# Since gcc prefers /usr/local/include to /usr/include, we need to
# make sure we use the gettext() that matches the include file.
2011-05-29 14:33:18 -04:00
if test "$enable_nls" != "no"; then
if test "$enable_nls" != "yes"; then
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${enable_nls}/include], [CPPFLAGS])
2011-05-29 14:33:18 -04:00
SUDO_APPEND_LIBPATH(LDFLAGS, [$enable_nls/lib])
fi
2011-08-15 10:21:13 -04:00
OLIBS="$LIBS"
for l in "libc" "-lintl" "-lintl -liconv"; do
if test "$l" = "libc"; then
# If user specified a dir for libintl ignore libc
if test "$enable_nls" != "yes"; then
continue
fi
2011-08-15 13:41:58 -04:00
gettext_name=sudo_cv_gettext
AC_MSG_CHECKING([for gettext])
2011-08-15 10:21:13 -04:00
else
LIBS="$OLIBS $l"
2011-08-15 13:41:58 -04:00
gettext_name=sudo_cv_gettext"`echo $l|sed -e 's/ //g' -e 's/-/_/g'`"
AC_MSG_CHECKING([for gettext in $l])
2011-08-15 10:21:13 -04:00
fi
2011-08-15 13:41:58 -04:00
AC_CACHE_VAL($gettext_name, [
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM([[#include <libintl.h>]], [(void)gettext((char *)0);])
], [eval $gettext_name=yes], [eval $gettext_name=no]
)
])
eval gettext_result="\$$gettext_name"
AC_MSG_RESULT($gettext_result)
2012-06-18 14:29:06 -04:00
if test "$gettext_result" = "yes"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([ngettext])
2012-06-18 14:29:06 -04:00
break
fi
2011-08-15 10:21:13 -04:00
done
LIBS="$OLIBS"
2011-08-15 13:41:58 -04:00
if test "$sudo_cv_gettext" = "yes"; then
2011-06-18 13:11:27 -04:00
SUDO_NLS=enabled
2012-11-08 14:45:22 -05:00
# For Solaris we need links from lang to lang.UTF-8 in localedir
2013-03-19 15:59:23 -04:00
case "$host_os" in
solaris2*) LOCALEDIR_SUFFIX=".UTF-8";;
2012-11-08 14:45:22 -05:00
esac
2011-08-15 13:41:58 -04:00
elif test "$sudo_cv_gettext_lintl" = "yes"; then
SUDO_NLS=enabled
LIBINTL="-lintl"
elif test "$sudo_cv_gettext_lintl_liconv" = "yes"; then
SUDO_NLS=enabled
LIBINTL="-lintl -liconv"
2011-05-28 09:18:46 -04:00
fi
2015-02-17 06:42:10 -07:00
if test X"$SUDO_NLS" = X"enabled"; then
2015-05-11 14:51:32 -06:00
AC_DEFINE(HAVE_LIBINTL_H)
2015-02-17 06:42:10 -07:00
SUDO_APPEND_COMPAT_EXP(sudo_warn_gettext_v1)
fi
2011-05-09 10:58:52 -04:00
fi
2011-05-04 15:26:31 -04:00
2010-07-15 09:49:32 -04:00
dnl
2010-10-28 11:17:40 -04:00
dnl Deferred zlib option processing.
dnl By default we use the system zlib if it is present.
2012-03-29 10:32:29 -04:00
dnl If a directory was specified for zlib (or we are use sudo's version),
dnl prepend the include dir to make sure we get the right zlib header.
2010-07-15 09:49:32 -04:00
dnl
2011-05-29 14:33:18 -04:00
case "$enable_zlib" in
2010-10-28 11:17:40 -04:00
yes)
AC_CHECK_LIB(z, gzdopen, [
2015-01-15 21:00:01 -07:00
AC_CHECK_HEADERS([zlib.h], [ZLIB="-lz"], [enable_zlib=builtin])
2010-10-28 11:17:40 -04:00
])
;;
no)
;;
system)
AC_DEFINE(HAVE_ZLIB_H)
ZLIB="-lz"
;;
2014-10-27 14:39:07 -06:00
static|shared|builtin)
2010-10-28 11:17:40 -04:00
# handled below
;;
*)
AC_DEFINE(HAVE_ZLIB_H)
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${enable_zlib}/include], [CPPFLAGS])
2010-10-28 11:17:40 -04:00
SUDO_APPEND_LIBPATH(ZLIB, [$enable_zlib/lib])
ZLIB="${ZLIB} -lz"
;;
esac
2014-10-27 14:39:07 -06:00
case "$enable_zlib" in
builtin|static|dynamic)
AC_DEFINE(HAVE_ZLIB_H)
2016-11-17 10:16:51 -07:00
# XXX - can't use AX_APPEND_FLAG due to use of $(top_foo) and quoting
2014-10-27 14:39:07 -06:00
CPPFLAGS='-I$(top_builddir)/lib/zlib -I$(top_srcdir)/lib/zlib '"${CPPFLAGS}"
ZLIB="${ZLIB}"' $(top_builddir)/lib/zlib/libsudo_z.la'
ZLIB_SRC=lib/zlib
2020-07-15 10:12:55 -06:00
AC_CONFIG_HEADERS([lib/zlib/zconf.h])
2014-10-27 14:39:07 -06:00
AC_CONFIG_FILES([lib/zlib/Makefile])
if test X"$enable_shared" = X"no" -o "$enable_zlib" = "static"; then
if test "$enable_zlib" = "shared"; then
AC_MSG_ERROR(["Unable to build shared libraries on this system"])
fi
# Build as convenience library
ZLIB_LDFLAGS=-no-install
fi
;;
esac
2010-07-15 09:49:32 -04:00
2011-08-30 10:05:30 -04:00
dnl
dnl Check for errno declaration in errno.h
dnl
AC_CHECK_DECLS([errno], [], [], [
AC_INCLUDES_DEFAULT
#include <errno.h>
])
2011-12-02 17:28:50 -05:00
dnl
dnl Check for h_errno declaration in netdb.h
dnl
AC_CHECK_DECLS([h_errno], [], [], [
AC_INCLUDES_DEFAULT
#include <netdb.h>
])
2015-01-15 17:01:30 -07:00
dnl
2015-02-03 07:33:26 -07:00
dnl Check for incomplete limits.h and missing SIZE_MAX.
2015-01-15 17:01:30 -07:00
dnl
2021-02-08 18:38:17 -07:00
AC_CHECK_DECLS([LLONG_MAX, LLONG_MIN, ULLONG_MAX, PATH_MAX, SSIZE_MAX], [], [], [
2015-01-15 17:01:30 -07:00
#include <sys/types.h>
#include <limits.h>
])
2015-02-02 14:36:38 -07:00
AC_CHECK_DECLS([SIZE_MAX], [], [], [
#include <sys/types.h>
2015-02-03 07:33:26 -07:00
#include <limits.h>
2015-02-03 10:00:30 -07:00
#if defined(HAVE_STDINT_H)
# include <stdint.h>
#elif defined(HAVE_INTTYPES_H)
2015-02-02 14:36:38 -07:00
# include <inttypes.h>
#endif
])
2015-01-15 17:01:30 -07:00
dnl
dnl Try to find equivalents for missing types
dnl
if test "$ac_cv_have_decl_LLONG_MAX" != "yes"; then
AC_CHECK_DECLS([QUAD_MAX], [], [], [[
#include <sys/types.h>
#include <limits.h>
]])
fi
if test "$ac_cv_have_decl_LLONG_MIN" != "yes"; then
AC_CHECK_DECLS([QUAD_MIN], [], [], [[
#include <sys/types.h>
#include <limits.h>
]])
fi
if test "$ac_cv_have_decl_ULLONG_MAX" != "yes"; then
AC_CHECK_DECLS([UQUAD_MAX], [], [], [[
#include <sys/types.h>
#include <limits.h>
]])
fi
if test "$ac_cv_have_decl_SIZE_MAX" != "yes"; then
AC_CHECK_DECLS([SIZE_T_MAX], [], [], [[
#include <sys/types.h>
#include <limits.h>
]])
fi
if test "$ac_cv_have_decl_PATH_MAX" != "yes"; then
AC_CHECK_DECLS([_POSIX_PATH_MAX], [], [], [[
#include <sys/types.h>
#include <limits.h>
]])
fi
2009-10-14 20:04:04 +00:00
dnl
dnl Check for strsignal() or sys_siglist
dnl
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([strsignal], [], [
2010-04-02 07:47:19 -04:00
AC_LIBOBJ(strsignal)
2014-07-29 10:52:43 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_strsignal)
2010-04-02 07:47:19 -04:00
HAVE_SIGLIST="false"
2015-09-10 16:44:57 -06:00
AC_CHECK_DECLS([sys_siglist, _sys_siglist], [
2010-04-02 07:47:19 -04:00
HAVE_SIGLIST="true"
], [ ], [
2010-03-12 05:26:01 -05:00
AC_INCLUDES_DEFAULT
#include <signal.h>
2010-04-02 07:47:19 -04:00
])
if test "$HAVE_SIGLIST" != "true"; then
AC_LIBOBJ(siglist)
fi
])
2009-10-14 20:04:04 +00:00
2012-08-26 20:12:51 -04:00
dnl
2019-08-05 16:30:58 -06:00
dnl Check for sig2str() and str2sig(), sys_signame or sys_sigabbrev
2012-08-26 20:12:51 -04:00
dnl
2015-05-07 07:34:50 -06:00
AC_CHECK_FUNCS([sig2str], [
AC_CHECK_DECLS(SIG2STR_MAX, [], [], [
# include <signal.h>
])], [
2012-08-29 14:25:09 -04:00
AC_LIBOBJ(sig2str)
2014-07-29 10:52:43 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_sig2str)
2019-08-05 16:30:58 -06:00
])
AC_CHECK_FUNCS([str2sig], [], [
AC_LIBOBJ(str2sig)
SUDO_APPEND_COMPAT_EXP(sudo_str2sig)
])
dnl
dnl Check for sys_signame or sys_sigabbrev if missing sig2str() or str2sig().
2019-08-19 08:37:08 -06:00
dnl Also enable unit tests for sig2str() and str2sig().
2019-08-05 16:30:58 -06:00
dnl
if test x"${ac_cv_func_sig2str}${ac_cv_func_str2sig}" != x"yesyes"; then
2020-08-25 16:48:13 -06:00
AC_CHECK_FUNCS([sigabbrev_np])
if test x"${ac_cv_func_sigabbrev_np}" != x"yes"; then
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }strsig_test"
HAVE_SIGNAME="false"
AC_CHECK_DECLS([sys_signame, _sys_signame, sys_sigabbrev], [
HAVE_SIGNAME="true"
], [ ], [
2012-08-26 20:12:51 -04:00
AC_INCLUDES_DEFAULT
#include <signal.h>
2020-08-25 16:48:13 -06:00
])
if test "$HAVE_SIGNAME" != "true"; then
AC_CACHE_CHECK([for undeclared sys_sigabbrev],
[sudo_cv_var_sys_sigabbrev],
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[extern char **sys_sigabbrev;]], [[return sys_sigabbrev[1];]])],
[sudo_cv_var_sys_sigabbrev=yes],
[sudo_cv_var_sys_sigabbrev=no]
)
]
)
if test "$sudo_cv_var_sys_sigabbrev" = yes; then
AC_DEFINE(HAVE_SYS_SIGABBREV)
else
AC_LIBOBJ(signame)
SIGNAME=signame.lo
fi
2012-08-28 10:11:38 -04:00
fi
2012-08-26 20:12:51 -04:00
fi
2019-08-05 16:30:58 -06:00
fi
2012-08-26 20:12:51 -04:00
2018-05-24 21:04:23 -06:00
dnl
dnl Check for dl_iterate_phdr, may require -ldl
dnl
OLIBS="$LIBS"
LIBS="$LIBS $lt_cv_dlopen_libs"
AC_CHECK_FUNCS([dl_iterate_phdr])
LIBS="$OLIBS"
2009-03-10 20:44:05 +00:00
dnl
dnl nsswitch.conf and its equivalents
dnl
if test ${with_netsvc-"no"} != "no"; then
SUDO_DEFINE_UNQUOTED(_PATH_NETSVC_CONF, "${with_netsvc-/etc/netsvc.conf}")
netsvc_conf=${with_netsvc-/etc/netsvc.conf}
elif test ${with_nsswitch-"yes"} != "no"; then
SUDO_DEFINE_UNQUOTED(_PATH_NSSWITCH_CONF, "${with_nsswitch-/etc/nsswitch.conf}")
nsswitch_conf=${with_nsswitch-/etc/nsswitch.conf}
fi
2007-09-05 22:16:22 +00:00
dnl
dnl Mutually exclusive auth checks come first, followed by
dnl non-exclusive ones. Note: passwd must be last of all!
dnl
dnl
dnl Convert default authentication methods to with_* if
dnl no explicit authentication scheme was specified.
dnl
if test -z "${AUTH_EXCL}${AUTH_REG}" -a -n "$AUTH_EXCL_DEF"; then
for auth in $AUTH_EXCL_DEF; do
case $auth in
AIX_AUTH) with_aixauth=maybe;;
BSD_AUTH) with_bsdauth=maybe;;
PAM) with_pam=maybe;;
SIA) CHECKSIA=true;;
esac
done
fi
dnl
dnl PAM support. Systems that use PAM by default set with_pam=default
dnl and we do the actual tests here.
dnl
if test ${with_pam-"no"} != "no"; then
2012-02-01 11:27:50 -05:00
#
# Check for pam_start() in libpam first, then for pam_appl.h.
#
found_pam_lib=no
AC_CHECK_LIB(pam, pam_start, [found_pam_lib=yes], [], [$lt_cv_dlopen_libs])
#
2017-06-02 16:10:37 -06:00
# Some PAM implementations (macOS for example) put the PAM headers
2012-02-01 11:27:50 -05:00
# in /usr/include/pam instead of /usr/include/security...
#
found_pam_hdrs=no
AC_CHECK_HEADERS([security/pam_appl.h] [pam/pam_appl.h], [found_pam_hdrs=yes; break])
if test "$found_pam_lib" = "yes" -a "$found_pam_hdrs" = "yes"; then
# Found both PAM libs and headers
with_pam=yes
elif test "$with_pam" = "yes"; then
if test "$found_pam_lib" = "no"; then
AC_MSG_ERROR(["--with-pam specified but unable to locate PAM development library."])
fi
if test "$found_pam_hdrs" = "no"; then
AC_MSG_ERROR(["--with-pam specified but unable to locate PAM development headers."])
fi
elif test "$found_pam_lib" != "$found_pam_hdrs"; then
if test "$found_pam_lib" = "no"; then
AC_MSG_ERROR(["found PAM headers but no PAM development library; specify --without-pam to build without PAM"])
fi
if test "$found_pam_hdrs" = "no"; then
AC_MSG_ERROR(["found PAM library but no PAM development headers; specify --without-pam to build without PAM"])
fi
fi
2007-09-05 22:16:22 +00:00
if test "$with_pam" = "yes"; then
2012-03-14 20:55:11 -04:00
# Older PAM implementations lack pam_getenvlist
OLIBS="$LIBS"
LIBS="$LIBS -lpam $lt_cv_dlopen_libs"
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([pam_getenvlist])
2012-03-14 20:55:11 -04:00
LIBS="$OLIBS"
2012-02-01 11:27:50 -05:00
# We already link with -ldl if needed (see LIBDL below)
SUDOERS_LIBS="${SUDOERS_LIBS} -lpam"
2007-09-05 22:16:22 +00:00
AC_DEFINE(HAVE_PAM)
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS pam.lo";
2007-09-05 22:16:22 +00:00
AUTH_EXCL=PAM
2010-07-12 17:57:53 -04:00
AC_ARG_WITH(pam-login, [AS_HELP_STRING([--with-pam-login], [enable specific PAM session for sudo -i])],
[case $with_pam_login in
yes) AC_DEFINE([HAVE_PAM_LOGIN])
AC_MSG_CHECKING(whether to use PAM login)
AC_MSG_RESULT(yes)
2013-08-06 11:01:36 -06:00
pam_login_service="sudo-i"
2010-07-12 17:57:53 -04:00
;;
no) ;;
*) AC_MSG_ERROR(["--with-pam-login does not take an argument."])
;;
esac])
2007-10-09 00:04:48 +00:00
AC_MSG_CHECKING(whether to use PAM session support)
AC_ARG_ENABLE(pam_session,
2009-06-13 20:52:50 +00:00
[AS_HELP_STRING([--disable-pam-session], [Disable PAM session support])],
2007-10-09 00:04:48 +00:00
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
;;
2013-02-24 06:15:37 -05:00
no) AC_MSG_RESULT(no)
AC_DEFINE(NO_PAM_SESSION)
pam_session=off
;;
*) AC_MSG_RESULT(no)
AC_MSG_WARN([Ignoring unknown argument to --enable-pam-session: $enableval])
;;
2007-10-09 00:04:48 +00:00
esac], AC_MSG_RESULT(yes))
2007-09-05 22:16:22 +00:00
fi
fi
dnl
dnl AIX general authentication
2015-02-23 11:12:43 -07:00
dnl We may build in support for both AIX LAM and PAM and select
dnl which one to use at run-time.
2007-09-05 22:16:22 +00:00
dnl
if test ${with_aixauth-'no'} != "no"; then
2015-02-23 11:12:43 -07:00
AC_CHECK_FUNCS([authenticate], [with_aixauth=yes])
if test "${with_aixauth}" = "yes"; then
2007-09-05 22:16:22 +00:00
AC_MSG_NOTICE([using AIX general authentication])
AC_DEFINE(HAVE_AIXAUTH)
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS aix_auth.lo";
2011-03-04 08:26:48 -05:00
SUDOERS_LIBS="${SUDOERS_LIBS} -ls"
2007-09-05 22:16:22 +00:00
AUTH_EXCL=AIX_AUTH
fi
fi
dnl
dnl BSD authentication
dnl If set to "maybe" only enable if no other exclusive method in use.
dnl
if test ${with_bsdauth-'no'} != "no"; then
AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H)
2010-03-06 07:36:02 -05:00
[AUTH_OBJS="$AUTH_OBJS bsdauth.lo"]
2013-08-14 10:30:51 -06:00
[BSDAUTH_USAGE='[[-a type]] ']
2010-05-25 16:13:04 -04:00
[AUTH_EXCL=BSD_AUTH; BAMAN=1],
2007-09-05 22:16:22 +00:00
[AC_MSG_ERROR([BSD authentication was specified but bsd_auth.h could not be found])])
fi
dnl
dnl SIA authentication for Tru64 Unix
dnl
if test ${CHECKSIA-'false'} = "true"; then
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([sia_ses_init], [found=true], [found=false])
2007-09-05 22:16:22 +00:00
if test "$found" = "true"; then
AUTH_EXCL=SIA
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS sia.lo"
2007-09-05 22:16:22 +00:00
fi
fi
dnl
dnl extra FWTK libs + includes
dnl
if test ${with_fwtk-'no'} != "no"; then
if test "$with_fwtk" != "yes"; then
2010-03-11 17:21:34 -05:00
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_fwtk}])
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${with_fwtk}], [CPPFLAGS])
2007-09-05 22:16:22 +00:00
with_fwtk=yes
fi
2011-03-04 08:26:48 -05:00
SUDOERS_LIBS="${SUDOERS_LIBS} -lauth -lfwall"
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS fwtk.lo"
2007-09-05 22:16:22 +00:00
fi
dnl
dnl extra SecurID lib + includes
dnl
if test ${with_SecurID-'no'} != "no"; then
if test "$with_SecurID" != "yes"; then
:
elif test -d /usr/ace/examples; then
with_SecurID=/usr/ace/examples
else
with_SecurID=/usr/ace
fi
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${with_SecurID}], [CPPFLAGS])
2013-03-19 11:52:54 -04:00
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_SecurID}])
2011-11-13 11:54:06 -05:00
SUDOERS_LIBS="${SUDOERS_LIBS} -laceclnt -lpthread"
AUTH_OBJS="$AUTH_OBJS securid5.lo";
2007-09-05 22:16:22 +00:00
fi
dnl
dnl Non-mutually exclusive auth checks come next.
dnl Note: passwd must be last of all!
dnl
dnl
dnl Convert default authentication methods to with_* if
dnl no explicit authentication scheme was specified.
dnl
if test -z "${AUTH_EXCL}" -a -n "$AUTH_DEF"; then
for auth in $AUTH_DEF; do
case $auth in
passwd) : ${with_passwd='maybe'};;
esac
done
fi
2003-03-19 21:16:57 +00:00
dnl
dnl Kerberos V
2003-04-02 18:44:52 +00:00
dnl There is an easy way and a hard way...
dnl
2007-09-05 22:16:22 +00:00
if test ${with_kerb5-'no'} != "no"; then
2003-04-02 18:44:52 +00:00
AC_CHECK_PROG(KRB5CONFIG, krb5-config, yes, "")
if test -n "$KRB5CONFIG"; then
2004-09-08 15:49:26 +00:00
AC_DEFINE(HAVE_KERB5)
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS kerb5.lo"
2021-02-12 07:16:32 -07:00
for f in `krb5-config --cflags`; do
AX_APPEND_FLAG([$f], [CPPFLAGS])
done
2011-03-04 08:26:48 -05:00
SUDOERS_LIBS="$SUDOERS_LIBS `krb5-config --libs`"
2003-04-04 17:45:24 +00:00
dnl
dnl Try to determine whether we have Heimdal or MIT Kerberos
dnl
AC_MSG_CHECKING(whether we are using Heimdal)
2005-06-25 18:04:30 +00:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[const char *tmp = heimdal_version;]])], [
2003-04-04 17:45:24 +00:00
AC_MSG_RESULT(yes)
2004-09-08 15:49:26 +00:00
AC_DEFINE(HAVE_HEIMDAL)
2007-06-09 11:24:49 +00:00
], [
AC_MSG_RESULT(no)
2003-04-04 17:45:24 +00:00
]
)
1999-10-13 02:34:55 +00:00
else
2011-04-18 09:22:26 -04:00
AC_DEFINE(HAVE_KERB5)
dnl
dnl Use the specified directory, if any, else search for correct inc dir
dnl
if test "$with_kerb5" = "yes"; then
found=no
O_CPPFLAGS="$CPPFLAGS"
for dir in "" "kerberosV/" "krb5/" "kerberos5/" "kerberosv5/"; do
CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
2011-08-11 14:25:01 -04:00
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]])], [found=yes; break])
2011-04-18 09:22:26 -04:00
done
if test X"$found" = X"no"; then
CPPFLAGS="$O_CPPFLAGS"
AC_MSG_WARN([Unable to locate Kerberos V include files, you will have to edit the Makefile and add -I/path/to/krb/includes to CPPFLAGS])
fi
else
dnl XXX - try to include krb5.h here too
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_kerb5}/lib])
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${with_kerb5}/include], [CPPFLAGS])
2011-04-18 09:22:26 -04:00
fi
1999-10-13 02:34:55 +00:00
2011-04-18 09:22:26 -04:00
dnl
dnl Try to determine whether we have Heimdal or MIT Kerberos
dnl
AC_MSG_CHECKING(whether we are using Heimdal)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[const char *tmp = heimdal_version;]])], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_HEIMDAL)
# XXX - need to check whether -lcrypo is needed!
SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5 -lcrypto -ldes -lcom_err -lasn1"
AC_CHECK_LIB(roken, main, [SUDOERS_LIBS="${SUDOERS_LIBS} -lroken"])
], [
AC_MSG_RESULT(no)
SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5 -lk5crypto -lcom_err"
AC_CHECK_LIB(krb5support, main, [SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5support"])
])
AUTH_OBJS="$AUTH_OBJS kerb5.lo"
fi
2007-06-09 11:24:49 +00:00
_LIBS="$LIBS"
2011-03-04 08:26:48 -05:00
LIBS="${LIBS} ${SUDOERS_LIBS}"
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([krb5_verify_user krb5_init_secure_context])
AC_CHECK_FUNCS([krb5_get_init_creds_opt_alloc], [
2009-11-04 14:42:04 +00:00
AC_CACHE_CHECK([whether krb5_get_init_creds_opt_free takes a context],
sudo_cv_krb5_get_init_creds_opt_free_two_args, [
2013-11-13 14:45:47 -07:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]],
2010-05-21 15:53:39 -04:00
[[krb5_get_init_creds_opt_free(NULL, NULL);]]
)],
2009-11-04 14:42:04 +00:00
[sudo_cv_krb5_get_init_creds_opt_free_two_args=yes],
[sudo_cv_krb5_get_init_creds_opt_free_two_args=no]
)
]
)
])
2008-10-23 16:06:23 +00:00
if test X"$sudo_cv_krb5_get_init_creds_opt_free_two_args" = X"yes"; then
AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS)
fi
2007-06-09 11:24:49 +00:00
LIBS="$_LIBS"
2012-01-05 15:39:05 -05:00
AC_MSG_CHECKING(whether to use an instance name for Kerberos V)
AC_ARG_ENABLE(kerb5-instance,
[AS_HELP_STRING([--enable-kerb5-instance], [instance string to append to the username (separated by a slash)])],
[ case "$enableval" in
yes) AC_MSG_ERROR(["must give --enable-kerb5-instance an argument."])
;;
no) AC_MSG_RESULT(no)
;;
*) SUDO_DEFINE_UNQUOTED(SUDO_KRB5_INSTANCE, "$enableval")
AC_MSG_RESULT([$enableval])
;;
esac], AC_MSG_RESULT(no))
1999-06-22 13:30:25 +00:00
fi
1995-06-18 17:58:42 +00:00
dnl
1996-07-08 20:08:33 +00:00
dnl extra AFS libs and includes
1995-06-18 17:58:42 +00:00
dnl
2007-09-05 22:16:22 +00:00
if test ${with_AFS-'no'} = "yes"; then
1996-07-08 20:08:33 +00:00
# looks like the "standard" place for AFS libs is /usr/afsws/lib
AFSLIBDIRS="/usr/lib/afs /usr/afsws/lib /usr/afsws/lib/afs"
for i in $AFSLIBDIRS; do
if test -d ${i}; then
2010-03-11 17:21:34 -05:00
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [$i])
1996-07-08 20:08:33 +00:00
FOUND_AFSLIBDIR=true
fi
done
if test -z "$FOUND_AFSLIBDIR"; then
2010-03-11 17:21:34 -05:00
AC_MSG_WARN([Unable to locate AFS libraries, you will have to edit the Makefile and add -L/path/to/afs/libs to SUDOERS_LDFLAGS or rerun configure with the --with-libpath options.])
1995-06-18 17:58:42 +00:00
fi
1996-07-08 20:08:33 +00:00
# Order is important here. Note that we build AFS_LIBS from right to left
# since AFS_LIBS may be initialized with BSD compat libs that must go last
AFS_LIBS="-laudit ${AFS_LIBS}"
for i in $AFSLIBDIRS; do
if test -f ${i}/util.a; then
AFS_LIBS="${i}/util.a ${AFS_LIBS}"
FOUND_UTIL_A=true
break;
fi
done
if test -z "$FOUND_UTIL_A"; then
AFS_LIBS="-lutil ${AFS_LIBS}"
fi
AFS_LIBS="-lkauth -lprot -lubik -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err ${AFS_LIBS}"
# AFS includes may live in /usr/include on some machines...
for i in /usr/afsws/include; do
if test -d ${i}; then
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${i}], [CPPFLAGS])
1996-07-08 20:08:33 +00:00
FOUND_AFSINCDIR=true
fi
done
if test -z "$FOUND_AFSLIBDIR"; then
2003-03-21 01:28:41 +00:00
AC_MSG_WARN([Unable to locate AFS include dir, you may have to edit the Makefile and add -I/path/to/afs/includes to CPPFLAGS or rerun configure with the --with-incpath options.])
1996-07-08 20:08:33 +00:00
fi
2007-09-05 22:16:22 +00:00
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS afs.lo"
1995-06-18 17:58:42 +00:00
fi
dnl
1996-05-25 22:07:46 +00:00
dnl extra DCE obj + lib
dnl Order of libs in HP-UX 10.x is important, -ldce must be last.
1995-11-20 03:31:20 +00:00
dnl
2007-09-05 22:16:22 +00:00
if test ${with_DCE-'no'} = "yes"; then
1996-04-02 23:48:08 +00:00
DCE_OBJS="${DCE_OBJS} dce_pwent.o"
2011-03-04 08:26:48 -05:00
SUDOERS_LIBS="${SUDOERS_LIBS} -ldce"
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS dce.lo"
1995-11-20 03:31:20 +00:00
fi
dnl
1996-10-05 03:59:53 +00:00
dnl extra S/Key lib and includes
1995-11-20 03:31:20 +00:00
dnl
2011-04-06 09:33:07 -04:00
if test "${with_skey-'no'}" = "yes"; then
2003-03-21 01:28:41 +00:00
O_LDFLAGS="$LDFLAGS"
if test "$with_skey" != "yes"; then
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${with_skey}/include], [CPPFLAGS])
2013-03-19 11:52:54 -04:00
LDFLAGS="$LDFLAGS -L${with_skey}/lib"
2010-03-11 17:21:34 -05:00
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_skey}/lib])
2011-04-06 10:08:57 -04:00
AC_CHECK_HEADER([skey.h], [found=yes], [found=no], [#include <stdio.h>])
1995-11-19 23:25:51 +00:00
else
2003-03-21 01:28:41 +00:00
found=no
O_CPPFLAGS="$CPPFLAGS"
for dir in "" "/usr/local" "/usr/contrib"; do
test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include"
2013-11-15 15:16:47 -07:00
AC_CHECK_HEADER([skey.h], [found=yes; break], [], [#include <stdio.h>])
2003-03-21 01:28:41 +00:00
done
if test "$found" = "no" -o -z "$dir"; then
CPPFLAGS="$O_CPPFLAGS"
else
2013-03-19 11:52:54 -04:00
LDFLAGS="$LDFLAGS -L${dir}/lib"
2010-03-11 17:21:34 -05:00
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${dir}/lib])
2003-03-21 01:28:41 +00:00
fi
2011-03-04 08:22:35 -05:00
if test "$found" = "no"; then
AC_MSG_WARN([Unable to locate skey.h, you will have to edit the Makefile and add -I/path/to/skey/includes to CPPFLAGS])
fi
2003-03-21 01:28:41 +00:00
fi
2010-03-11 17:21:34 -05:00
AC_CHECK_LIB(skey, main, [found=yes], [AC_MSG_WARN([Unable to locate libskey.a, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDOERS_LDFLAGS])])
2004-09-08 15:49:26 +00:00
AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS))
2011-04-06 10:08:57 -04:00
AC_MSG_CHECKING([for RFC1938-compliant skeychallenge])
AC_COMPILE_IFELSE(
2013-11-13 14:45:47 -07:00
[AC_LANG_PROGRAM([[
# include <stdio.h>
# include <skey.h>]],
2011-04-06 10:08:57 -04:00
[[skeychallenge(NULL, NULL, NULL, 0);]]
)], [
AC_DEFINE(HAVE_RFC1938_SKEYCHALLENGE)
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
]
)
2003-03-21 01:28:41 +00:00
LDFLAGS="$O_LDFLAGS"
2011-03-04 08:26:48 -05:00
SUDOERS_LIBS="${SUDOERS_LIBS} -lskey"
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS rfc1938.lo"
1995-06-18 17:58:42 +00:00
fi
1996-10-05 03:59:53 +00:00
dnl
dnl extra OPIE lib and includes
dnl
2011-04-06 09:33:07 -04:00
if test "${with_opie-'no'}" = "yes"; then
2003-03-21 01:28:41 +00:00
O_LDFLAGS="$LDFLAGS"
if test "$with_opie" != "yes"; then
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${with_opie}/include], [CPPFLAGS])
2013-03-19 11:52:54 -04:00
LDFLAGS="$LDFLAGS -L${with_opie}/lib"
2010-03-11 17:21:34 -05:00
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_opie}/lib])
2011-08-11 14:25:01 -04:00
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <opie.h>]])], [found=yes], [found=no])
1996-10-05 03:59:53 +00:00
else
2003-03-21 01:28:41 +00:00
found=no
O_CPPFLAGS="$CPPFLAGS"
for dir in "" "/usr/local" "/usr/contrib"; do
test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include"
2011-08-11 14:25:01 -04:00
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include <opie.h>]])], [found=yes; break])
2003-03-21 01:28:41 +00:00
done
if test "$found" = "no" -o -z "$dir"; then
CPPFLAGS="$O_CPPFLAGS"
else
2013-03-19 11:52:54 -04:00
LDFLAGS="$LDFLAGS -L${dir}/lib"
2010-03-11 17:21:34 -05:00
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${dir}/lib])
2003-03-21 01:28:41 +00:00
fi
2011-03-04 08:22:35 -05:00
if test "$found" = "no"; then
AC_MSG_WARN([Unable to locate opie.h, you will have to edit the Makefile and add -I/path/to/opie/includes to CPPFLAGS])
fi
2003-03-21 01:28:41 +00:00
fi
2010-03-11 17:21:34 -05:00
AC_CHECK_LIB(opie, main, [found=yes], [AC_MSG_WARN([Unable to locate libopie.a, you will have to edit the Makefile and add -L/path/to/opie/lib to SUDOERS_LDFLAGS])])
2003-03-21 01:28:41 +00:00
LDFLAGS="$O_LDFLAGS"
2011-03-04 08:26:48 -05:00
SUDOERS_LIBS="${SUDOERS_LIBS} -lopie"
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS rfc1938.lo"
1996-10-05 03:59:53 +00:00
fi
1995-09-01 02:53:07 +00:00
dnl
2007-09-05 22:16:22 +00:00
dnl Check for shadow password routines if we have not already done so.
dnl If there is a specific list of functions to check we do that first.
dnl Otherwise, we check for SVR4-style and then SecureWare-style.
1996-05-25 22:07:46 +00:00
dnl
2007-09-05 22:16:22 +00:00
if test ${with_passwd-'no'} != "no"; then
dnl
dnl if crypt(3) not in libc, look elsewhere
dnl
2020-09-18 08:18:07 -06:00
_LIBS="$LIBS"
AC_SEARCH_LIBS([crypt], [crypt crypt_d ufc], [
test "${ac_cv_search_crypt}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_crypt}"
])
2020-09-23 08:28:44 -06:00
if test "${ac_cv_search_crypt}" != "no"; then
AC_DEFINE(HAVE_CRYPT)
fi
2020-09-18 08:18:07 -06:00
LIBS="$_LIBS"
1995-09-01 02:53:07 +00:00
2007-09-05 22:16:22 +00:00
if test "$CHECKSHADOW" = "true" -a -n "$shadow_funcs"; then
_LIBS="$LIBS"
LIBS="$LIBS $shadow_libs"
found=no
2020-12-08 12:35:21 -07:00
for func in $shadow_funcs; do
AC_CHECK_FUNC([$func], [
dnl Enumerate shadow functions instead of using:
dnl AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$func]))
dnl for autoheader's sake and to catch template omissions.
case "$func" in
dispcrypt)
AC_DEFINE(HAVE_DISPCRYPT)
;;
getprpwnam)
AC_DEFINE(HAVE_GETPRPWNAM)
SECUREWARE=1
;;
getpwnam_shadow)
AC_DEFINE(HAVE_GETPWNAM_SHADOW)
;;
getspnam)
AC_DEFINE(HAVE_GETSPNAM)
;;
iscomsec)
AC_DEFINE(HAVE_ISCOMSEC)
;;
*)
AC_MSG_ERROR([unhandled shadow password function $func])
;;
esac
found=yes
])
done
if test "$found" = "no"; then
2014-07-29 09:30:25 -06:00
shadow_libs=
2007-09-05 22:16:22 +00:00
fi
CHECKSHADOW=false
2014-07-29 09:30:25 -06:00
LIBS="$_LIBS"
2007-09-05 22:16:22 +00:00
fi
if test "$CHECKSHADOW" = "true"; then
2019-01-25 10:39:57 -07:00
AC_SEARCH_LIBS([getspnam], [gen shadow], [
AC_DEFINE(HAVE_GETSPNAM)
test "${ac_cv_search_getspnam}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_getspnam}"
CHECKSHADOW=false
])
2007-09-05 22:16:22 +00:00
fi
if test "$CHECKSHADOW" = "true"; then
2019-01-25 10:39:57 -07:00
AC_SEARCH_LIBS([getprpwnam], [sec security prot], [
AC_DEFINE(HAVE_GETPRPWNAM)
test "${ac_cv_search_getprpwnam}" != "none required" && shadow_libs="${shadow_libs} ${ac_cv_search_getprpwnam}"
SECUREWARE=1
CHECKSHADOW=false
])
2014-07-29 09:30:25 -06:00
fi
if test -n "$shadow_libs"; then
# sudoers needs to link with shadow libs for password auth
SUDOERS_LIBS="$SUDOERS_LIBS $shadow_libs"
2007-09-05 22:16:22 +00:00
fi
if test -n "$SECUREWARE"; then
2014-07-29 09:30:25 -06:00
_LIBS="$LIBS"
LIBS="$LIBS $shadow_libs"
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([bigcrypt])
2010-03-06 07:36:02 -05:00
AUTH_OBJS="$AUTH_OBJS secureware.lo"
2014-07-29 09:30:25 -06:00
# set_auth_parameters() and initprivs() are called from sudo.c
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([set_auth_parameters initprivs], [test -n "$shadow_libs" && SUDO_LIBS="$SUDO_LIBS $shadow_libs"])
2014-07-29 09:30:25 -06:00
LIBS="$_LIBS"
2003-03-20 19:40:58 +00:00
fi
1999-01-19 02:04:41 +00:00
fi
2018-08-27 13:50:23 -06:00
dnl
dnl Solaris 11 added a 4th argument to the au_close() function
dnl
if test X"$with_bsm_audit" = X"yes"; then
SUDO_FUNC_AU_CLOSE_SOLARIS11
fi
2013-10-12 05:53:43 -06:00
dnl
dnl Choose event subsystem backend: poll or select
dnl
if test X"$enable_poll" = X""; then
2018-08-25 21:02:05 -06:00
AC_CHECK_FUNCS([ppoll poll], [enable_poll=yes; break], [enable_poll=no])
2013-10-12 05:53:43 -06:00
elif test X"$enable_poll" = X"yes"; then
2018-08-25 21:02:05 -06:00
AC_CHECK_FUNCS([ppoll], [], AC_DEFINE(HAVE_POLL))
2013-10-12 05:53:43 -06:00
fi
if test "$enable_poll" = "yes"; then
COMMON_OBJS="${COMMON_OBJS} event_poll.lo"
else
2018-08-25 21:02:05 -06:00
AC_CHECK_FUNCS([pselect])
2013-10-12 05:53:43 -06:00
COMMON_OBJS="${COMMON_OBJS} event_select.lo"
fi
2004-02-13 02:08:27 +00:00
dnl
dnl extra lib and .o file for LDAP support
dnl
2007-09-05 22:16:22 +00:00
if test ${with_ldap-'no'} != "no"; then
2013-03-18 16:34:01 -04:00
O_LDFLAGS="$LDFLAGS"
2004-05-29 22:29:42 +00:00
if test "$with_ldap" != "yes"; then
2010-03-11 17:21:34 -05:00
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_ldap}/lib])
2013-03-19 11:52:54 -04:00
LDFLAGS="$LDFLAGS -L${with_ldap}/lib"
2020-10-28 09:49:10 -06:00
if test -d "${with_ldap}/lib64"; then
SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_ldap}/lib64])
LDFLAGS="$LDFLAGS -L${with_ldap}/lib64"
fi
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-I${with_ldap}/include], [CPPFLAGS])
2004-05-29 22:29:42 +00:00
with_ldap=yes
fi
2018-02-11 07:36:08 -07:00
SUDOERS_OBJS="${SUDOERS_OBJS} ldap.lo ldap_conf.lo"
2018-02-09 18:21:40 -07:00
case "$SUDOERS_OBJS" in
2018-02-28 14:24:33 -07:00
*ldap_util.lo*) ;;
*) SUDOERS_OBJS="${SUDOERS_OBJS} ldap_util.lo";;
2018-02-09 18:21:40 -07:00
esac
2010-03-22 09:50:06 -04:00
LDAP=""
2004-05-29 22:29:42 +00:00
2004-06-03 16:37:32 +00:00
_LIBS="$LIBS"
2013-03-19 11:52:54 -04:00
LDAP_LIBS=""
IBMLDAP_EXTRA=""
2004-06-03 16:37:32 +00:00
found=no
2013-03-19 11:52:54 -04:00
# On HP-UX, libibmldap has a hidden dependency on libCsup
case "$host_os" in
hpux*) AC_CHECK_LIB(Csup, main, [IBMLDAP_EXTRA=" -lCsup"]);;
esac
2019-01-25 10:39:57 -07:00
AC_SEARCH_LIBS([ldap_init], ["ibmldap${IBMLDAP_EXTRA}" "ibmldap -lidsldif${IBMLDAP_EXTRA}" "ldap" "ldap -llber" "ldap -llber -lssl -lcrypto" "ibmldap${IBMLDAP_EXTRA}]", [
test "${ac_cv_search_ldap_init}" != "none required" && LDAP_LIBS="${ac_cv_search_ldap_init}"
2013-03-19 11:52:54 -04:00
found=yes
])
# If nothing linked, try -lldap and hope for the best
2004-06-03 16:37:32 +00:00
if test "$found" = "no"; then
2008-01-09 17:08:30 +00:00
LDAP_LIBS="-lldap"
2004-06-03 16:37:32 +00:00
fi
2013-03-19 11:52:54 -04:00
LIBS="${_LIBS} ${LDAP_LIBS}"
2008-01-15 12:28:33 +00:00
dnl check if we need to link with -llber for ber_set_option
OLIBS="$LIBS"
2014-02-28 11:05:13 -07:00
AC_MSG_CHECKING([whether lber.h defines LBER_OPT_DEBUG_LEVEL])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
# include <lber.h>]], [[int opt=LBER_OPT_DEBUG_LEVEL;]])], [
AC_MSG_RESULT([yes])
AC_SEARCH_LIBS([ber_set_option], [lber], [found=yes], [found=no])
if test X"$found" = X"yes" -a X"$LIBS" != X"$OLIBS"; then
LDAP_LIBS="$LDAP_LIBS -llber"
fi
], [
AC_MSG_RESULT([no])
])
2014-03-06 15:26:09 -07:00
dnl check if ldap.h includes lber.h for us
AC_MSG_CHECKING([whether lber.h is needed])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
# include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [AC_MSG_RESULT([no])], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_LBER_H)])
2004-06-03 16:37:32 +00:00
2017-07-28 13:52:55 -06:00
if test ${enable_sasl-'yes'} = "yes"; then
found_sasl_h=no
AC_CHECK_HEADERS([sasl/sasl.h] [sasl.h], [
found_sasl_h=yes
AC_CHECK_FUNCS([ldap_sasl_interactive_bind_s])
break
])
if test X${enable_sasl} = X"yes"; then
if test X"$found_sasl_h" != X"yes"; then
AC_MSG_ERROR(["--enable-sasl specified but unable to locate SASL development headers."])
fi
if test X"$ac_cv_func_ldap_sasl_interactive_bind_s" != X"yes"; then :
AC_MSG_ERROR(["--enable-sasl specified but SASL support is missing in your LDAP library"])
fi
fi
fi
2020-10-28 09:40:11 -06:00
AC_CHECK_HEADERS([ldapssl.h] [ldap_ssl.h] [mps/ldap_ssl.h], [break], [], [#include <ldap.h>])
2015-01-15 21:00:01 -07:00
AC_CHECK_FUNCS([ldap_initialize ldap_start_tls_s ldapssl_init ldapssl_set_strength ldap_unbind_ext_s ldap_str2dn ldap_create ldap_sasl_bind_s ldap_ssl_init ldap_ssl_client_init ldap_start_tls_s_np])
AC_CHECK_FUNCS([ldap_search_ext_s ldap_search_st], [break])
2004-06-03 16:37:32 +00:00
2008-02-27 14:26:28 +00:00
if test X"$check_gss_krb5_ccache_name" = X"yes"; then
AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,
2007-07-30 14:45:28 +00:00
AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME)
2008-02-27 14:26:28 +00:00
[LDAP_LIBS="${LDAP_LIBS} -lgssapi"],
AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,
AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME)
[LDAP_LIBS="${LDAP_LIBS} -lgssapi_krb5"])
)
2007-07-19 23:53:21 +00:00
2008-02-27 14:26:28 +00:00
# gssapi headers may be separate or part of Kerberos V
found=no
O_CPPFLAGS="$CPPFLAGS"
for dir in "" "kerberosV" "krb5" "kerberos5" "kerberosv5"; do
test X"$dir" != X"" && CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
2020-07-15 10:12:55 -06:00
# Use AC_PREPROC_IFELSE to check existence to avoid caching
# since we test with multiple values of CPPFLAGS
AC_PREPROC_IFELSE([
AC_LANG_PROGRAM([[#include <gssapi/gssapi.h>]])
], [
AC_CHECK_HEADERS([gssapi/gssapi.h])
break
], [
AC_PREPROC_IFELSE([
AC_LANG_PROGRAM([[#include <gssapi.h>]])
], [
AC_CHECK_HEADERS([gssapi.h])
break
])
])
2008-02-27 14:26:28 +00:00
done
2020-07-15 10:12:55 -06:00
if test X"$ac_cv_header_gssapi_gssapi_h" != X"no"; then
AC_CHECK_HEADERS([gssapi/gssapi_krb5.h])
elif test X"$ac_cv_header_gssapi_h" = X"no"; then
2008-02-27 14:26:28 +00:00
CPPFLAGS="$O_CPPFLAGS"
AC_MSG_WARN([Unable to locate gssapi.h, you will have to edit the Makefile and add -I/path/to/gssapi/includes to CPPFLAGS])
2007-07-19 23:53:21 +00:00
fi
fi
2010-03-19 07:32:14 -04:00
SUDOERS_LIBS="${SUDOERS_LIBS} ${LDAP_LIBS}"
2004-06-03 16:37:32 +00:00
LIBS="$_LIBS"
2013-03-18 16:34:01 -04:00
LDFLAGS="$O_LDFLAGS"
2004-02-13 02:08:27 +00:00
fi
2010-05-11 13:21:50 -04:00
#
2010-09-26 17:41:35 -04:00
# How to do dynamic object loading.
# We support dlopen() and sh_load(), else fall back to static loading.
#
case "$lt_cv_dlopen" in
dlopen)
2010-10-11 09:21:56 -04:00
AC_DEFINE(HAVE_DLOPEN)
2013-11-22 16:35:15 -07:00
if test "$enable_static_sudoers" = "yes"; then
AC_DEFINE(STATIC_SUDOERS_PLUGIN)
SUDO_OBJS="${SUDO_OBJS} preload.o"
2014-01-22 14:47:27 -07:00
STATIC_SUDOERS="\$(top_builddir)/plugins/sudoers/sudoers.la"
2021-02-12 07:16:32 -07:00
AX_APPEND_FLAG([--tag=disable-shared], [SUDOERS_LDFLAGS])
AX_APPEND_FLAG([-static], [SUDOERS_LDFLAGS])
2013-11-22 16:35:15 -07:00
LT_STATIC=""
else
LT_STATIC="--tag=disable-static"
fi
2010-09-26 17:41:35 -04:00
;;
shl_load)
AC_DEFINE(HAVE_SHL_LOAD)
2013-11-22 16:35:15 -07:00
if test "$enable_static_sudoers" = "yes"; then
AC_DEFINE(STATIC_SUDOERS_PLUGIN)
SUDO_OBJS="${SUDO_OBJS} preload.o"
2014-01-22 14:47:27 -07:00
STATIC_SUDOERS="\$(top_builddir)/plugins/sudoers/sudoers.la"
2021-02-12 07:16:32 -07:00
AX_APPEND_FLAG([--tag=disable-shared], [SUDOERS_LDFLAGS])
AX_APPEND_FLAG([-static], [SUDOERS_LDFLAGS])
2013-11-22 16:35:15 -07:00
LT_STATIC=""
else
LT_STATIC="--tag=disable-static"
fi
2010-09-26 17:41:35 -04:00
;;
2010-10-11 09:21:56 -04:00
*)
2011-08-12 13:00:55 -04:00
if test X"${ac_cv_func_dlopen}" = X"yes"; then
AC_MSG_ERROR(["dlopen present but libtool doesn't appear to support your platform."])
fi
2010-09-26 17:41:35 -04:00
# Preload sudoers module symbols
2014-07-01 17:16:12 -06:00
AC_DEFINE(STATIC_SUDOERS_PLUGIN)
2010-09-26 17:41:35 -04:00
SUDO_OBJS="${SUDO_OBJS} preload.o"
2014-01-22 14:47:27 -07:00
STATIC_SUDOERS="\$(top_builddir)/plugins/sudoers/sudoers.la"
2010-09-26 17:41:35 -04:00
LT_STATIC=""
;;
esac
2014-08-08 11:19:20 -06:00
#
# The check_symbols test can only succeed with a dynamic sudoers plugin.
#
if test X"$STATIC_SUDOERS" = X""; then
SUDOERS_TEST_PROGS="${SUDOERS_TEST_PROGS}${SUDOERS_TEST_PROGS+ }check_symbols"
fi
2014-08-08 11:03:24 -06:00
#
# 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
2014-10-01 14:32:30 -06:00
# Do not install sudoers or libsudo_util.
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-no-install], [SUDOERS_LDFLAGS])
AX_APPEND_FLAG([-no-install], [LIBUTIL_LDFLAGS])
2014-08-08 11:03:24 -06:00
fi
fi
2012-06-18 10:21:05 -04:00
# 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)
# so always link against -lpthread on HP-UX if it is available.
2010-05-11 12:11:03 -04:00
# This check should go after all other libraries tests.
2013-03-19 15:59:23 -04:00
case "$host_os" in
hpux*)
2010-05-11 12:11:03 -04:00
AC_CHECK_LIB(pthread, main, [SUDO_LIBS="${SUDO_LIBS} -lpthread"])
2015-06-19 12:35:51 -06:00
AC_DEFINE(_REENTRANT)
2010-05-11 12:11:03 -04:00
;;
esac
1994-05-24 16:50:57 +00:00
dnl
2010-05-30 10:31:38 -04:00
dnl Check for log file, timestamp and iolog locations
1995-03-30 02:12:19 +00:00
dnl
2011-03-15 11:56:49 -04:00
if test "$utmp_style" = "LEGACY"; then
SUDO_PATH_UTMP
fi
2020-01-30 13:25:52 -07:00
SUDO_LOGDIR
1995-03-30 02:12:19 +00:00
SUDO_LOGFILE
2014-02-01 05:57:34 -07:00
SUDO_RUNDIR
SUDO_VARDIR
2010-05-30 11:16:31 -04:00
SUDO_IO_LOGDIR
2015-02-06 11:01:05 -07:00
SUDO_TZDIR
1995-06-18 17:58:42 +00:00
2016-04-28 15:27:53 -06:00
dnl
dnl Attempt to use _FORTIFY_SOURCE with sprintf. If the headers support
dnl it but libc does not, __sprintf_chk should be an undefined symbol.
dnl
if test "$enable_hardening" != "no"; then
O_CPPFLAGS="$CPPFLAGS"
2016-11-17 10:16:51 -07:00
AX_APPEND_FLAG([-D_FORTIFY_SOURCE=2], [CPPFLAGS])
2016-04-28 15:27:53 -06:00
AC_CACHE_CHECK([whether _FORTIFY_SOURCE may be specified],
[sudo_cv_use_fortify_source],
[AC_LINK_IFELSE([
AC_LANG_PROGRAM(
[[]], [[char buf[4]; (void)sprintf(buf, "%s", "foo");]]
)],
[sudo_cv_use_fortify_source=yes],
[sudo_cv_use_fortify_source=no]
)
]
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[sudo_cv_use_fortify_source=yes],
[sudo_cv_use_fortify_source=no]
)
]
)
if test "$sudo_cv_use_fortify_source" != yes; then
CPPFLAGS="$O_CPPFLAGS"
fi
fi
2012-05-24 11:03:10 -04:00
dnl
2012-06-18 14:10:50 -04:00
dnl Turn warnings into errors.
2012-07-19 13:41:14 -04:00
dnl All compiler/loader tests after this point will fail if
2015-10-30 10:11:55 -06:00
dnl a warning is displayed (normally, warnings are not fatal).
2012-05-24 11:03:10 -04:00
dnl
2012-06-13 14:01:16 -04:00
AC_LANG_WERROR
2012-06-18 14:10:50 -04:00
dnl
dnl If compiler supports the -static-libgcc flag use it unless we have
dnl GNU ld (which can avoid linking in libgcc when it is not needed).
dnl This test relies on AC_LANG_WERROR
dnl
if test -n "$GCC" -a "$lt_cv_prog_gnu_ld" != "yes" -a -n "$GCC"; then
2016-11-17 10:16:51 -07:00
AX_CHECK_COMPILE_FLAG([-static-libgcc], [AX_APPEND_FLAG([-Wc,-static-libgcc], [LT_LDFLAGS])])
2012-06-18 14:10:50 -04:00
fi
2020-01-15 10:13:54 -07:00
dnl
dnl We want to use DT_RUNPATH in preference to DT_RPATH in ELF binaries.
dnl Otherwise, LD_LIBRARY_PATH does not work when running the tests.
dnl We don't do this on NetBSD where RPATH already supports LD_LIBRARY_PATH.
dnl
case "$OS" in
netbsd)
;;
*)
AX_CHECK_LINK_FLAG([-Wl,--enable-new-dtags], [AX_APPEND_FLAG([-Wl,--enable-new-dtags], [LDFLAGS])])
;;
esac
2012-06-18 14:10:50 -04:00
dnl
dnl Check for symbol visibility support.
dnl This test relies on AC_LANG_WERROR
dnl
2013-01-10 21:27:40 -05:00
if test -n "$GCC"; then
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [
AC_DEFINE(HAVE_DSO_VISIBILITY)
CFLAGS="${CFLAGS} -fvisibility=hidden"
LT_LDEXPORTS=
LT_LDDEP=
])
else
2013-03-19 15:59:23 -04:00
case "$host_os" in
hpux*)
2013-01-10 21:27:40 -05:00
AX_CHECK_COMPILE_FLAG([-Bhidden_def], [
2020-09-05 07:10:24 -06:00
# HP-UX cc may not allow __declspec(dllexport) to be
# used in conjunction with #pragma HP_DEFINED_EXTERNAL
# when redefining standard libc functions.
AC_CACHE_CHECK([whether __declspec(dllexport) can be used when overriding libc functions],
[sudo_cv_var_hpux_declspec_libc_function],
[
_CFLAGS="$CFLAGS"
CFLAGS="${CFLAGS} -Bhidden_def"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
__declspec(dllexport) char * getenv(const char *n) { return NULL; }]])], [
sudo_cv_var_hpux_declspec_libc_function=yes
], [
sudo_cv_var_hpux_declspec_libc_function=no
])
CFLAGS="$_CFLAGS"
]
)
if test "$sudo_cv_var_hpux_declspec_libc_function" = "yes"; then
AC_DEFINE(HAVE_DSO_VISIBILITY)
CFLAGS="${CFLAGS} -Bhidden_def"
LT_LDEXPORTS=
LT_LDDEP=
fi
2013-01-10 21:27:40 -05:00
])
;;
2013-03-19 15:59:23 -04:00
solaris2*)
2013-01-10 21:27:40 -05:00
AX_CHECK_COMPILE_FLAG([-xldscope=hidden], [
AC_DEFINE(HAVE_DSO_VISIBILITY)
CFLAGS="${CFLAGS} -xldscope=hidden"
LT_LDEXPORTS=
LT_LDDEP=
])
;;
esac
fi
2012-06-13 14:01:16 -04:00
dnl
2020-08-03 10:27:27 -06:00
dnl Check whether ld supports version scripts (only GNU and Solaris ld).
dnl If possible, we use this even if the compiler has symbol visibility
dnl support so we will notice mismatches between the exports file and
2020-08-12 09:57:42 -06:00
dnl sudo_dso_public annotations in the source code.
2012-06-18 14:10:50 -04:00
dnl This test relies on AC_LANG_WERROR
2012-06-13 14:01:16 -04:00
dnl
2020-08-03 10:27:27 -06:00
if test "$lt_cv_prog_gnu_ld" = "yes"; then
AC_CACHE_CHECK([whether ld supports anonymous map files],
[sudo_cv_var_gnu_ld_anon_map],
[
sudo_cv_var_gnu_ld_anon_map=no
cat > conftest.map <<-EOF
{
global: foo;
local: *;
};
2012-07-02 11:20:05 -04:00
EOF
2020-08-03 10:27:27 -06:00
_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -fpic -shared -Wl,--version-script,./conftest.map"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]], [[]])],
[sudo_cv_var_gnu_ld_anon_map=yes])
CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS"
]
)
if test "$sudo_cv_var_gnu_ld_anon_map" = "yes"; then
LT_LDDEP="\$(shlib_map)"; LT_LDEXPORTS="-Wl,--version-script,\$(shlib_map)"
2012-06-13 14:01:16 -04:00
fi
2020-08-03 10:27:27 -06:00
else
case "$host_os" in
solaris2*)
AC_CACHE_CHECK([whether ld supports anonymous map files],
[sudo_cv_var_solaris_ld_anon_map],
[
sudo_cv_var_solaris_ld_anon_map=no
cat > conftest.map <<-EOF
{
global: foo;
local: *;
};
EOF
_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared -Wl,-M,./conftest.map"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]], [[]])],
[sudo_cv_var_solaris_ld_anon_map=yes])
CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS"
]
)
if test "$sudo_cv_var_solaris_ld_anon_map" = "yes"; then
LT_LDDEP="\$(shlib_map)"; LT_LDEXPORTS="-Wl,-M,\$(shlib_map)"
fi
;;
hpux*)
AC_CACHE_CHECK([whether ld supports controlling exported symbols],
[sudo_cv_var_hpux_ld_symbol_export],
[
sudo_cv_var_hpux_ld_symbol_export=no
echo "+e foo" > conftest.opt
_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS"
if test -n "$GCC"; then
LDFLAGS="$LDFLAGS -shared -Wl,-c,./conftest.opt"
else
2020-09-04 21:43:30 -06:00
LDFLAGS="$LDFLAGS -b -Wl,-c,./conftest.opt"
2020-08-03 10:27:27 -06:00
fi
AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]], [[]])],
[sudo_cv_var_hpux_ld_symbol_export=yes])
CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS"
rm -f conftest.opt
]
)
if test "$sudo_cv_var_hpux_ld_symbol_export" = "yes"; then
LT_LDDEP="\$(shlib_opt)"; LT_LDEXPORTS="-Wl,-c,\$(shlib_opt)"
fi
;;
esac
2012-06-13 14:01:16 -04:00
fi
2016-01-27 15:37:25 -07:00
dnl
2021-02-06 12:42:11 -07:00
dnl Check for -fsanitize support
2016-01-27 15:37:25 -07:00
dnl This test relies on AC_LANG_WERROR
dnl
2021-02-06 12:42:11 -07:00
if test "$enable_sanitizer" != "no"; then
AX_CHECK_COMPILE_FLAG([$enable_sanitizer], [
2021-02-06 13:28:39 -07:00
AX_APPEND_FLAG([$enable_sanitizer], [ASAN_CFLAGS])
AX_APPEND_FLAG([$enable_sanitizer], [ASAN_LDFLAGS])
AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], [
AX_APPEND_FLAG([-fno-omit-frame-pointer], [CFLAGS])
])
AC_DEFINE(NO_LEAKS)
2021-02-13 15:40:48 -07:00
], [
AC_MSG_ERROR([$CC does not support the $enable_sanitizer flag])
2021-02-06 13:28:39 -07:00
])
fi
if test "$enable_fuzzer" = "yes"; then
AX_CHECK_COMPILE_FLAG([-fsanitize=fuzzer-no-link], [
AX_APPEND_FLAG([-fsanitize=fuzzer-no-link], [ASAN_CFLAGS])
2021-02-08 05:27:26 -07:00
AX_APPEND_FLAG([-fsanitize=fuzzer-no-link], [ASAN_LDFLAGS])
2021-02-07 05:52:45 -07:00
if test -z "$FUZZ_ENGINE"; then
FUZZ_ENGINE="-fsanitize=fuzzer"
fi
2021-02-06 13:28:39 -07:00
AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], [
AX_APPEND_FLAG([-fno-omit-frame-pointer], [CFLAGS])
2016-01-27 15:37:25 -07:00
])
2021-02-06 13:28:39 -07:00
# Use CFLAGS, not CPPFLAGS to match oss-fuzz behavior
AX_APPEND_FLAG([-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION], [CFLAGS])
AC_DEFINE(NO_LEAKS)
2021-02-13 15:40:48 -07:00
], [
AC_MSG_ERROR([$CC does not support the -fsanitize=fuzzer-no-link flag])
2016-01-27 15:37:25 -07:00
])
2021-02-07 15:43:51 -07:00
else
# Not using compiler fuzzing support, link with stub library.
FUZZ_ENGINE='$(top_builddir)/lib/fuzzstub/libsudo_fuzzstub.la'
2016-01-27 15:37:25 -07:00
fi
2012-07-02 10:12:41 -04:00
dnl
dnl Check for PIE executable support if using gcc.
dnl This test relies on AC_LANG_WERROR
dnl
2013-03-14 16:06:13 -04:00
if test -n "$GCC"; then
2013-05-28 14:40:45 -04:00
if test -z "$enable_pie"; then
case "$host_os" in
linux*)
# Attempt to build with PIE support
enable_pie="maybe"
;;
esac
fi
if test -n "$enable_pie"; then
if test "$enable_pie" = "no"; then
AX_CHECK_COMPILE_FLAG([-fno-pie], [
_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-pie"
AX_CHECK_LINK_FLAG([-nopie], [
PIE_CFLAGS="-fno-pie"
PIE_LDFLAGS="-nopie"
])
CFLAGS="$_CFLAGS"
2013-03-14 16:06:13 -04:00
])
2013-05-28 14:40:45 -04:00
else
AX_CHECK_COMPILE_FLAG([-fPIE], [
_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fPIE"
AX_CHECK_LINK_FLAG([-pie], [
if test "$enable_pie" = "maybe"; then
SUDO_WORKING_PIE([enable_pie=yes], [])
fi
if test "$enable_pie" = "yes"; then
PIE_CFLAGS="-fPIE"
PIE_LDFLAGS="-Wc,-fPIE -pie"
fi
])
CFLAGS="$_CFLAGS"
2013-03-14 16:06:13 -04:00
])
2013-05-28 14:40:45 -04:00
fi
2013-03-14 16:06:13 -04:00
fi
2012-07-02 10:12:41 -04:00
fi
2013-05-30 09:29:36 -04:00
if test "$enable_pie" != "yes"; then
# Solaris 11.1 and higher supports tagging binaries to use ASLR
case "$host_os" in
solaris2.1[[1-9]]|solaris2.[[2-9]][[0-9]])
2016-11-17 10:16:51 -07:00
AX_CHECK_LINK_FLAG([-Wl,-z,aslr], [AX_APPEND_FLAG([-Wl,-z,aslr], [PIE_LDFLAGS])])
2013-05-30 09:29:36 -04:00
;;
esac
fi
2012-07-02 10:12:41 -04:00
2012-06-13 14:01:16 -04:00
dnl
dnl Check for -fstack-protector and -z relro support
2012-06-18 14:10:50 -04:00
dnl This test relies on AC_LANG_WERROR
2012-06-13 14:01:16 -04:00
dnl
2021-02-18 13:58:09 -07:00
if test "$enable_hardening" != "no" && test "$enable_ssp" != "no"; then
2015-10-29 10:51:09 -06:00
AC_CACHE_CHECK([for compiler stack protector support],
[sudo_cv_var_stack_protector],
[
2015-10-30 10:11:55 -06:00
# Avoid CFLAGS since the compiler might optimize away our test.
# We don't want CPPFLAGS or LIBS to interfere with the test but
# keep LDFLAGS as it may have an rpath needed to find the ssp lib.
_CPPFLAGS="$CPPFLAGS"
2015-10-29 10:51:09 -06:00
_CFLAGS="$CFLAGS"
_LDFLAGS="$LDFLAGS"
2015-10-30 08:49:22 -06:00
_LIBS="$LIBS"
2015-10-30 10:11:55 -06:00
CPPFLAGS=
2015-10-30 08:49:22 -06:00
LIBS=
sudo_cv_var_stack_protector="-fstack-protector-strong"
CFLAGS="$sudo_cv_var_stack_protector"
LDFLAGS="$_LDFLAGS $sudo_cv_var_stack_protector"
AC_LINK_IFELSE([
2015-10-29 10:51:09 -06:00
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]])
2015-10-30 08:49:22 -06:00
], [], [
sudo_cv_var_stack_protector="-fstack-protector-all"
CFLAGS="$sudo_cv_var_stack_protector"
LDFLAGS="$_LDFLAGS $sudo_cv_var_stack_protector"
AC_LINK_IFELSE([
2015-10-29 10:51:09 -06:00
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]])
2015-10-30 08:49:22 -06:00
], [], [
sudo_cv_var_stack_protector="-fstack-protector"
CFLAGS="$sudo_cv_var_stack_protector"
LDFLAGS="$_LDFLAGS $sudo_cv_var_stack_protector"
AC_LINK_IFELSE([
2015-10-29 10:51:09 -06:00
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]])
2015-10-30 08:49:22 -06:00
], [], [
sudo_cv_var_stack_protector=no
])
2013-01-11 09:39:59 -05:00
])
])
2015-10-30 10:11:55 -06:00
CPPFLAGS="$_CPPFLAGS"
2015-10-29 10:51:09 -06:00
CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS"
2015-10-30 08:49:22 -06:00
LIBS="$_LIBS"
2015-10-29 10:51:09 -06:00
]
)
if test X"$sudo_cv_var_stack_protector" != X"no"; then
SSP_CFLAGS="$sudo_cv_var_stack_protector"
SSP_LDFLAGS="-Wc,$sudo_cv_var_stack_protector"
2013-01-10 21:27:40 -05:00
fi
2016-11-17 10:16:51 -07:00
AX_CHECK_LINK_FLAG([-Wl,-z,relro], [AX_APPEND_FLAG([-Wl,-z,relro], [LDFLAGS])])
2012-05-24 11:03:10 -04:00
fi
2021-02-18 13:58:09 -07:00
if test "$enable_hardening" != "no"; then
AX_CHECK_LINK_FLAG([-Wl,-z,relro], [AX_APPEND_FLAG([-Wl,-z,relro], [LDFLAGS])])
fi
2012-05-24 11:03:10 -04:00
1999-07-22 12:46:29 +00:00
dnl
2010-08-06 13:55:33 -04:00
dnl Use passwd auth module?
1999-07-22 12:46:29 +00:00
dnl
2007-09-02 20:25:53 +00:00
case "$with_passwd" in
2007-09-05 22:16:22 +00:00
yes|maybe)
2010-08-06 13:55:33 -04:00
AUTH_OBJS="$AUTH_OBJS getspwuid.lo passwd.lo"
2020-09-23 08:28:44 -06:00
if test "${ac_cv_search_crypt}" = "no"; then
2020-09-20 19:18:39 -06:00
AC_MSG_WARN([No crypt function found, assuming plaintext passwords])
fi
2007-09-05 22:16:22 +00:00
;;
*)
2004-09-08 15:49:26 +00:00
AC_DEFINE(WITHOUT_PASSWD)
1999-08-12 14:37:27 +00:00
if test -z "$AUTH_OBJS"; then
1999-11-08 22:45:42 +00:00
AC_MSG_ERROR([no authentication methods defined.])
1999-08-12 14:37:27 +00:00
fi
2005-01-21 15:29:05 +00:00
;;
esac
2007-09-05 22:16:22 +00:00
AUTH_OBJS=${AUTH_OBJS# }
2010-08-06 13:55:33 -04:00
_AUTH=`echo "$AUTH_OBJS" | sed -e 's/\.lo//g' -e 's/getspwuid *//'`
2005-01-21 15:29:05 +00:00
AC_MSG_NOTICE([using the following authentication methods: $_AUTH])
1999-07-22 12:46:29 +00:00
1999-08-26 13:16:06 +00:00
dnl
2011-03-08 09:46:35 -05:00
dnl LIBS may contain duplicates from SUDO_LIBS, SUDOERS_LIBS, or NET_LIBS
1999-08-26 13:16:06 +00:00
dnl
if test -n "$LIBS"; then
L="$LIBS"
LIBS=
for l in ${L}; do
dupe=0
2011-03-08 09:46:35 -05:00
for sl in ${SUDO_LIBS} ${SUDOERS_LIBS} ${NET_LIBS}; do
1999-08-26 13:16:06 +00:00
test $l = $sl && dupe=1
done
test $dupe = 0 && LIBS="${LIBS} $l"
done
fi
2012-11-11 07:11:22 -05:00
dnl
dnl OS-specific initialization
dnl
AC_DEFINE_UNQUOTED(os_init, $OS_INIT, [Define to an OS-specific initialization function or `os_init_common'.])
2011-08-29 14:49:10 -04:00
dnl
dnl We add -Wall and -Werror after all tests so they don't cause failures
dnl
if test -n "$GCC"; then
if test X"$enable_warnings" = X"yes" -o X"$with_devel" = X"yes"; then
2020-08-01 13:10:50 -06:00
dnl
dnl Default warnings for development use.
dnl
2014-10-24 15:26:21 -06:00
CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wpointer-arith"
2020-09-25 15:09:42 -06:00
AX_CHECK_COMPILE_FLAG([-Wshadow], [CFLAGS="$CFLAGS -Wshadow"])
2020-06-20 13:51:02 -06:00
dnl
2020-08-01 13:10:50 -06:00
dnl The fallthrough attribute is supported by gcc 7.0 and clang 10.
dnl This test relies on AC_LANG_WERROR.
2020-06-20 13:51:02 -06:00
dnl
2020-08-01 13:10:50 -06:00
AC_CACHE_CHECK([whether $CC supports the fallthrough attribute],
[sudo_cv_var_fallthrough_attribute],
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
int main(int argc, char *argv[])
{
int num = argc + 1;
switch (num) {
case 1:
num = 0;
__attribute__((__fallthrough__));
case 0:
num++;
}
return num;
2020-06-20 13:51:02 -06:00
}
2020-08-01 13:10:50 -06:00
]])],
[
sudo_cv_var_fallthrough_attribute=yes
],
[
sudo_cv_var_fallthrough_attribute=no]
)]
)
if test X"$sudo_cv_var_fallthrough_attribute" = X"yes"; then
AC_DEFINE(HAVE_FALLTHROUGH_ATTRIBUTE)
CFLAGS="$CFLAGS -Wimplicit-fallthrough"
fi
2011-08-29 14:49:10 -04:00
fi
if test X"$enable_werror" = X"yes"; then
CFLAGS="${CFLAGS} -Werror"
fi
fi
2012-06-20 13:38:17 -04:00
dnl
2020-10-30 10:15:30 -06:00
dnl Skip regress tests and sudoers validation checks if cross compiling.
2012-06-20 13:38:17 -04:00
dnl
CROSS_COMPILING="$cross_compiling"
1995-11-19 02:27:39 +00:00
dnl
dnl Set exec_prefix
dnl
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
2004-01-05 03:58:39 +00:00
dnl
2019-07-03 13:13:04 -06:00
dnl Expand exec_prefix in in variables used by the manual pages
2004-01-05 03:58:39 +00:00
dnl
2019-07-03 13:13:04 -06:00
oexec_prefix="$exec_prefix"
if test "$exec_prefix" = '$(prefix)'; then
if test "$prefix" = "NONE"; then
exec_prefix="$ac_default_prefix"
else
exec_prefix="$prefix"
2004-01-05 03:58:39 +00:00
fi
2019-07-03 13:13:04 -06:00
fi
2008-02-09 14:30:06 +00:00
2019-07-03 13:13:04 -06:00
# Update exec_prefix in noexec_file
_noexec_file=
while test X"$noexec_file" != X"$_noexec_file"; do
_noexec_file="$noexec_file"
eval noexec_file="$_noexec_file"
done
2016-11-14 14:21:08 -07:00
2019-07-03 13:13:04 -06:00
# Update exec_prefix in sesh_file
_sesh_file=
while test X"$sesh_file" != X"$_sesh_file"; do
_sesh_file="$sesh_file"
eval sesh_file="$_sesh_file"
done
2019-07-03 13:15:47 -06:00
# Update exec_prefix in plugindir
_plugindir=
while test X"$plugindir" != X"$_plugindir"; do
_plugindir="$plugindir"
eval plugindir="$_plugindir"
2019-07-03 13:13:04 -06:00
done
exec_prefix="$oexec_prefix"
dnl
dnl Defer setting _PATH_SUDO_NOEXEC, etc until after exec_prefix is set
dnl
if test X"$with_noexec" != X"no"; then
PROGS="${PROGS} sudo_noexec.la"
INSTALL_NOEXEC="install-noexec"
2021-02-06 12:42:11 -07:00
# Can't use sanitizers with LD_PRELOAD
if test "$enable_sanitizer" != "yes"; then
2019-07-03 13:13:04 -06:00
CHECK_NOEXEC=check_noexec
2013-04-02 12:25:54 -04:00
fi
2019-07-03 13:13:04 -06:00
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_NOEXEC, "$noexec_file", [The fully qualified pathname of sudo_noexec.so])
else
2016-11-16 10:13:26 -07:00
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_NOEXEC, NULL)
fi
2019-07-03 13:13:04 -06:00
if test X"$with_selinux" != X"no"; then
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SESH, "$sesh_file")
else
2013-03-14 16:49:42 -04:00
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SESH, NULL)
fi
2019-07-03 13:13:04 -06:00
if test X"$enable_shared" != X"no"; then
2019-07-03 13:15:47 -06:00
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_PLUGIN_DIR, "$plugindir/")
2019-07-03 13:13:04 -06:00
AC_DEFINE(ENABLE_SUDO_PLUGIN_API, 1, [Define to 1 to enable sudo's plugin interface.])
else
2016-11-16 10:13:26 -07:00
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_PLUGIN_DIR, NULL)
fi
2004-01-05 03:58:39 +00:00
2013-03-19 11:52:54 -04:00
dnl
dnl Add -R options to LDFLAGS, etc.
dnl
if test X"$LDFLAGS_R" != X""; then
LDFLAGS="$LDFLAGS $LDFLAGS_R"
fi
if test X"$SUDOERS_LDFLAGS_R" != X""; then
SUDOERS_LDFLAGS="$SUDOERS_LDFLAGS $SUDOERS_LDFLAGS_R"
fi
if test X"$ZLIB_R" != X""; then
ZLIB="$ZLIB_R $ZLIB"
fi
2010-07-23 09:33:19 -04:00
dnl
dnl Override default configure dirs for the Makefile
dnl
if test X"$prefix" = X"NONE"; then
test "$mandir" = '${datarootdir}/man' && mandir='$(prefix)/man'
else
test "$mandir" = '${datarootdir}/man' && mandir='$(datarootdir)/man'
fi
test "$bindir" = '${exec_prefix}/bin' && bindir='$(exec_prefix)/bin'
test "$sbindir" = '${exec_prefix}/sbin' && sbindir='$(exec_prefix)/sbin'
test "$libexecdir" = '${exec_prefix}/libexec' && libexecdir='$(exec_prefix)/libexec'
test "$includedir" = '${prefix}/include' && includedir='$(prefix)/include'
test "$datarootdir" = '${prefix}/share' && datarootdir='$(prefix)/share'
test "$docdir" = '${datarootdir}/doc/${PACKAGE_TARNAME}' && docdir='$(datarootdir)/doc/$(PACKAGE_TARNAME)'
2012-06-18 09:50:42 -04:00
test "$localedir" = '${datarootdir}/locale' && localedir='$(datarootdir)/locale'
test "$localstatedir" = '${prefix}/var' && localstatedir='$(prefix)/var'
2020-05-20 18:51:52 -06:00
test "$runstatedir" = '${localstatedir}/run' && runstatedir='$(localstatedir)/run'
2016-02-18 16:18:30 -07:00
test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
2010-07-23 09:33:19 -04:00
1995-03-30 02:12:19 +00:00
dnl
2000-03-23 00:35:59 +00:00
dnl Substitute into the Makefile and man pages
1994-03-09 23:51:22 +00:00
dnl
2015-02-26 09:19:08 -07:00
if test X"$INIT_SCRIPT" != X""; then
2019-12-23 14:29:27 -07:00
AC_CONFIG_FILES([etc/init.d/$INIT_SCRIPT])
2015-04-07 15:35:01 -06:00
elif test X"$TMPFILES_D" != X""; then
2019-12-23 14:29:27 -07:00
AC_CONFIG_FILES([etc/init.d/sudo.conf])
2015-02-26 09:19:08 -07:00
fi
2019-10-22 13:16:22 +02:00
2021-02-07 15:43:51 -07:00
AC_CONFIG_FILES([Makefile doc/Makefile examples/Makefile examples/sudo.conf include/Makefile lib/eventlog/Makefile lib/fuzzstub/Makefile lib/iolog/Makefile lib/logsrv/Makefile lib/util/Makefile lib/util/util.exp logsrvd/Makefile src/sudo_usage.h src/Makefile plugins/audit_json/Makefile plugins/sample/Makefile plugins/group_file/Makefile plugins/sample_approval/Makefile plugins/system_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers])
2019-10-22 13:16:22 +02:00
2005-06-25 18:04:30 +00:00
AC_OUTPUT
1998-09-11 23:47:29 +00:00
dnl
dnl Spew any text the user needs to know about
dnl
if test "$with_pam" = "yes"; then
2013-03-19 15:59:23 -04:00
case $host_os in
hpux*)
2012-01-17 13:07:35 -05:00
if test -f /usr/lib/security/libpam_hpsec.so.1; then
2011-12-08 09:10:07 -05:00
AC_MSG_NOTICE([You may wish to add the following line to /etc/pam.conf])
AC_MSG_NOTICE([sudo session required libpam_hpsec.so.1 bypass_umask bypass_last_login])
fi
;;
2013-03-19 15:59:23 -04:00
linux*)
2014-10-24 14:25:12 -06:00
AC_MSG_NOTICE([You will need to customize examples/pam.conf and install it as /etc/pam.d/sudo])
1999-03-26 18:09:09 +00:00
;;
esac
1998-09-11 23:47:29 +00:00
fi
2014-02-04 15:14:48 -07:00
dnl
2014-02-16 10:22:43 -07:00
dnl Warn user if they may need to clear rundir manually.
2014-02-04 15:14:48 -07:00
dnl
2014-02-16 10:22:43 -07:00
case "$rundir" in
2018-02-19 10:59:12 -07:00
/run/*|/var/run/*)
2014-02-16 10:22:43 -07:00
clear_rundir=0
2014-02-04 15:14:48 -07:00
;;
*)
2014-02-16 10:22:43 -07:00
clear_rundir=1
2014-02-04 15:14:48 -07:00
;;
esac
if test $clear_rundir -eq 1; then
AC_MSG_NOTICE([Warning: the $rundir/ts directory must be cleared at boot time.])
AC_MSG_NOTICE([ You may need to create a startup item to do this.])
fi
2002-01-02 22:36:50 +00:00
dnl
2004-09-08 15:49:26 +00:00
dnl Autoheader templates
dnl
AH_TEMPLATE(CLASSIC_INSULTS, [Define to 1 if you want the insults from the "classic" version sudo.])
AH_TEMPLATE(CSOPS_INSULTS, [Define to 1 if you want insults culled from the twisted minds of CSOps.])
AH_TEMPLATE(DONT_LEAK_PATH_INFO, [Define to 1 if you want sudo to display "command not allowed" instead of "command not found" when a command cannot be found.])
2010-04-06 04:53:42 -04:00
AH_TEMPLATE(ENV_DEBUG, [Define to 1 to enable environment function debugging.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(ENV_EDITOR, [Define to 1 if you want visudo to honor the EDITOR and VISUAL env variables.])
AH_TEMPLATE(FQDN, [Define to 1 if you want to require fully qualified hosts in sudoers.])
2011-02-19 08:22:32 -05:00
AH_TEMPLATE(ENV_RESET, [Define to 1 to enable environment resetting by default.])
2018-04-17 07:10:43 -06:00
AH_TEMPLATE(PYTHON_INSULTS, [Define to 1 if you want insults from "Monty Python's Flying Circus".])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(GOONS_INSULTS, [Define to 1 if you want insults from the "Goon Show".])
AH_TEMPLATE(HAL_INSULTS, [Define to 1 if you want 2001-like insults.])
AH_TEMPLATE(HAVE_AFS, [Define to 1 if you use AFS.])
2005-01-21 15:29:05 +00:00
AH_TEMPLATE(HAVE_AIXAUTH, [Define to 1 if you use AIX general authentication.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_BSD_AUTH_H, [Define to 1 if you use BSD authentication.])
2010-06-16 11:17:02 -04:00
AH_TEMPLATE(HAVE_BSM_AUDIT, [Define to 1 to enable BSM audit support.])
2020-09-18 08:18:07 -06:00
AH_TEMPLATE(HAVE_CRYPT, [Define to 1 if you have the `crypt' function.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_DCE, [Define to 1 if you use OSF DCE.])
AH_TEMPLATE(HAVE_DD_FD, [Define to 1 if your `DIR' contains dd_fd.])
AH_TEMPLATE(HAVE_DIRFD, [Define to 1 if you have the `dirfd' function or macro.])
2006-08-17 15:26:54 +00:00
AH_TEMPLATE(HAVE_DISPCRYPT, [Define to 1 if you have the `dispcrypt' function.])
2010-10-11 09:21:56 -04:00
AH_TEMPLATE(HAVE_DLOPEN, [Define to 1 if you have the `dlopen' function.])
2006-08-17 15:26:54 +00:00
AH_TEMPLATE(HAVE_FCNTL_CLOSEM, [Define to 1 if your system has the F_CLOSEM fcntl.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_FNMATCH, [Define to 1 if you have the `fnmatch' function.])
AH_TEMPLATE(HAVE_FWTK, [Define to 1 if you use the FWTK authsrv daemon.])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(HAVE_GETPRPWNAM, [Define to 1 if you have the `getprpwnam' function. (SecureWare-style shadow passwords).])
2016-11-17 17:55:44 -07:00
AH_TEMPLATE(HAVE_GETPWNAM_SHADOW, [Define to 1 if you have the `getpwnam_shadow' function.])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(HAVE_GETSPNAM, [Define to 1 if you have the `getspnam' function (SVR4-style shadow passwords).])
2007-07-19 23:53:21 +00:00
AH_TEMPLATE(HAVE_GSS_KRB5_CCACHE_NAME, [Define to 1 if you have the `gss_krb5_ccache_name' function.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_HEIMDAL, [Define to 1 if your Kerberos is Heimdal.])
2014-10-02 07:55:08 -06:00
AH_TEMPLATE(HAVE_INET_NTOP, [Define to 1 if you have the `inet_ntop' function.])
2014-02-05 10:00:07 -07:00
AH_TEMPLATE(HAVE_INET_PTON, [Define to 1 if you have the `inet_pton' function.])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(HAVE_ISCOMSEC, [Define to 1 if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled).])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_KERB5, [Define to 1 if you use Kerberos V.])
2008-10-23 16:06:23 +00:00
AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC, [Define to 1 if you have the `krb5_get_init_creds_opt_alloc' function.])
2009-11-04 14:42:04 +00:00
AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS, [Define to 1 if your `krb5_get_init_creds_opt_free' function takes two arguments.])
2008-10-23 16:06:23 +00:00
AH_TEMPLATE(HAVE_KRB5_INIT_SECURE_CONTEXT, [Define to 1 if you have the `krb5_init_secure_context' function.])
AH_TEMPLATE(HAVE_KRB5_VERIFY_USER, [Define to 1 if you have the `krb5_verify_user' function.])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(HAVE_LBER_H, [Define to 1 if your LDAP needs <lber.h>. (OpenLDAP does not).])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_LDAP, [Define to 1 if you use LDAP for sudoers.])
2011-05-04 15:26:31 -04:00
AH_TEMPLATE(HAVE_LIBINTL_H, [Define to 1 if you have the <libintl.h> header file.])
2010-06-16 11:17:02 -04:00
AH_TEMPLATE(HAVE_LINUX_AUDIT, [Define to 1 to enable Linux audit support.])
2012-08-10 11:59:26 -04:00
AH_TEMPLATE(HAVE_SSSD, [Define to 1 to enable SSSD support.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_OPIE, [Define to 1 if you use NRL OPIE.])
2013-08-16 13:50:48 -06:00
AH_TEMPLATE(HAVE_OPTRESET, [Define to 1 if you have the `optreset' symbol.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_PAM, [Define to 1 if you use PAM authentication.])
2010-07-12 17:57:53 -04:00
AH_TEMPLATE(HAVE_PAM_LOGIN, [Define to 1 if you use a specific PAM session for sudo -i.])
2007-06-20 19:04:30 +00:00
AH_TEMPLATE(HAVE_PROJECT_H, [Define to 1 if you have the <project.h> header file.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_SECURID, [Define to 1 if you use SecurID for authentication.])
2008-02-09 14:30:06 +00:00
AH_TEMPLATE(HAVE_SELINUX, [Define to 1 to enable SELinux RBAC support.])
2010-06-24 15:31:05 -04:00
AH_TEMPLATE(HAVE_SETKEYCREATECON, [Define to 1 if you have the `setkeycreatecon' function.])
2010-09-26 17:41:35 -04:00
AH_TEMPLATE(HAVE_SHL_LOAD, [Define to 1 if you have the `shl_load' function.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_SKEY, [Define to 1 if you use S/Key.])
AH_TEMPLATE(HAVE_SKEYACCESS, [Define to 1 if your S/Key library has skeyaccess().])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(HAVE_RFC1938_SKEYCHALLENGE, [Define to 1 if the skeychallenge() function is RFC1938-compliant and takes 4 arguments.])
2014-06-27 16:01:40 -06:00
AH_TEMPLATE(HAVE_SOLARIS_AUDIT, [Define to 1 to enable Solaris audit support.])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(HAVE_ST__TIM, [Define to 1 if your struct stat uses an st__tim union.])
AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member.])
AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member.])
2018-11-14 13:37:46 -07:00
AH_TEMPLATE(HAVE_ST_NMTIME, [Define to 1 if your struct stat has an st_nmtime member.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE___PROGNAME, [Define to 1 if your crt0.o defines the __progname symbol for you.])
AH_TEMPLATE(HOST_IN_LOG, [Define to 1 if you want the hostname to be entered into the log file.])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(IGNORE_DOT_PATH, [Define to 1 if you want to ignore '.' and empty PATH elements.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(LOGGING, [Define to SLOG_SYSLOG, SLOG_FILE, or SLOG_BOTH.])
AH_TEMPLATE(LONG_OTP_PROMPT, [Define to 1 if you want a two line OTP (S/Key or OPIE) prompt.])
AH_TEMPLATE(NO_AUTHENTICATION, [Define to 1 if you don't want sudo to prompt for a password by default.])
2016-01-27 15:37:25 -07:00
AH_TEMPLATE(NO_LEAKS, [Define to 1 if you want sudo to free up memory before exiting.])
2020-07-21 08:48:09 -05:00
AH_TEMPLATE(NO_LECTURE, [Define to 1 if you don't want users to get the lecture the first time they use sudo.])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(NO_PAM_SESSION, [Define to 1 if you don't want to use sudo's PAM session support.])
2020-05-06 09:27:43 -06:00
AH_TEMPLATE(NO_ROOT_MAILER, [Define to avoid running the mailer as root.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(NO_ROOT_SUDO, [Define to 1 if root should not be allowed to use sudo.])
2017-08-01 16:14:54 -06:00
AH_TEMPLATE(TIMESTAMP_TYPE, [Define to global, ppid or tty to set the default timestamp record type.])
2017-09-18 10:45:02 -06:00
AH_TEMPLATE(OFFENSIVE_INSULTS, [Define to 1 to include offensive insults from the classic version of sudo.])
2015-02-20 06:30:41 -07:00
AH_TEMPLATE(PREFER_PORTABLE_GETCWD, [Define to 1 to enable replacement getcwd if system getcwd is broken.])
AH_TEMPLATE(SECURE_PATH, [A colon-separated list of directories to override the user's PATH with.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(SEND_MAIL_WHEN_NOT_OK, [Define to 1 to send mail when the user is not allowed to run a command.])
AH_TEMPLATE(SEND_MAIL_WHEN_NO_HOST, [Define to 1 to send mail when the user is not allowed to run sudo on this host.])
AH_TEMPLATE(SEND_MAIL_WHEN_NO_USER, [Define to 1 to send mail when the user is not in the sudoers file.])
AH_TEMPLATE(SHELL_IF_NO_ARGS, [Define to 1 if you want sudo to start a shell if given no arguments.])
AH_TEMPLATE(SHELL_SETS_HOME, [Define to 1 if you want sudo to set $HOME in shell mode.])
2013-11-22 16:35:15 -07:00
AH_TEMPLATE(STATIC_SUDOERS_PLUGIN, [Define to 1 to compile the sudoers plugin statically into the sudo binary.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(STUB_LOAD_INTERFACES, [Define to 1 if the code in interfaces.c does not compile for you.])
2010-09-14 17:18:55 -04:00
AH_TEMPLATE(UMASK_OVERRIDE, [Define to 1 to use the umask specified in sudoers even when it is less restrictive than the invoking user's.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(USE_INSULTS, [Define to 1 if you want to insult the user for entering an incorrect password.])
AH_TEMPLATE(USE_STOW, [Define to 1 if you use GNU stow packaging.])
AH_TEMPLATE(WITHOUT_PASSWD, [Define to avoid using the passwd/shadow file for authentication.])
2014-01-30 15:50:40 -07:00
AH_TEMPLATE(clockid_t, [Define to `int' if <time.h> does not define.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(sig_atomic_t, [Define to `int' if <signal.h> does not define.])
2011-12-01 11:27:57 -05:00
AH_TEMPLATE(socklen_t, [Define to `unsigned int' if <sys/socket.h> doesn't define.])
2011-10-22 14:20:52 -04:00
AH_TEMPLATE(HAVE___FUNC__, [Define to 1 if the compiler supports the C99 __func__ variable.])
2013-08-20 15:14:17 -06:00
AH_TEMPLATE(HAVE___INTERPOSE, [Define to 1 if you have dyld with __interpose attribute support.])
2013-04-03 09:54:11 -04:00
AH_TEMPLATE(SUDO_KRB5_INSTANCE, [An instance string to append to the username (separated by a slash) for Kerberos V authentication.])
2012-02-21 13:26:02 -05:00
AH_TEMPLATE(RTLD_PRELOAD_VAR, [The environment variable that controls preloading of dynamic objects.])
AH_TEMPLATE(RTLD_PRELOAD_ENABLE_VAR, [An extra environment variable that is required to enable preloading (if any).])
AH_TEMPLATE(RTLD_PRELOAD_DELIM, [The delimiter to use when defining multiple preloaded objects.])
AH_TEMPLATE(RTLD_PRELOAD_DEFAULT, [The default value of preloaded objects (if any).])
2012-06-13 16:57:49 -04:00
AH_TEMPLATE(HAVE_DSO_VISIBILITY, [Define to 1 if the compiler supports the __visibility__ attribute.])
2012-08-28 10:11:38 -04:00
AH_TEMPLATE(HAVE_SYS_SIGABBREV, [Define to 1 if your libc has the `sys_sigabbrev' symbol.])
2013-01-22 15:41:15 -05:00
AH_TEMPLATE(HAVE_NSS_SEARCH, [Define to 1 if you have the `nss_search' function.])
AH_TEMPLATE(HAVE__NSS_INITF_GROUP, [Define to 1 if you have the `_nss_initf_group' function.])
AH_TEMPLATE(HAVE___NSS_INITF_GROUP, [Define to 1 if you have the `__nss_initf_group' function.])
AH_TEMPLATE(HAVE__NSS_XBYY_BUF_ALLOC, [Define to 1 if you have the `_nss_XbyY_buf_alloc' function.])
AH_TEMPLATE(HAVE___NSS_XBYY_BUF_ALLOC, [Define to 1 if you have the `__nss_XbyY_buf_alloc' function.])
2015-07-09 10:11:25 -06:00
AH_TEMPLATE(NEED_RESOLV_H, [Define to 1 if resolv.h must be included to get the `inet_ntop' or `inet_pton' function prototypes.])
2015-06-17 17:00:21 -06:00
AH_TEMPLATE(HAVE_STRNLEN, [Define to 1 if you have the `strnlen' function.])
2016-03-09 09:39:46 -07:00
AH_TEMPLATE(PAM_SUN_CODEBASE, [Define to 1 if your system uses a Solaris-derived PAM and not Linux-PAM or OpenPAM.])
2018-03-05 17:35:02 -07:00
AH_TEMPLATE(HAVE_KINFO_PROC_44BSD, [Define to 1 if your system has a 4.4BSD-style kinfo_proc struct.])
AH_TEMPLATE(HAVE_KINFO_PROC_FREEBSD, [Define to 1 if your system has a FreeBSD-style kinfo_proc struct.])
AH_TEMPLATE(HAVE_KINFO_PROC2_NETBSD, [Define to 1 if your system has a NetBSD-style kinfo_proc2 struct.])
AH_TEMPLATE(HAVE_KINFO_PROC_OPENBSD, [Define to 1 if your system has an OpenBSD-style kinfo_proc struct.])
2019-11-15 13:19:28 -07:00
AH_TEMPLATE(HAVE_OPENSSL, [Define to 1 if you are using OpenSSL's TLS and sha2 functions.])
2018-05-24 21:04:23 -06:00
AH_TEMPLATE(HAVE_GCRYPT, [Define to 1 if you are using gcrypt's sha2 functions.])
2020-01-23 09:38:09 -07:00
AH_TEMPLATE(HAVE_SSL_CTX_SET_MIN_PROTO_VERSION, [Define to 1 if you have the `SSL_CTX_set_min_proto_version' function or macro.])
2020-11-16 14:39:52 -07:00
AH_TEMPLATE(HAVE_SSL_CTX_SET_CIPHERSUITES, [Define to 1 if you have the `SSL_CTX_set_ciphersuites' function or macro.])
2020-11-09 17:13:04 -07:00
AH_TEMPLATE(SUDOERS_LOG_CLIENT, [Define to 1 to compile support for sudo_logsrvd in the sudoers plugin.])
2020-08-01 13:10:50 -06:00
AH_TEMPLATE(HAVE_FALLTHROUGH_ATTRIBUTE, [Define to 1 if the compiler supports the fallthrough attribute.])
2020-01-21 13:27:40 -07:00
2004-09-08 15:49:26 +00:00
dnl
dnl Bits to copy verbatim into config.h.in
2002-01-02 22:36:50 +00:00
dnl
2015-05-21 11:13:20 -06:00
AH_TOP([#ifndef SUDO_CONFIG_H
#define SUDO_CONFIG_H])
2002-01-02 22:36:50 +00:00
2020-08-12 09:57:42 -06:00
AH_BOTTOM([/* Symbol visibility controls */
#ifdef HAVE_DSO_VISIBILITY
# if defined(__GNUC__)
# define sudo_dso_public __attribute__((__visibility__("default")))
# elif defined(__SUNPRO_C)
# define sudo_dso_public __global
# else
# define sudo_dso_public __declspec(dllexport)
# endif
#else
# define sudo_dso_public
#endif
/* BSD compatibility on some SVR4 systems. */
2002-01-02 22:36:50 +00:00
#ifdef __svr4__
# define BSD_COMP
2015-06-18 09:33:05 -06:00
#endif
/* Enable BSD extensions on systems that have them. */
#ifndef _BSD_SOURCE
# undef _BSD_SOURCE
#endif
2019-12-25 11:21:49 -07:00
/* Enable OpenBSD extensions on NetBSD. */
#ifndef _OPENBSD_SOURCE
# undef _OPENBSD_SOURCE
#endif
2015-06-18 09:33:05 -06:00
/* Enable BSD types on IRIX. */
#ifndef _BSD_TYPES
# undef _BSD_TYPES
#endif
/* Enable Linux-compatible extensions on AIX. */
#ifndef _LINUX_SOURCE_COMPAT
# undef _LINUX_SOURCE_COMPAT
#endif
2020-12-07 13:15:25 -07:00
/* Enable unlimited getgroups(2) support on macOS. */
#ifndef _DARWIN_UNLIMITED_GETGROUPS
# undef _DARWIN_UNLIMITED_GETGROUPS
#endif
2015-06-18 09:33:05 -06:00
/* Enable prototypes in GCC fixed includes on older systems. */
#ifndef __USE_FIXED_PROTOTYPES__
# undef __USE_FIXED_PROTOTYPES__
#endif
/* Enable XPG4v2 extensions to POSIX, needed for MSG_WAITALL on older HP-UX. */
#ifndef _XOPEN_SOURCE_EXTENDED
# undef _XOPEN_SOURCE_EXTENDED
#endif
2015-06-19 12:35:51 -06:00
/* Enable reentrant versions of the standard C API (obsolete). */
#ifndef _REENTRANT
# undef _REENTRANT
#endif
2015-06-18 09:33:05 -06:00
/* Enable "safer" versions of the standard C API (ISO C11). */
#ifndef __STDC_WANT_LIB_EXT1__
# undef __STDC_WANT_LIB_EXT1__
#endif
2002-01-02 22:36:50 +00:00
2016-05-04 13:01:57 -06:00
/* Prevent static analyzers from genering bogus memory leak warnings. */
#if defined(__COVERITY__) && !defined(NO_LEAKS)
# define NO_LEAKS
#endif
2015-05-21 11:13:20 -06:00
#endif /* SUDO_CONFIG_H */])