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
2022-03-01 12:31:36 -07:00
dnl Copyright (c) 1994-1996, 1998-2022 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
2021-04-06 14:28:06 -06:00
AC_PREREQ([2.70])
2022-12-26 10:47:51 -07:00
AC_INIT([sudo], [1.9.13], [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])
2021-04-06 14:23:38 -06:00
AC_CONFIG_AUX_DIR([scripts])
1994-03-09 23:51:22 +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])
2021-10-07 08:19:11 -06:00
AC_SUBST([SUDOERS_LT_STATIC])
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])
2022-06-06 08:36:44 -06:00
AC_SUBST([EXAMPLES])
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])
2022-05-23 00:55:16 -06:00
AC_SUBST([AAMAN])
2010-05-21 19:25:17 -04:00
AC_SUBST([devdir])
AC_SUBST([mansectsu])
AC_SUBST([mansectform])
2022-02-10 18:26:24 -07:00
AC_SUBST([mansectmisc])
2021-08-09 15:50:25 -06:00
AC_SUBST([INTERCEPTFILE])
AC_SUBST([INTERCEPTDIR])
AC_SUBST([intercept_file])
2010-05-21 19:25:17 -04:00
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])
2021-08-09 15:50:25 -06:00
AC_SUBST([INSTALL_INTERCEPT])
2010-05-21 19:25:17 -04:00
AC_SUBST([INSTALL_NOEXEC])
2021-08-09 15:50:25 -06:00
AC_SUBST([PRELOAD_MODULE])
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])
2021-10-20 18:59:13 -06:00
AC_SUBST([LIBCRYPTO])
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])
2022-04-01 11:14:59 -06:00
AC_SUBST([HARDENING_LDFLAGS])
AC_SUBST([HARDENING_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])
2021-09-08 11:09:59 -06:00
AC_SUBST([INTERCEPT_EXP])
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
2021-04-23 16:54:15 -06:00
AC_SUBST([relay_dir])dnl real initial value from SUDO_RELAY_DIR
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])
2022-12-26 07:43:55 -07:00
AC_SUBST([sudoers_plugin])
2022-12-30 13:38:40 -07:00
AC_SUBST([python_plugin])
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
2021-05-02 08:28:19 -06:00
relay_dir=/var/log/sudo_logsrvd
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
2021-08-09 15:50:25 -06:00
intercept_file="$libexecdir/sudo/sudo_intercept.so"
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"
2022-12-26 07:43:55 -07:00
sudoers_plugin="sudoers.so"
2022-12-30 13:38:40 -07:00
python_plugin="python_plugin.so"
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=
2021-08-09 15:50:25 -06:00
INSTALL_INTERCEPT=
2010-06-11 18:34:24 -04:00
INSTALL_NOEXEC=
2021-08-09 15:50:25 -06:00
PRELOAD_MODULE=-module
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'}
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
2022-05-23 00:55:16 -06:00
AAMAN=0
2011-05-17 16:38:40 -04:00
LIBINTL=
2021-10-20 18:59:13 -06:00
LIBCRYPTO=
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)'
2021-09-08 11:09:59 -06:00
INTERCEPT_EXP=
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
2022-02-11 19:07:08 -07:00
LOGSRVD_CONF='sudo_logsrvd.conf'
2022-05-19 17:01:14 -06:00
LIBLOGSRV='$(top_builddir)/lib/logsrv/liblogsrv.la $(top_builddir)/lib/protobuf-c/libprotobuf-c.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
2021-05-06 14:41:35 -06:00
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) ;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --with-devel: $with_devel])
2010-07-28 09:24:55 -04:00
;;
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) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-bsm-audit does not take an argument.])
2009-02-11 01:18:02 +00:00
;;
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) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-linux-audit does not take an argument.])
2010-06-16 11:17:02 -04:00
;;
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) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-solaris-audit does not take an argument.])
2014-06-27 16:01:40 -06:00
;;
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) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-sssd does not take an argument.])
2012-08-10 11:59:26 -04:00
;;
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-incpath an argument.])
1998-10-18 21:45:02 +00:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-incpath not supported.])
1998-10-18 21:45:02 +00:00
;;
2021-05-06 14:41:35 -06: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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-libpath an argument.])
1998-10-18 21:45:02 +00:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-libpath not supported.])
1998-10-18 21:45:02 +00:00
;;
2021-05-06 14:41:35 -06: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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-libraries an argument.])
1998-10-18 21:45:02 +00:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-libraries not supported.])
1998-10-18 21:45:02 +00:00
;;
2021-05-06 14:41:35 -06: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(csops, [AS_HELP_STRING([--with-csops], [add CSOps standard options])],
2004-09-08 15:49:26 +00:00
[case $with_csops in
2021-05-06 14:41:35 -06: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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='7'}
1998-10-18 21:45:02 +00:00
;;
no) ;;
2021-05-06 13:14:58 -06: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
2021-05-06 13:14:58 -06:00
yes|no) AUTH_DEF=""
2007-09-05 22:16:22 +00:00
test "$with_passwd" = "yes" && AUTH_REG="$AUTH_REG passwd"
1999-07-22 12:46:29 +00:00
;;
2021-05-06 14:41:35 -06: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)
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)
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)
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
;;
2021-05-06 14:41:35 -06: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)
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)
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) ;;
2021-05-06 13:14:58 -06: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) ;;
2021-05-06 14:41:35 -06: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) ;;
2021-05-06 14:41:35 -06: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)
2007-09-05 22:16:22 +00:00
AUTH_REG="$AUTH_REG AFS"
1996-04-02 23:48:08 +00:00
;;
no) ;;
2021-05-06 14:41:35 -06: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)
2007-09-05 22:16:22 +00:00
AUTH_REG="$AUTH_REG DCE"
1996-04-02 23:48:08 +00:00
;;
no) ;;
2021-05-06 14:41:35 -06: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) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-logincap does not take an argument.])
2000-03-07 04:29:46 +00:00
;;
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) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-bsdauth does not take an argument.])
2000-10-26 16:42:40 +00:00
;;
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) ;;
2021-05-06 13:14:58 -06:00
no) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-project does not take an argument.])
2007-06-19 22:24:51 +00:00
;;
esac])
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
2021-05-06 13:14:58 -06:00
;;
2003-12-30 22:34:28 +00:00
no|none|never) lecture=never
2021-05-06 13:14:58 -06:00
AC_DEFINE(NO_LECTURE)
;;
2021-05-06 14:41:35 -06: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])
1998-10-15 06:24:42 +00:00
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-logging an argument.])
1998-03-28 00:46:12 +00:00
;;
2021-05-06 14:41:35 -06: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-15 06:24:42 +00:00
;;
file) AC_DEFINE(LOGGING, SLOG_FILE)
;;
both) AC_DEFINE(LOGGING, SLOG_BOTH)
;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([unknown argument to --with-logging: $with_logging])
1998-10-15 06:24:42 +00:00
;;
2021-05-06 13:14:58 -06:00
esac], [
with_logging=syslog
AC_DEFINE(LOGGING, SLOG_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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-logfac an argument.])
1998-10-15 06:24:42 +00:00
;;
2021-05-06 14:41:35 -06: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
;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([$with_logfac is not a supported syslog facility.])
1999-11-08 22:45:42 +00:00
;;
2000-08-13 21:09:22 +00:00
esac])
1998-10-15 06:24:42 +00:00
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-goodpri an argument.])
1999-08-05 14:30:57 +00:00
;;
2021-05-06 14:41:35 -06: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
;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([$with_goodpri is not a supported syslog priority.])
1999-11-08 22:45:42 +00:00
;;
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.])
1999-08-05 14:30:57 +00:00
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-badpri an argument.])
1999-08-05 14:30:57 +00:00
;;
2021-05-06 14:41:35 -06: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.])
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-logpath an argument.])
1998-10-17 04:30:21 +00:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-logpath not supported.])
1998-10-17 04:30:21 +00:00
;;
esac])
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-loglen an argument.])
1998-10-15 06:24:42 +00:00
;;
2021-05-06 14:41:35 -06: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
;;
2021-05-06 14:41:35 -06: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).])
1998-10-15 03:31:26 +00:00
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
2021-05-06 13:14:58 -06:00
AC_DEFINE(IGNORE_DOT_PATH)
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
;;
2021-05-06 14:41:35 -06: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])
1998-10-15 06:24:42 +00:00
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
;;
2021-05-06 14:41:35 -06: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
fi
1998-10-15 06:24:42 +00:00
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
2021-05-06 13:14:58 -06:00
AC_DEFINE(SEND_MAIL_WHEN_NO_HOST)
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
;;
2021-05-06 14:41:35 -06: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])
1999-08-19 16:30:09 +00:00
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
2021-05-06 13:14:58 -06:00
AC_DEFINE(SEND_MAIL_WHEN_NOT_OK)
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
;;
2021-05-06 14:41:35 -06: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])
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-mailto an argument.])
2000-08-13 21:09:22 +00:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-mailto not supported.])
2000-08-13 21:09:22 +00:00
;;
*) 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
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-mailsubject an argument.])
2000-08-13 21:09:22 +00:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_WARN([sorry, --without-mailsubject not supported.])
2000-08-13 21:09:22 +00:00
;;
*) mailsub="$with_mailsubject"
;;
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
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-passprompt an argument.])
1998-10-15 03:31:26 +00:00
;;
2021-05-06 14:41:35 -06: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])
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
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-badpass-message an argument.])
1998-10-15 03:31:26 +00:00
;;
2021-05-06 14:41:35 -06: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.])
1998-10-15 03:31:26 +00:00
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
2021-05-06 13:14:58 -06:00
AC_DEFINE(FQDN)
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
;;
2021-05-06 14:41:35 -06: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])
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
2021-05-06 14:41:35 -06: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])
2022-11-16 10:10:20 -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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-rundir an argument.])
2014-02-01 05:57:34 -07:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-rundir not supported.])
1998-03-28 00:46:12 +00:00
;;
esac])
2022-11-16 10:10:20 -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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-vardir an argument.])
2014-01-30 15:50:40 -07:00
;;
2021-05-06 14:41:35 -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) ;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-iologdir not supported.])
2010-03-04 08:12:36 -05:00
;;
esac])
2021-04-23 16:54:15 -06:00
AC_ARG_WITH(relaydir, [AS_HELP_STRING([--with-relaydir=DIR], [directory to store sudo_logsrvd relay temporary files in])],
[case $with_relaydir in
yes) ;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-relaydir not supported.])
2021-04-23 16:54:15 -06: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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-tzdir an argument.])
2015-02-06 11:01:05 -07:00
;;
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-sudoers-mode an argument.])
1998-10-15 03:31:26 +00:00
;;
2021-05-06 14:41:35 -06: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
;;
2021-05-06 14:41:35 -06: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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-sudoers-uid an argument.])
1998-10-15 03:31:26 +00:00
;;
2021-05-06 14:41:35 -06: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
;;
2021-05-06 14:41:35 -06: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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-sudoers-gid an argument.])
1998-10-15 03:31:26 +00:00
;;
2021-05-06 14:41:35 -06: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
;;
2021-05-06 14:41:35 -06: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
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
2021-05-06 14:41:35 -06: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
;;
2021-05-06 14:41:35 -06: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.])
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
;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-umask-override does not take an argument.])
2010-09-14 17:18:55 -04:00
;;
esac])
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-runas-default an argument.])
1998-10-15 03:31:26 +00:00
;;
2021-05-06 14:41:35 -06: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.])
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-exempt an argument.])
1998-10-15 03:31:26 +00:00
;;
2021-05-06 14:41:35 -06: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-15 03:31:26 +00:00
;;
esac])
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-editor an argument.])
1998-10-15 03:31:26 +00:00
;;
2021-05-06 14:41:35 -06: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.])
2010-07-14 09:33:53 -04:00
editor="$with_editor"
1998-10-15 03:31:26 +00:00
;;
2021-05-06 13:14:58 -06:00
esac], [AC_DEFINE(EDITOR, _PATH_VI)])
1998-10-15 03:31:26 +00:00
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
;;
2021-05-06 14:41:35 -06: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
fi
1998-10-15 03:31:26 +00:00
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) ;;
2021-05-06 14:41:35 -06: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
;;
2021-05-06 14:41:35 -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.])
1998-10-15 03:31:26 +00:00
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
;;
2021-05-06 14:41:35 -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.])
1998-10-15 03:31:26 +00:00
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
;;
2021-05-06 14:41:35 -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).])
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
;;
2021-05-06 14:41:35 -06: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
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
2021-05-06 13:14:58 -06:00
AC_DEFINE(USE_INSULTS)
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
;;
2021-05-06 14:41:35 -06: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])
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) ;;
2021-05-06 14:41:35 -06: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) ;;
2021-05-06 14:41:35 -06: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) ;;
2021-05-06 14:41:35 -06: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) ;;
2021-05-06 14:41:35 -06: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) ;;
2021-05-06 14:41:35 -06: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) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-python-insults does not take an argument.])
2018-04-17 07:10:43 -06:00
;;
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
;;
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
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")
secure_path="set to $with_secure_path"
1998-10-18 22:12:36 +00:00
;;
2021-05-06 13:14:58 -06:00
no) ;;
1998-10-18 05:09:37 +00:00
*) AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
2021-05-06 13:14:58 -06:00
secure_path="set to $with_secure_path"
1998-10-15 03:31:26 +00:00
;;
2021-05-06 13:14:58 -06:00
esac])
1998-10-15 03:31:26 +00:00
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
2021-05-06 13:14:58 -06:00
yes) ;;
2004-09-08 15:49:26 +00:00
no) AC_DEFINE(STUB_LOAD_INTERFACES)
1998-10-15 06:24:42 +00:00
;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-interfaces does not take an argument.])
1998-10-15 06:24:42 +00:00
;;
2021-05-06 13:14:58 -06:00
esac])
1998-10-15 06:24:42 +00:00
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
2021-05-06 14:41:35 -06: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
])
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-exampledir an argument.])
2015-04-06 15:10:26 -06:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-exampledir not supported.])
2015-04-06 15:10:26 -06:00
;;
*) 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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --with-plugindir an argument.])
2010-02-20 09:41:49 -05:00
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-plugindir not supported.])
2019-07-03 13:13:04 -06:00
;;
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
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-man not supported.])
2012-07-19 13:41:14 -04:00
;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --with-man: $with_man.])
2012-07-19 13:41:14 -04:00
;;
esac])
AC_ARG_WITH(mdoc, [AS_HELP_STRING([--with-mdoc], [manual pages use mdoc macros])],
[case $with_mdoc in
yes) MANTYPE=mdoc
;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-mdoc not supported.])
2012-07-19 13:41:14 -04:00
;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --with-mdoc: $with_mdoc.])
2012-07-19 13:41:14 -04:00
;;
esac])
1998-10-15 03:31:26 +00:00
dnl
dnl Options for --enable
dnl
1999-08-12 14:37:27 +00:00
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
2021-05-06 13:14:58 -06:00
yes) ;;
no) AC_DEFINE(NO_AUTHENTICATION)
1999-08-12 14:37:27 +00:00
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-authentication: $enableval])
1999-08-12 14:37:27 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
1999-08-12 14:37:27 +00:00
2002-01-16 21:26:13 +00:00
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
2021-05-06 13:14:58 -06:00
yes) ;;
no) AC_DEFINE(NO_ROOT_MAILER)
2002-01-16 21:26:13 +00:00
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-root-mailer: $enableval])
2002-01-16 21:26:13 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
2002-01-16 21:26:13 +00:00
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-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
2021-05-06 13:14:58 -06:00
yes) ;;
no) CHECKSHADOW="false"
1998-10-15 03:31:26 +00:00
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-shadow: $enableval])
1998-10-15 03:31:26 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
1998-10-15 03:31:26 +00:00
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
2021-05-06 13:14:58 -06:00
yes) ;;
2004-09-08 15:49:26 +00:00
no) AC_DEFINE(NO_ROOT_SUDO)
2004-02-01 20:20:30 +00:00
root_sudo=off
1998-10-18 21:45:02 +00:00
;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--enable-root-sudo does not take an argument.])
1998-10-18 21:45:02 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
1998-10-18 21:45:02 +00:00
1998-10-15 03:31:26 +00:00
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
2021-05-06 13:14:58 -06:00
yes) AC_DEFINE(HOST_IN_LOG)
1998-10-15 03:31:26 +00:00
;;
2021-05-06 13:14:58 -06:00
no) ;;
*) AC_MSG_WARN([ignoring unknown argument to --enable-log-host: $enableval])
1998-10-15 03:31:26 +00:00
;;
esac
2022-12-06 12:18:26 -07:00
])
1998-10-15 03:31:26 +00:00
1998-10-15 06:24:42 +00:00
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
2021-05-06 13:14:58 -06:00
yes) AC_DEFINE(SHELL_IF_NO_ARGS)
1998-10-15 06:24:42 +00:00
;;
2021-05-06 13:14:58 -06:00
no) ;;
*) AC_MSG_WARN([ignoring unknown argument to --enable-noargs-shell: $enableval])
1998-10-15 06:24:42 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
1998-10-15 06:24:42 +00:00
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
2021-05-06 13:14:58 -06:00
yes) AC_DEFINE(SHELL_SETS_HOME)
1998-10-15 06:24:42 +00:00
;;
2021-05-06 13:14:58 -06:00
no) ;;
*) AC_MSG_WARN([ignoring unknown argument to --enable-shell-sets-home: $enableval])
1998-10-15 06:24:42 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
1998-10-15 06:24:42 +00:00
1998-11-08 20:56:52 +00:00
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
2021-05-06 13:14:58 -06:00
yes) ;;
no) 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
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-path-info: $enableval])
1998-11-08 20:56:52 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
1998-11-08 20:56:52 +00:00
2009-03-08 20:57:01 +00:00
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
2021-05-06 13:14:58 -06:00
yes) AC_DEFINE(ENV_DEBUG)
2009-03-08 20:57:01 +00:00
;;
2021-05-06 13:14:58 -06:00
no) ;;
*) AC_MSG_WARN([ignoring unknown argument to --enable-env-debug: $enableval])
2009-03-08 20:57:01 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
2009-03-08 20:57:01 +00:00
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_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
2021-05-06 13:14:58 -06:00
AC_MSG_WARN([ignoring unknown argument to --enable-env-reset: $enableval])
2011-01-28 16:52:25 -05:00
;;
esac
])
if test "$env_reset" = "on"; then
2011-12-02 11:27:33 -05:00
AC_DEFINE(ENV_RESET, 1)
2011-01-28 16:52:25 -05:00
else
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) ;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-warnings: $enableval])
2010-05-30 11:16:31 -04:00
;;
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) ;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-werror: $enableval])
2011-08-23 10:15:28 -04:00
;;
esac
])
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --enable-fuzzer-engine an argument.])
2021-02-07 05:52:45 -07:00
;;
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
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --enable-fuzzer-linker an argument.])
2021-02-07 05:52:45 -07:00
;;
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)
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --disable-leaks: $enableval])
2021-01-30 06:01:48 -07:00
;;
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
;;
2021-05-06 13:14:58 -06:00
no) AC_MSG_WARN([ignoring attempt to disable the device search path])
2017-05-30 10:44:11 -06:00
;;
*) 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
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([selinux], [setkeycreatecon],
2010-06-24 15:31:05 -04:00
[AC_DEFINE(HAVE_SETKEYCREATECON)])
2008-02-09 14:30:06 +00:00
;;
no) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-selinux does not take an argument.])
2008-02-09 14:30:06 +00:00
;;
2013-03-14 16:49:42 -04:00
esac], [with_selinux=no])
2008-02-09 14:30:06 +00:00
2022-05-23 00:55:16 -06:00
AC_ARG_WITH(apparmor, [AS_HELP_STRING([--with-apparmor], [enable AppArmor support])],
[case $with_apparmor in
yes) AC_DEFINE(HAVE_APPARMOR)
AAMAN=1
2022-05-27 08:30:34 -06:00
SUDO_LIBS="${SUDO_LIBS} -lapparmor"
2022-05-23 00:55:16 -06:00
SUDO_OBJS="${SUDO_OBJS} apparmor.o"
;;
no) ;;
*) AC_MSG_ERROR([--with-apparmor does not take an argument.])
esac], [with_apparmor=no])
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) ;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-sasl: $enableval])
2017-07-28 13:52:55 -06:00
;;
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
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-timestamp-type: $enableval])
2017-08-01 16:14:54 -06:00
;;
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
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-log-server: $enableval])
2020-02-26 13:17:40 -07:00
;;
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)
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-log-client: $enableval])
2020-02-26 13:17:40 -07:00
;;
esac
2020-11-09 17:13:04 -07:00
], [AC_DEFINE([SUDOERS_LOG_CLIENT])])
2020-02-26 13:17:40 -07:00
2021-04-12 14:10:49 -06:00
if test X"${enable_log_client}${enable_log_server}" = X"nono"; then
2020-02-26 13:17:40 -07:00
# 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
2021-04-12 14:10:49 -06:00
dnl
2021-10-26 19:00:16 -06:00
dnl Do OpenSSL / wolfSSL / gcrypt after logsrv options
2021-04-12 14:10:49 -06:00
dnl
AC_ARG_ENABLE(openssl,
[AS_HELP_STRING([--enable-openssl], [Use OpenSSL's TLS and sha2 functions])],
[], [
# Enable OpenSSL by default unless logsrvd and client are disabled
if test X"${enable_log_client}${enable_log_server}" != X"nono"; then
enable_openssl=maybe
fi
])
2021-09-13 09:33:09 -06:00
AC_ARG_ENABLE(openssl-pkgconfig-template,
2021-09-20 15:59:47 -06:00
[AS_HELP_STRING([--enable-openssl-pkgconfig-template], [A printf format string used to construct the OpenSSL pkg-config name])],
2021-09-13 09:33:09 -06:00
[], [enable_openssl_pkgconfig_template="%s"])
2021-04-12 14:10:49 -06:00
2021-10-25 13:17:57 -06:00
AC_ARG_ENABLE(wolfssl,
2021-10-26 19:00:16 -06:00
[AS_HELP_STRING([--enable-wolfssl], [Use wolfSSL's TLS and sha2 functions])], [
2021-10-25 13:17:57 -06:00
enable_openssl=no
])
2021-04-12 14:10:49 -06:00
AC_ARG_ENABLE(gcrypt,
[AS_HELP_STRING([--enable-gcrypt], [Use GNU crypt's sha2 functions])], [
2021-10-25 13:17:57 -06:00
if test "${enable_openssl-no}${enable_wolfssl-no}" != "nono"; then
2021-10-26 19:00:16 -06:00
AC_MSG_WARN([ignoring --enable-gcrypt when OpenSSL or wolfSSL is enabled.])
2021-04-12 14:10:49 -06:00
enable_gcrypt=no
fi
])
2021-05-06 13:14:58 -06:00
AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python], [Compile python plugin support])],
[ case "$enableval" in
yes|no)
;;
*) AC_MSG_WARN([ignoring unknown argument to --enable-python: $enableval])
;;
esac
])
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
2021-08-19 09:50:05 -06:00
AX_PROG_CC_FOR_BUILD
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
2021-05-06 13:14:58 -06:00
AC_MSG_WARN([ignoring --disable-static, sudo does not install static libs])
2011-10-12 08:24:13 -04:00
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
2022-12-05 09:47:21 -07:00
dnl
dnl Relies on CC host being set
dnl
SUDO_PVS_STUDIO_CFG
2020-09-05 15:38:33 -06:00
dnl
2022-11-11 08:45:58 -07:00
dnl On HP-UX 11.11 and higher we prefer dlopen() over shl_load().
dnl Libtool defaults to shl_load() so we need to prime the cache
dnl to override that default.
2020-09-05 15:38:33 -06:00
dnl
case "$host_os" in
2022-11-11 08:45:58 -07:00
hpux11.1[[1-9]]|hpux11.[[2-9]][[0-9]]|hpux1[[2-9]].*)
2020-09-05 15:38:33 -06:00
# 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
2022-12-26 07:43:55 -07:00
dnl
dnl AIX supports two distinct flavors of shared libraries.
dnl Traditional AIX shared libs are .a files with a .so inside.
dnl AIX SVR4-style shared libs are plain .so files. The --with-aix-soname
dnl option can be used to select the type. We need to set the default
dnl values to match. This must come after the LT_INIT() call.
dnl
case "$host_os" in
aix*)
if test X"$aix_use_runtimelinking" != X"yes"; then
# Using traditional AIX dynamic shared objects in an archive file.
noexec_file="$libexecdir/sudo/sudo_noexec.a(sudo_noexec.so)"
intercept_file="$libexecdir/sudo/sudo_intercept.a(sudo_intercept.so)"
sudoers_plugin="sudoers.a(sudoers.so)"
2022-12-30 13:38:40 -07:00
python_plugin="python_plugin.a(python_plugin.so)"
2022-12-26 07:43:55 -07:00
fi
;;
esac
SUDO_DEFINE_UNQUOTED([_PATH_SUDOERS_PLUGIN], ["$sudoers_plugin"])
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) ;;
2021-05-06 14:41:35 -06:00
no) AC_MSG_ERROR([--without-libtool not supported.])
2012-10-28 12:58:48 -04:00
;;
system) LIBTOOL=libtool
;;
*) LIBTOOL="$with_libtool"
;;
esac])
2004-01-09 06:15:34 +00:00
dnl
2021-08-09 15:50:25 -06:00
dnl Defer enable_intercept and with_noexec until after libtool magic runs
2004-01-09 06:15:34 +00:00
dnl
2004-01-09 07:58:04 +00:00
if test "$enable_shared" = "no"; then
2021-08-09 15:50:25 -06:00
enable_intercept=no
2004-01-09 07:58:04 +00:00
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
2021-08-09 15:50:25 -06:00
AC_ARG_ENABLE(intercept,
[AS_HELP_STRING([--enable-intercept], [fully qualified pathname of sudo_intercept.so])],
[ case "$enableval" in
yes) ;;
no) ;;
*) intercept_file="$enableval"
;;
esac
], [enable_intercept="$intercept_file"])
INTERCEPTFILE="sudo_intercept.so"
INTERCEPTDIR="`echo $intercept_file|sed -e 's:^${\([[^}]]*\)}:$(\1):' -e 's:^\(.*\)/[[^/]]*:\1:'`"
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"])
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
2021-11-10 13:31:42 -07:00
AC_PATH_PROG(SHA1SUM, [sha1sum], [openssl dgst -sha1])
2012-08-15 10:32:25 -04:00
AC_PATH_PROG(UNAMEPROG, [uname], [uname])
AC_PATH_PROG(TRPROG, [tr], [tr])
2022-12-06 12:18:26 -07:00
AC_CACHE_CHECK([for mandoc or nroff], [ac_cv_path_NROFF], [
AC_PATH_PROGS_FEATURE_CHECK([NROFF], [mandoc nroff], [ac_cv_path_NROFF="$ac_path_NROFF"], [ac_cv_path_NROFF=no])
])
case "$ac_cv_path_NROFF" in
*mandoc|no)
# Prefer mdoc format for mandoc (or when no formatter is present).
2012-08-15 10:32:25 -04:00
: ${MANTYPE='mdoc'}
2022-12-06 12:18:26 -07:00
;;
*)
# Check whether nroff supports -mdoc, this may produce incorrect
# results when cross-compiling.
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 $ac_cv_path_NROFF -mdoc conftest >/dev/null 2>&1; then
sudo_cv_var_mantype="mdoc"
fi
rm -f conftest
]
)
MANTYPE="$sudo_cv_var_mantype"
;;
esac
1995-06-18 17:58:42 +00:00
1994-05-24 16:50:57 +00:00
dnl
2021-05-06 13:14:58 -06:00
dnl If a config.cache exists make sure it matches the current 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
fi
1996-07-24 17:02:18 +00:00
fi
2022-12-06 13:47:03 -07:00
sudo_cv_prev_host="$host"
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
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
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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
2021-03-07 07:51:59 -07:00
: ${ac_cv_func_strnlen='no'}
fi
2022-05-29 15:52:48 -06:00
# fmemopen(3) has a bug wrt feof() on some AIX versions.
# https://www.ibm.com/support/pages/apar/IJ11845
: ${ac_cv_func_fmemopen='no'}
2017-01-05 06:22:58 -07:00
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
2021-03-07 07:51:59 -07: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
2021-03-07 07:51:59 -07:00
: ${ac_cv_func_memset_s='no'}
2018-08-22 08:09:46 -06:00
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*)
2022-11-11 08:45:58 -07:00
# HI-UX/MPP is based on OSF/1
2014-02-16 11:00:41 -07:00
2022-11-11 08:45:58 -07:00
# ignore envariables wrt dynamic lib path
AX_APPEND_FLAG([-Wl,-no_library_replacement], [SUDO_LDFLAGS])
2014-02-16 11:00:41 -07:00
2022-11-11 08:45:58 -07:00
shadow_funcs="getprpwnam dispcrypt"
shadow_libs="-lsecurity"
2016-07-08 12:37:41 -06:00
2022-11-11 08:45:58 -07:00
# ":DEFAULT" must be appended to _RLD_LIST
RTLD_PRELOAD_VAR="_RLD_LIST"
RTLD_PRELOAD_DEFAULT="DEFAULT"
: ${mansectsu='8'}
: ${mansectform='4'}
: ${mansectmisc='5'}
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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
2022-11-11 08:32:41 -07:00
AC_CHECK_HEADERS([utmps.h])
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_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
2021-05-06 13:14:58 -06:00
yes) CHECKSIA=true
1998-10-25 04:48:50 +00:00
;;
2021-05-06 13:14:58 -06:00
no) CHECKSIA=false
1998-10-25 04:48:50 +00:00
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-sia: $enableval])
1998-10-25 04:48:50 +00:00
;;
esac
2021-05-06 13:14:58 -06:00
])
1998-10-25 04:48:50 +00:00
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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
2022-11-16 10:22:28 -07: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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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"
2022-06-07 10:50:59 -06:00
# Check for SECCOMP_MODE_FILTER in linux/seccomp.h
AC_CHECK_DECLS([SECCOMP_MODE_FILTER], [], [], [
2016-10-09 11:24:29 -06:00
#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
2022-11-11 08:11:26 -07:00
AC_CHECK_HEADERS([linux/random.h sys/syscall.h])
2021-10-20 09:53:01 -06:00
2022-12-31 09:31:37 -07:00
# Only use our replacement functions when not fuzzing,
# they may skew the coverage reports.
if test X"$enable_fuzzer" = X"no"; then
2022-12-29 13:22:29 -07:00
# glibc's getentropy() emulation may fail on older kernels.
# We use our own getentropy() by default on Linux.
: ${ac_cv_func_getentropy='no'}
# glibc's arc4random() may fail in chroot on older kernels.
# We use our own arc4random() by default on Linux.
: ${ac_cv_func_arc4random='no'}
# glibc's closefrom() emulation may fail in chroot.
# We use our own closefrom() by default on Linux.
: ${ac_cv_func_closefrom='no'}
fi
2022-08-25 12:37:19 -06:00
# Linux 3.2 supports reading/writing a another process
# without using ptrace(2).
AC_CHECK_FUNCS([process_vm_readv])
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
;;
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
1996-10-08 23:22:09 +00:00
;;
2000-11-02 17:46:29 +00:00
*-ncr-sysv4*|*-ncr-sysvr4*)
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([c89], [strcasecmp], [LIBS="${LIBS} -lc89"])
2005-01-14 18:35:06 +00:00
: ${mansectsu='1m'}
: ${mansectform='4'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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'}
2022-03-01 09:25:14 -07:00
# Darwin has a broken poll(), Apple radar 3710161
2013-10-12 05:53:43 -06:00
: ${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
2021-05-13 12:45:56 -06:00
# Build sudo_noexec.so as a shared library, not a module.
# On Darwin, modules and shared libraries are incompatible.
2021-08-09 15:50:25 -06:00
PRELOAD_MODULE=
2021-05-13 12:45:56 -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])])
2021-09-27 13:44:41 -06:00
# We use proc_pidinfo() to emulate closefrom() on macOS.
AC_CHECK_HEADERS([libproc.h], [AC_CHECK_FUNCS([proc_pidinfo])])
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
2020-09-05 19:29:06 -06:00
shadow_funcs="getprpwnam"
shadow_libs="-lprot"
;;
# UnixWare 7.x, OpenUNIX 8
*-*-*sysv5*)
: ${mansectsu='1'}
: ${mansectform='4'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
2020-09-05 19:29:06 -06:00
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='5'}
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
2012-02-21 13:26:02 -05:00
dnl
dnl Library preloading to support NOEXEC
dnl
2021-08-09 15:50:25 -06:00
if test X"$enable_intercept" = X"no"; then
intercept_file=disabled
fi
if test X"$with_noexec" = X"no"; then
noexec_file=disabled
fi
if test X"${intercept_file} ${noexec_file}" != X"disabled disabled"; then
2012-02-21 13:26:02 -05:00
SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_VAR, "$RTLD_PRELOAD_VAR")
2021-08-09 15:50:26 -06:00
SUDO_DEFINE_UNQUOTED(RTLD_PRELOAD_DELIM, '$RTLD_PRELOAD_DELIM')
2012-02-21 13:26:02 -05:00
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
2021-05-06 14:41:35 -06:00
AC_MSG_ERROR([cannot use both S/Key and OPIE])
2007-09-05 22:16:22 +00:00
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'}
2022-02-10 18:26:24 -07:00
: ${mansectmisc='7'}
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
2022-12-05 09:47:21 -07:00
SUDO_CPP_VARIADIC_MACROS
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
2021-05-06 13:14:58 -06:00
with_sendmail="$ac_cv_path_SENDMAILPROG"
1998-10-15 03:31:26 +00:00
fi
2010-10-12 09:08:09 -04:00
SUDO_PROG_VI
1994-03-09 23:51:22 +00:00
dnl
2021-05-06 13:14:58 -06:00
dnl Use fully-qualified path to vi in the manual
dnl
if test -z "$with_editor"; then
editor="$ac_cv_path_VIPROG"
fi
dnl
2010-07-22 17:50:21 -04:00
dnl Check for authpriv support in syslog
dnl
if test X"$with_logfac" = X""; then
2021-05-06 13:14:58 -06:00
AC_CHECK_DECL([LOG_AUTHPRIV], [logfac=authpriv], [], [#include <syslog.h>])
2010-07-22 17:50:21 -04:00
fi
AC_DEFINE_UNQUOTED(LOGFAC, "$logfac", [The syslog facility sudo will use.])
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
2022-11-11 08:11:26 -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/statvfs.h])
2022-11-11 08:32:41 -07:00
if test X"$ac_cv_header_utmps_h" != X"yes"; then
AC_CHECK_HEADERS([utmpx.h])
fi
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
#
2022-04-19 13:28:39 -06:00
# Check for large file and 64-bit time support.
2013-11-12 15:13:54 -07:00
#
2010-10-28 11:17:40 -04:00
AC_SYS_LARGEFILE
2022-11-16 19:29:22 -07:00
AC_SYS_YEAR2038
2022-04-19 13:28:39 -06:00
2023-01-19 07:47:10 -07:00
#
# Don't allow undefined symbols, even in shared libraries, if possible.
2023-01-19 19:40:35 -07:00
# This will detect missing symbols at build-time instead of run-time
# but is incompatible with the sanitizers/fuzzers.
2023-01-19 07:47:10 -07:00
# We must set this *before* the library tests.
#
2023-01-20 12:30:33 -07:00
if test -n "$GCC" -a X"${enable_sanitizer}${enable_fuzzer}" = X"nono"; then
# On FreeBSD and Dragonfly, environ is filled in by the dynamic loader
# so -Wl,--no-undefined causes a link error when environ is used.
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263265
# We use errno because OpenBSD shared libraries don't explicitly
# link with libc, which can result in undefined reference errors.
AC_CACHE_CHECK([the linker accepts -Wl,--no-undefined],
[sudo_cv_var_ld___no_undefined],
[
sudo_cv_var_ld___no_undefined=no
_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $lt_prog_compiler_pic"
_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_prog_compiler_pic -shared -Wl,--no-undefined"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>
extern char **environ;]], [[int ret = ((long)environ & 0xff) + errno; return ret;]])],
[sudo_cv_var_ld___no_undefined=yes])
CFLAGS="$_CFLAGS"
LDFLAGS="$_LDFLAGS"
]
)
if test "$sudo_cv_var_ld___no_undefined" = "yes"; then
AX_APPEND_FLAG([-Wl,--no-undefined], [LDFLAGS])
fi
2023-01-19 19:40:35 -07:00
fi
2023-01-19 07:47:10 -07:00
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
2023-01-20 12:30:33 -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
2023-01-20 12:30:33 -07: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-07-19 12:50:59 -04:00
SUDO_MAILDIR
2005-01-21 15:29:05 +00:00
if test ${with_logincap-'no'} != "no"; then
2023-01-19 13:22:31 -07:00
AC_CHECK_HEADERS([login_cap.h], [
LOGINCAP_USAGE='[[-c class]] '
LCMAN=1
2021-05-06 13:14:58 -06:00
with_logincap=yes
2007-10-21 13:29:18 +00:00
])
2023-01-19 13:22:31 -07:00
if test "${with_logincap}" = "yes"; then
# setusercontext() is in libutil on NetBSD, FreeBSD, Dragonfly BSD.
_LIBS="$LIBS"
AC_SEARCH_LIBS([setusercontext], [util])
LIBS="$_LIBS"
if test "${ac_cv_search_setusercontext}" != "none required"; then
SUDO_LIBS="${SUDO_LIBS} -lutil"
SUDOERS_LIBS="${SUDOERS_LIBS} -lutil"
fi
fi
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, [
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([project], [setproject], [
2011-06-10 15:28:58 -04:00
AC_DEFINE(HAVE_PROJECT_H)
SUDO_LIBS="${SUDO_LIBS} -lproject"
])
2021-05-06 13:14:58 -06:00
], [with_project=no])
2007-06-19 22:24:51 +00:00
fi
1994-03-09 23:51:22 +00:00
dnl
dnl typedef checks
dnl
2022-11-11 07:05:26 -07:00
if test X"${ac_cv_header_stdint_h}${ac_cv_header_inttypes_h}" = X"nono"; then
2023-01-19 13:59:05 -07:00
AC_CHECK_TYPES([int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, intmax_t, uintmax_t])
2022-11-11 07:05:26 -07:00
fi
2023-01-19 13:59:05 -07:00
AC_CHECK_TYPES([sig_atomic_t], [], [], [
AC_INCLUDES_DEFAULT
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>])
2023-01-19 13:59:05 -07:00
AC_CHECK_TYPES(socklen_t, [], [], [
2011-12-01 11:27:57 -05:00
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])
2022-11-11 08:32:41 -07:00
if test X"$ac_cv_header_utmps_h" = X"yes"; then
2018-11-18 07:45:43 -07:00
SUDO_CHECK_UTMP_MEMBERS([utmps])
2022-11-11 08:32:41 -07:00
elif test X"$ac_cv_header_utmpx_h" = X"yes"; then
2018-11-18 07:45:43 -07:00
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
2021-05-06 13:14:58 -06:00
if test ${enable_python-'no'} = "yes"; then
2019-10-22 13:16:22 +02:00
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"], [
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
])
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
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
])
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-08-20 10:59:52 -06:00
AC_FUNC_FSEEKO
2022-11-11 11:04:58 -07:00
AC_CHECK_FUNCS_ONCE([fexecve fmemopen killpg nl_langinfo faccessat wordexp strtoull])
2021-09-08 11:09:59 -06:00
AC_CHECK_FUNCS([execvpe], [SUDO_APPEND_INTERCEPT_EXP(execvpe)])
2021-08-19 19:18:24 -06:00
AC_CHECK_FUNCS([pread], [
# pread/pwrite on 32-bit HP-UX 11.x may not support large files
case "$host_os" in
2022-11-11 08:45:58 -07:00
hpux*)
2021-08-19 19:18:24 -06:00
AC_CHECK_FUNCS([pread64 pwrite64], [
AC_CHECK_DECLS([pread64, pwrite64])
])
;;
esac
], [
2021-01-02 10:43:34 -07:00
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)
])
2021-09-17 10:55:06 -06:00
AC_CHECK_FUNCS([localtime_r], [], [
AC_LIBOBJ(localtime_r)
SUDO_APPEND_COMPAT_EXP(sudo_localtime_r)
])
AC_CHECK_FUNCS([gmtime_r], [], [
AC_LIBOBJ(gmtime_r)
SUDO_APPEND_COMPAT_EXP(sudo_gmtime_r)
])
2021-10-31 09:27:34 -06:00
AC_CHECK_FUNCS([timegm], [], [
AC_LIBOBJ(timegm)
SUDO_APPEND_COMPAT_EXP(sudo_timegm)
])
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
])
], [
2021-06-09 10:43:04 -06:00
dnl HP-UX support disabled until "group: compat" fixed
dnl # HP-UX
dnl AC_CHECK_FUNC([__nss_XbyY_buf_alloc], [
dnl AC_CHECK_FUNC([__nss_initf_group], [
dnl AC_CHECK_HEADERS([nss_dbdefs.h])
dnl AC_DEFINE([HAVE_NSS_SEARCH])
dnl AC_DEFINE([HAVE___NSS_XBYY_BUF_ALLOC])
dnl AC_DEFINE([HAVE___NSS_INITF_GROUP])
dnl ])
dnl])
2013-01-22 15:41:15 -05:00
])
])
;;
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
])
2021-08-13 09:52:02 -06:00
AC_CHECK_FUNCS([getusershell], [
# Older Solaris has getusershell() et al but does not declare it.
AC_CHECK_DECLS([getusershell])
], [
2019-12-09 19:29:45 -07:00
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], [
2021-10-22 10:44:34 -06:00
AC_CHECK_HEADERS([sys/random.h])
2019-10-24 20:04:31 -06:00
], [
AC_LIBOBJ(getentropy)
SUDO_APPEND_COMPAT_EXP(sudo_getentropy)
2022-11-11 11:04:58 -07:00
AC_CHECK_FUNCS([getauxval])
2019-10-24 20:04:31 -06:00
])
# arc4random.c wants pthread_atfork
AC_CHECK_HEADERS([pthread.h], [
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([pthread], [main], [LIBPTHREAD="-lpthread"])
2019-10-24 20:04:31 -06:00
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
2023-01-19 13:22:32 -07:00
AC_CHECK_FUNCS([sysctl], [
AC_CHECK_FUNCS([devname])
# Check for the various flavors of kinfo_proc
found=false
AC_CHECK_MEMBER([struct kinfo_proc.ki_structsize], [
AC_DEFINE(HAVE_KINFO_PROC_FREEBSD)
found=true
], [], [
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/user.h>
2012-01-10 16:49:24 -05:00
])
2023-01-19 13:22:32 -07:00
if test "$found" = "false"; then
AC_CHECK_MEMBER([struct kinfo_proc.kp_paddr], [
AC_DEFINE(HAVE_KINFO_PROC_DFLY)
found=true
], [], [
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/user.h>
])
fi
if test "$found" = "false"; then
AC_CHECK_MEMBER([struct kinfo_proc2.p_paddr], [
AC_DEFINE(HAVE_KINFO_PROC2_NETBSD)
found=true
], [], [
#include <sys/param.h>
#include <sys/sysctl.h>
])
fi
if test "$found" = "false"; then
AC_CHECK_MEMBER([struct kinfo_proc.p_paddr], [
AC_DEFINE(HAVE_KINFO_PROC_OPENBSD)
found=true
], [], [
#include <sys/param.h>
#include <sys/sysctl.h>
])
fi
if test "$found" = "false"; then
AC_CHECK_MEMBER([struct kinfo_proc.kp_proc], [
AC_DEFINE(HAVE_KINFO_PROC_44BSD)
found=true
], [], [
#include <sys/param.h>
#include <sys/sysctl.h>
])
fi
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])], [
2022-11-16 10:22:28 -07: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
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([rt], [nanosleep], [
2017-01-13 21:29:02 -07:00
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
])
2022-09-21 19:08:12 -06:00
AC_CHECK_FUNCS([fchownat], [], [
AC_LIBOBJ(fchownat)
SUDO_APPEND_COMPAT_EXP(sudo_fchownat)
])
2021-12-11 08:35:18 -07:00
AC_CHECK_FUNCS([mkdirat], [], [
AC_LIBOBJ(mkdirat)
SUDO_APPEND_COMPAT_EXP(sudo_mkdirat)
])
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
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([rt], [clock_gettime], [
2014-02-02 08:34:53 -07:00
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)
2021-07-25 19:29:25 -06:00
AC_CACHE_CHECK([for optreset], sudo_cv_optreset, [
2013-08-16 13:50:48 -06:00
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
])
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)
2022-03-01 09:54:23 -07:00
AC_CHECK_DECL(F_CLOSEM, AC_DEFINE(HAVE_FCNTL_CLOSEM), [
# Linux has a special header for close_range(2).
AC_CHECK_FUNCS([close_range], [
case "$host_os" in
linux*) AC_CHECK_HEADERS([linux/close_range.h]);;
esac
])
], [
2013-11-13 14:45:47 -07:00
# include <limits.h>
# include <fcntl.h> ])
2022-03-01 11:31:19 -07:00
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }closefrom_test"
2006-08-17 15:26:54 +00:00
])
2022-09-21 19:08:11 -06:00
sudo_mktemp=no
2022-09-22 11:34:00 -06:00
case "$host_os" in
darwin*)
# macOS has these but uses a _np (non-portable) suffix
AC_CHECK_FUNCS([mkdtempat_np mkostempsat_np], [], [sudo_mktemp=yes; break])
;;
*)
AC_CHECK_FUNCS([mkdtempat mkostempsat], [], [sudo_mktemp=yes; break])
;;
esac
2022-09-21 19:08:11 -06:00
# If any of the mktemp family are missing we use our own.
if test X"$sudo_mktemp" = X"yes"; then
2010-12-27 14:07:49 -05:00
AC_LIBOBJ(mktemp)
2022-09-21 19:08:11 -06:00
SUDO_APPEND_COMPAT_EXP(sudo_mkdtemp sudo_mkdtempat sudo_mkostempsat sudo_mkstemp 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))])
]
)
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>
])
2021-04-12 14:10:49 -06:00
dnl
2022-12-05 16:45:18 -07:00
dnl Check for OpenSSL or wolfSSL
2020-07-16 07:32:13 -06:00
dnl
2022-12-05 16:45:18 -07:00
SUDO_CHECK_OPENSSL
2021-10-25 13:17:57 -06:00
dnl
2022-12-05 16:45:18 -07:00
dnl Check for sha2 functions if not using openssl or wolfssl
2020-07-16 07:32:13 -06:00
dnl
if test "$DIGEST" = "digest.lo"; then
2022-12-05 16:45:18 -07:00
if 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
else
# Use sudo's sha2 functions if not in libmd or libc.
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
])
2020-07-16 07:32:13 -06:00
])
])
2022-12-05 16:45:18 -07:00
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-07-16 07:32:13 -06:00
fi
2020-01-21 13:27:40 -07:00
fi
2022-12-05 16:45:18 -07:00
2019-11-15 13:19:28 -07:00
dnl
2022-12-06 16:09:26 -07:00
dnl Network functions may live in libsocket, libinet, libnsl, or libresolv.
dnl Order is important here.
1998-10-18 23:42:52 +00:00
dnl
2022-12-06 16:09:26 -07:00
SUDO_CHECK_NET_FUNC([socket])
2014-02-03 05:42:39 -07:00
dnl
2022-12-06 16:09:26 -07:00
dnl We need to keep track of inet_pton()'s dependent libraries for
dnl our getaddrinfo() replacement.
2014-07-28 16:11:39 -06:00
dnl
2022-12-06 16:09:26 -07:00
ONET_LIBS="$NET_LIBS"
SUDO_CHECK_NET_FUNC([inet_pton], [
2015-06-30 10:57:42 -06:00
AC_DEFINE(HAVE_INET_PTON)
2022-12-06 16:09:26 -07:00
INET_PTON_LIBS=
for lib in $NET_LIBS; do
case "$ONET_LIBS" in
*"$lib"*) ;;
*) INET_PTON_LIBS="${INET_PTON_LIBS}${INET_PTON_LIBS+ }$lib";;
esac
2014-07-28 16:11:39 -06:00
done
2022-12-06 16:09:26 -07:00
], [
2015-06-30 10:57:42 -06:00
AC_LIBOBJ(inet_pton)
SUDO_APPEND_COMPAT_EXP(sudo_inet_pton)
2022-12-06 16:09:26 -07:00
])
2014-07-28 16:11:39 -06:00
dnl
2022-12-06 16:09:26 -07:00
dnl The check for inet_ntop() must follow inet_pton() for INET_PTON_LIBS.
2014-02-03 05:42:39 -07:00
dnl
2022-12-06 16:09:26 -07:00
SUDO_CHECK_NET_FUNC([inet_ntop], [
2015-06-30 10:57:42 -06:00
AC_DEFINE(HAVE_INET_NTOP)
2014-07-29 10:52:43 -06:00
], [
2015-06-30 10:57:42 -06:00
AC_LIBOBJ(inet_ntop)
SUDO_APPEND_COMPAT_EXP(sudo_inet_ntop)
2022-12-06 16:09:26 -07:00
])
1998-11-24 04:38:53 +00:00
dnl
2022-12-06 16:09:26 -07:00
dnl The check for syslog() must be last so we can detect INET_PTON_LIBS.
dnl
SUDO_CHECK_NET_FUNC([syslog])
dnl
dnl Check for getaddrinfo and add any required libs to NET_LIBS.
dnl If it was added to LIBOBJS we need to export the symbols.
1998-11-03 19:58:47 +00:00
dnl
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
2022-12-06 16:09:26 -07:00
SUDO_CHECK_NET_FUNC([gethostbyname])
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
2021-07-25 15:51:23 -06:00
dnl
dnl Check for va_copy or __va_copy in stdarg.h
dnl
AC_CACHE_CHECK([for va_copy], sudo_cv_func_va_copy, [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
va_list ap1, ap2;]], [[va_copy(ap1, ap2);]])],
[sudo_cv_func_va_copy=yes], [sudo_cv_func_va_copy=no])
])
if test "$sudo_cv_func_va_copy" = "yes"; then
AC_DEFINE(HAVE_VA_COPY)
else
AC_CACHE_CHECK([for __va_copy], sudo_cv_func___va_copy, [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
va_list ap1, ap2;]], [[__va_copy(ap1, ap2);]])],
[sudo_cv_func___va_copy=yes], [sudo_cv_func___va_copy=no])
])
if test "$sudo_cv_func___va_copy" = "yes"; then
AC_DEFINE(HAVE___VA_COPY)
fi
fi
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)])
], [
2021-07-25 19:29:25 -06:00
AC_CACHE_CHECK([for __progname], 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
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
])
2022-12-05 19:26:57 -07:00
2011-10-22 14:20:52 -04:00
dnl
dnl Check for __func__ or __FUNCTION__
dnl
2021-07-25 19:29:25 -06:00
AC_CACHE_CHECK([for __func__], sudo_cv___func__, [
2022-12-05 19:26:57 -07:00
if test X"$ac_cv_prog_cc_c99" = X"no"; then
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[if (__func__[0] == '\0') return 1;]])], [sudo_cv___func__=yes], [sudo_cv___func__=no])
else
# C99 and higher support __func__
sudo_cv___func__=yes
fi
])
2011-10-22 14:20:52 -04:00
if test "$sudo_cv___func__" = "yes"; then
AC_DEFINE(HAVE___FUNC__)
elif test -n "$GCC"; then
2021-07-25 19:29:25 -06:00
AC_CACHE_CHECK([for __FUNCTION__], 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
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
2022-12-05 19:26:50 -07:00
SUDO_CHECK_GETTEXT
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)
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([z], [gzclearerr], [
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
2021-05-06 14:41:35 -06:00
AC_MSG_ERROR([unable to build shared libraries on this system])
2014-10-27 14:39:07 -06:00
fi
# Build as convenience library
ZLIB_LDFLAGS=-no-install
fi
;;
esac
2010-07-15 09:49:32 -04:00
2023-01-31 11:30:45 -07:00
dnl
dnl Check for NSIG, _NSIG or __NSIG declarations in signal.h
dnl
AC_CHECK_DECLS([NSIG], [], [
AC_CHECK_DECLS([_NSIG], [], [
AC_CHECK_DECLS([__NSIG], [], [], [
AC_INCLUDES_DEFAULT
#include <signal.h>
])
], [
AC_INCLUDES_DEFAULT
#include <signal.h>
])
], [
AC_INCLUDES_DEFAULT
#include <signal.h>
])
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"
2022-12-06 10:05:03 -07:00
AC_CHECK_DECLS([sys_siglist], [HAVE_SIGLIST="true"], [
AC_CHECK_DECLS([_sys_siglist], [HAVE_SIGLIST="true"], [], [
AC_INCLUDES_DEFAULT
#include <signal.h>
])
], [
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"
2022-12-05 19:26:57 -07:00
AC_CHECK_DECLS([sys_signame], [HAVE_SIGNAME="true"], [
AC_CHECK_DECLS([_sys_signame], [HAVE_SIGNAME="true"], [
2022-12-06 08:55:44 -07:00
AC_CHECK_DECLS([sys_sigabbrev], [HAVE_SIGNAME="true"], [], [
2022-12-05 19:26:57 -07:00
AC_INCLUDES_DEFAULT
#include <signal.h>
])
], [
AC_INCLUDES_DEFAULT
#include <signal.h>
])
], [
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
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([pam], [pam_start], [found_pam_lib=yes], [], [$lt_cv_dlopen_libs])
2012-02-01 11:27:50 -05:00
#
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
2021-05-06 14:41:35 -06:00
AC_MSG_ERROR([--with-pam specified but unable to locate PAM development library.])
2012-02-01 11:27:50 -05:00
fi
if test "$found_pam_hdrs" = "no"; then
2021-05-06 14:41:35 -06:00
AC_MSG_ERROR([--with-pam specified but unable to locate PAM development headers.])
2012-02-01 11:27:50 -05:00
fi
elif test "$found_pam_lib" != "$found_pam_hdrs"; then
if test "$found_pam_lib" = "no"; then
2021-05-06 14:41:35 -06:00
AC_MSG_ERROR([found PAM headers but no PAM development library; specify --without-pam to build without PAM])
2012-02-01 11:27:50 -05:00
fi
if test "$found_pam_hdrs" = "no"; then
2021-05-06 14:41:35 -06:00
AC_MSG_ERROR([found PAM library but no PAM development headers; specify --without-pam to build without PAM])
2012-02-01 11:27:50 -05:00
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])
2013-08-06 11:01:36 -06:00
pam_login_service="sudo-i"
2010-07-12 17:57:53 -04:00
;;
no) ;;
2021-05-06 14:41:35 -06:00
*) AC_MSG_ERROR([--with-pam-login does not take an argument.])
2010-07-12 17:57:53 -04:00
;;
esac])
2007-10-09 00:04:48 +00:00
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
2021-05-06 13:14:58 -06:00
yes) ;;
no) AC_DEFINE(NO_PAM_SESSION)
2013-02-24 06:15:37 -05:00
pam_session=off
;;
2021-05-06 13:14:58 -06:00
*) AC_MSG_WARN([ignoring unknown argument to --enable-pam-session: $enableval])
2013-02-24 06:15:37 -05:00
;;
2021-05-06 13:14:58 -06:00
esac])
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"
2021-05-06 14:41:35 -06:00
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])
2011-04-18 09:22:26 -04:00
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"
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([roken], [main], [SUDOERS_LIBS="${SUDOERS_LIBS} -lroken"])
2011-04-18 09:22:26 -04:00
], [
AC_MSG_RESULT(no)
SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5 -lk5crypto -lcom_err"
2022-11-16 10:22:28 -07:00
AC_CHECK_LIB([krb5support], [main], [SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5support"])
2011-04-18 09:22:26 -04:00
])
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_ARG_ENABLE(kerb5-instance,
[AS_HELP_STRING([--enable-kerb5-instance], [instance string to append to the username (separated by a slash)])],
[ case "$enableval" in
2021-05-06 14:41:35 -06:00
yes) AC_MSG_ERROR([must give --enable-kerb5-instance an argument.])
2012-01-05 15:39:05 -05:00
;;
2021-05-06 13:14:58 -06:00
no) ;;
2012-01-05 15:39:05 -05:00
*) SUDO_DEFINE_UNQUOTED(SUDO_KRB5_INSTANCE, "$enableval")
;;
2021-05-06 13:14:58 -06:00
esac])
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
2021-05-06 14:41:35 -06: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
2021-05-06 14:41:35 -06: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
2021-05-06 14:41:35 -06:00
AC_MSG_WARN([unable to locate skey.h, you will have to edit the Makefile and add -I/path/to/skey/includes to CPPFLAGS])
2011-03-04 08:22:35 -05:00
fi
2003-03-21 01:28:41 +00:00
fi
2022-11-16 10:22:28 -07: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])])
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
2021-05-06 14:41:35 -06:00
AC_MSG_WARN([unable to locate opie.h, you will have to edit the Makefile and add -I/path/to/opie/includes to CPPFLAGS])
2011-03-04 08:22:35 -05:00
fi
2003-03-21 01:28:41 +00:00
fi
2022-11-16 10:22:28 -07: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
2022-12-05 16:52:34 -07:00
dnl If LDAP support is enabled, add sudo ldap objects to SUDOERS_OBJS
dnl and add LDAP libraries to SUDOERS_LDFLAGS SUDOERS_LIBS.
2004-02-13 02:08:27 +00:00
dnl
2022-12-05 16:52:34 -07:00
SUDO_CHECK_LDAP
2004-02-13 02:08:27 +00:00
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-10-11 11:04:40 -06:00
AX_APPEND_FLAG([-no-install], [SUDOERS_LDFLAGS])
2021-10-07 08:19:11 -06:00
SUDOERS_LT_STATIC="--tag=disable-shared"
2013-11-22 16:35:15 -07:00
LT_STATIC=""
else
2021-10-07 08:19:11 -06:00
SUDOERS_LT_STATIC="--tag=disable-static"
2013-11-22 16:35:15 -07:00
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-10-11 11:04:40 -06:00
AX_APPEND_FLAG([-no-install], [SUDOERS_LDFLAGS])
2021-10-07 08:19:11 -06:00
SUDOERS_LT_STATIC="--tag=disable-shared"
2013-11-22 16:35:15 -07:00
LT_STATIC=""
else
2021-10-07 08:19:11 -06:00
SUDOERS_LT_STATIC="--tag=disable-static"
2013-11-22 16:35:15 -07:00
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
2021-05-06 14:41:35 -06:00
AC_MSG_ERROR([dlopen present but libtool doesn't appear to support your platform.])
2011-08-12 13:00:55 -04:00
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
2021-05-06 14:41:35 -06:00
AC_MSG_ERROR([--disable-shared-libutil may only be specified with --enable-static-sudoers or when dynamic linking is disabled.])
2014-08-08 11:03:24 -06:00
else
2021-10-11 11:04:40 -06:00
# Do not install libsudo_util.
2016-11-17 10:16:51 -07:00
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
2022-11-11 08:45:58 -07:00
hpux*)
2022-11-16 10:22:28 -07: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
2021-04-23 16:54:15 -06:00
SUDO_RELAY_DIR
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
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
2021-10-20 10:31:35 -06:00
dnl
dnl Don't use sys/sysctl.h if it is marked deprecated (Linux).
dnl This test relies on AC_LANG_WERROR
dnl
AC_CHECK_HEADERS([sys/sysctl.h])
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
2023-01-18 14:39:52 -07:00
if test -n "$GCC" -a "$lt_cv_prog_gnu_ld" != "yes"; 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
2023-01-19 13:22:31 -07:00
case "$host_os" in
2021-03-08 14:05:39 -07:00
netbsd*)
2020-01-15 10:13:54 -07:00
;;
*)
AX_CHECK_LINK_FLAG([-Wl,--enable-new-dtags], [AX_APPEND_FLAG([-Wl,--enable-new-dtags], [LDFLAGS])])
;;
esac
2022-12-05 12:34:12 -07:00
SUDO_CHECK_PIE_SUPPORT
2022-12-05 12:33:44 -07:00
SUDO_SYMBOL_VISIBILITY
SUDO_CHECK_SANITIZER
2022-12-05 12:32:53 -07:00
SUDO_CHECK_HARDENING
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
2021-05-06 14:41:35 -06:00
AC_MSG_WARN([no crypt function found, assuming plaintext passwords])
2020-09-20 19:18:39 -06:00
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# }
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
2022-11-16 10:10:20 -07:00
AC_DEFINE_UNQUOTED(os_init, $OS_INIT, [Define to an OS-specific initialization function or 'os_init_common'.])
2012-11-11 07:11:22 -05:00
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
2022-11-29 16:04:14 -07:00
#
# The fallthrough attribute is supported by gcc 7.0 and clang 10.
# This test relies on AC_LANG_WERROR.
#
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;
}
]])],
[
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)
fi
2011-08-29 14:49:10 -04:00
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
2022-11-29 16:04:14 -07:00
AX_APPEND_FLAG([-Wall], [CFLAGS])
AX_APPEND_FLAG([-Wmissing-prototypes], [CFLAGS])
AX_APPEND_FLAG([-Wno-unknown-pragmas], [CFLAGS])
AX_APPEND_FLAG([-Wpointer-arith], [CFLAGS])
AX_APPEND_FLAG([-Wshadow], [CFLAGS])
AX_APPEND_FLAG([-Wsign-compare], [CFLAGS])
AX_APPEND_FLAG([-Wwrite-strings], [CFLAGS])
AX_CHECK_COMPILE_FLAG([-Wvla], [AX_APPEND_FLAG([-Wvla], [CFLAGS])])
AX_CHECK_COMPILE_FLAG([-Walloca], [AX_APPEND_FLAG([-Walloca], [CFLAGS])])
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [AX_APPEND_FLAG([-Wtrampolines], [CFLAGS])])
2020-08-01 13:10:50 -06:00
if test X"$sudo_cv_var_fallthrough_attribute" = X"yes"; then
2022-11-29 16:04:14 -07:00
AX_APPEND_FLAG([-Wimplicit-fallthrough], [CFLAGS])
2020-08-01 13:10:50 -06:00
fi
2011-08-29 14:49:10 -04:00
fi
if test X"$enable_werror" = X"yes"; then
2022-11-29 16:04:14 -07:00
AX_APPEND_FLAG([-Werror], [CFLAGS])
2011-08-29 14:49:10 -04:00
fi
2022-06-28 15:43:27 -06:00
case "$host_os" in
2021-05-13 09:52:09 -06:00
# Avoid unwanted warnings on macOS
2022-11-29 16:04:14 -07:00
darwin*) AX_APPEND_FLAG([-Wno-deprecated-declarations], [CFLAGS]);;
2021-05-13 09:52:09 -06:00
esac
2011-08-29 14:49:10 -04:00
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
2022-06-06 08:36:44 -06:00
dnl Expand exec_prefix 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
2021-08-09 15:50:25 -06:00
# Update exec_prefix in intercept_file
_intercept_file=
while test X"$intercept_file" != X"$_intercept_file"; do
_intercept_file="$intercept_file"
2022-12-26 07:43:55 -07:00
eval "intercept_file=\"$_intercept_file\""
2021-08-09 15:50:25 -06:00
done
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"
2022-12-26 07:43:55 -07:00
eval "noexec_file=\"$_noexec_file\""
2019-07-03 13:13:04 -06:00
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"
2022-12-26 07:43:55 -07:00
eval "sesh_file=\"$_sesh_file\""
2019-07-03 13:13:04 -06:00
done
2019-07-03 13:15:47 -06:00
# Update exec_prefix in plugindir
_plugindir=
while test X"$plugindir" != X"$_plugindir"; do
_plugindir="$plugindir"
2022-12-26 07:43:55 -07:00
eval "plugindir=\"$_plugindir\""
2019-07-03 13:13:04 -06:00
done
exec_prefix="$oexec_prefix"
2022-06-06 08:36:44 -06:00
# Convert exampledir to something that can be used in the man pages
# I wish there was a better way to expand this.
EXAMPLES="$exampledir"
while :; do
EXAMPLES="`echo \"$EXAMPLES\" | sed -e 's/(/{/g' -e 's/)/}/g'`"
case "$EXAMPLES" in
*\${[[A-Za-z]]*}*)
eval EXAMPLES="$EXAMPLES"
;;
*)
break
;;
esac
done
case "$EXAMPLES" in
NONE/*)
EXAMPLES="${ac_default_prefix}${EXAMPLES#NONE}"
;;
esac
2019-07-03 13:13:04 -06:00
dnl
dnl Defer setting _PATH_SUDO_NOEXEC, etc until after exec_prefix is set
dnl
2021-08-09 15:50:25 -06:00
if test X"$enable_intercept" != X"no"; then
2021-09-13 09:33:17 -06:00
SUDO_OBJS="${SUDO_OBJS} intercept.pb-c.o"
2021-08-09 15:50:25 -06:00
PROGS="${PROGS} sudo_intercept.la"
INSTALL_INTERCEPT="install-intercept"
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_INTERCEPT, "$intercept_file", [The fully qualified pathname of sudo_intercept.so])
fi
2019-07-03 13:13:04 -06:00
if test X"$with_noexec" != X"no"; then
PROGS="${PROGS} sudo_noexec.la"
INSTALL_NOEXEC="install-noexec"
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_NOEXEC, "$noexec_file", [The fully qualified pathname of sudo_noexec.so])
2016-11-16 10:13:26 -07:00
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
2021-10-20 18:59:13 -06:00
if test X"$LIBCRYPTO_R" != X""; then
LIBCRYPTO="$LIBCRYPTO_R $LIBCRYPTO"
2021-09-13 09:33:12 -06:00
fi
if test X"$LIBTLS_R" != X""; then
LIBTLS="$LIBTLS_R $LIBTLS"
fi
2013-03-19 11:52:54 -04:00
2021-05-06 13:14:58 -06:00
dnl
dnl Trim leading spaces
dnl
CFLAGS=${CFLAGS# }
CPPFLAGS=${CPPFLAGS# }
LDFLAGS=${LDFLAGS# }
2021-09-08 15:31:08 -06:00
SUDO_LDFLAGS=${SUDO_LDFLAGS# }
2021-05-06 13:14:58 -06:00
SUDOERS_LDFLAGS=${SUDOERS_LDFLAGS# }
LIBS=${LIBS# }
SUDO_LIBS=${SUDO_LIBS# }
SUDOERS_LIBS=${SUDOERS_LIBS# }
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
2022-02-28 14:15:43 -07:00
AC_CONFIG_FILES([Makefile docs/Makefile examples/Makefile examples/sudoers examples/sudo.conf examples/sudo_logsrvd.conf examples/syslog.conf include/Makefile lib/eventlog/Makefile lib/fuzzstub/Makefile lib/iolog/Makefile lib/logsrv/Makefile lib/protobuf-c/Makefile lib/util/Makefile lib/util/regress/harness lib/util/util.exp logsrvd/Makefile src/intercept.exp 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/regress/harness plugins/sudoers/sudoers])
AC_CONFIG_COMMANDS([harness], [chmod +x lib/util/regress/harness plugins/sudoers/regress/harness])
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
2021-05-06 13:14:58 -06:00
dnl
dnl Summarize configuration
dnl
2021-10-25 13:17:57 -06:00
if test ${LIBTLS+y}; then
have_tls=yes
fi
2021-05-06 13:14:58 -06:00
echo "" >&AS_MESSAGE_FD
echo "Configured Sudo version $PACKAGE_VERSION" >&AS_MESSAGE_FD
echo " Compiler settings:" >&AS_MESSAGE_FD
echo " prefix : $prefix" >&AS_MESSAGE_FD
echo " compiler : $CC" >&AS_MESSAGE_FD
echo " compiler options : $CFLAGS" >&AS_MESSAGE_FD
echo " preprocessor options : $CPPFLAGS" >&AS_MESSAGE_FD
echo " front-end libraries : $SUDO_LIBS" >&AS_MESSAGE_FD
2022-12-06 16:09:26 -07:00
echo " front-end linker options : $SUDO_LDFLAGS" >&AS_MESSAGE_FD
echo " network libraries : $NET_LIBS" >&AS_MESSAGE_FD
2021-05-06 13:14:58 -06:00
echo " extra libraries : $LIBS" >&AS_MESSAGE_FD
2022-12-06 16:09:26 -07:00
echo " extra linker options : $LDFLAGS" >&AS_MESSAGE_FD
echo " sudoers libraries : $SUDOERS_LIBS" >&AS_MESSAGE_FD
echo " sudoers linker options : $SUDOERS_LDFLAGS" >&AS_MESSAGE_FD
2021-05-06 13:14:58 -06:00
if test "${enable_sanitizer-no}" != "no"; then
echo " sanitizer options : ${enable_sanitizer}" >&AS_MESSAGE_FD
fi
if test X"$FUZZ_LD" != X"\$(CC)"; then
echo " fuzzing linker : ${FUZZ_LD}" >&AS_MESSAGE_FD
fi
if test X"$FUZZ_ENGINE" != X"\$(top_builddir)/lib/fuzzstub/libsudo_fuzzstub.la"; then
echo " fuzzing engine : ${FUZZ_ENGINE}" >&AS_MESSAGE_FD
fi
echo " Plugin options:" >&AS_MESSAGE_FD
echo " plugin support : ${SHLIB_ENABLE}" >&AS_MESSAGE_FD
echo " Sudoers plugin static : ${enable_static_sudoers-no}" >&AS_MESSAGE_FD
echo " Python plugin : ${enable_python-no}" >&AS_MESSAGE_FD
if test "${enable_python-no}" != "no"; then
echo " Python CFLAGS : ${PYTHON_INCLUDE}" >&AS_MESSAGE_FD
echo " Python LDFLAGS : ${PYTHON_LIBS}" >&AS_MESSAGE_FD
fi
echo " Optional features:" >&AS_MESSAGE_FD
echo " log client : ${enable_log_client-yes}" >&AS_MESSAGE_FD
echo " log server : ${enable_log_server-yes}" >&AS_MESSAGE_FD
2021-10-25 13:17:57 -06:00
echo " log client/server TLS : ${have_tls-no}" >&AS_MESSAGE_FD
2021-05-06 13:14:58 -06:00
case "$host_os" in
linux*) echo " SELinux RBAC : ${with_selinux-yes}" >&AS_MESSAGE_FD;;
esac
echo " Optional sudoers back-ends:" >&AS_MESSAGE_FD
echo " LDAP : ${with_ldap-no}" >&AS_MESSAGE_FD
if test "${with_ldap-no}" != "no"; then
echo " ldap configuration : ${ldap_conf}" >&AS_MESSAGE_FD
echo " ldap secret : ${ldap_secret}" >&AS_MESSAGE_FD
echo " SASL authentication : ${enable_sasl-no}" >&AS_MESSAGE_FD
fi
echo " SSSD : ${with_sssd-no}" >&AS_MESSAGE_FD
if test "${with_sssd-no}" != "no"; then
echo " SSSD config path : ${sssd_conf}" >&AS_MESSAGE_FD
if test "${sssd_lib}" = \""LIBDIR\""; then
echo " SSSD lib dir : ${libdir}" >&AS_MESSAGE_FD
else
echo " SSSD lib dir : ${sssd_lib}" >&AS_MESSAGE_FD
fi
fi
echo " Authentication options:" >&AS_MESSAGE_FD
echo " require authentication : ${enable_authentication-yes}" >&AS_MESSAGE_FD
auth_methods=`echo "$AUTH_OBJS" | sed -e 's/\.lo//g' -e 's/getspwuid *//'`
echo " authentication methods : ${auth_methods}" >&AS_MESSAGE_FD
if test "${with_pam-no}" = "yes"; then
echo " pam session support : ${pam_session}" >&AS_MESSAGE_FD
echo " pam login service : ${pam_login_service}" >&AS_MESSAGE_FD
fi
if test "${with_kerb5-no}" != "no"; then
echo " kerb5 instance string : ${with_kerb5-none}" >&AS_MESSAGE_FD
fi
if test "${with_opie-no}-${with_skey-no}" != "no-no"; then
echo " long OTP prompt : ${long_otp_prompt-no}" >&AS_MESSAGE_FD
fi
echo " group exempt from passwords : ${with_exempt-none}" >&AS_MESSAGE_FD
echo " password prompt : ${passprompt}" >&AS_MESSAGE_FD
echo " password prompt timeout : ${password_timeout} minutes" >&AS_MESSAGE_FD
echo " password tries : ${passwd_tries}" >&AS_MESSAGE_FD
echo " bad password message : ${badpass_message}" >&AS_MESSAGE_FD
if test "$insults" = "on"; then
i=""
test "$enable_offensive_insults" = "yes" && i="offensive ${i}"
test "$with_python_insults" = "yes" && i="python ${i}"
test "$with_goons_insults" = "yes" && i="goons ${i}"
test "$with_hal_insults" = "yes" && i="hal ${i}"
test "$with_csops_insults" = "yes" && i="csops ${i}"
test "$with_classic_insults" = "yes" && i="classic ${i}"
else
i=no
fi
echo " insults : $i" >&AS_MESSAGE_FD
echo " display lecture : ${lecture}" >&AS_MESSAGE_FD
echo " timestamp (credential) type : ${timestamp_type}" >&AS_MESSAGE_FD
echo " timestamp (credential) timeout: ${timeout} minutes" >&AS_MESSAGE_FD
echo " Logging options:" >&AS_MESSAGE_FD
echo " logging default : ${with_logging}" >&AS_MESSAGE_FD
echo " syslog facility : ${logfac}" >&AS_MESSAGE_FD
echo " syslog priority allowed : ${goodpri}" >&AS_MESSAGE_FD
echo " syslog priority denied : ${badpri}" >&AS_MESSAGE_FD
echo " log file path : ${logpath}" >&AS_MESSAGE_FD
echo " log file includes hostname : ${enable_log_host-no}" >&AS_MESSAGE_FD
echo " log file line length : ${loglen}" >&AS_MESSAGE_FD
echo " compress I/O logs : ${enable_zlib}" >&AS_MESSAGE_FD
case "$host_os" in
linux*) echo " Linux audit : ${with_linux_audit-no}" >&AS_MESSAGE_FD;;
solaris2.11*) echo " Solaris audit : ${with_solaris_audit-no}" >&AS_MESSAGE_FD;;
*) echo " BSM audit : ${with_bsm_audit-no}" >&AS_MESSAGE_FD;;
esac
echo " run mailer as root : ${enable_root_mailer-yes}" >&AS_MESSAGE_FD
echo " warning/error mail recipient : ${mailto}" >&AS_MESSAGE_FD
echo " warning/error mail subject : ${mailsub}" >&AS_MESSAGE_FD
echo " mail if user not in sudoers : ${mail_no_user}" >&AS_MESSAGE_FD
echo " mail if user not on host : ${mail_no_host}" >&AS_MESSAGE_FD
echo " mail if command not allowed : ${mail_no_perms}" >&AS_MESSAGE_FD
echo " Pathnames:" >&AS_MESSAGE_FD
echo " log directory : ${log_dir}" >&AS_MESSAGE_FD
echo " plugin directory : ${plugindir}" >&AS_MESSAGE_FD
2022-12-26 07:43:55 -07:00
echo " sudoers plugin : ${sudoers_plugin}" >&AS_MESSAGE_FD
2022-12-30 13:38:40 -07:00
if test "${enable_python-no}" != "no"; then
echo " python plugin : ${python_plugin}" >&AS_MESSAGE_FD
fi
2021-05-06 13:14:58 -06:00
echo " run directory : ${rundir}" >&AS_MESSAGE_FD
echo " var directory : ${vardir}" >&AS_MESSAGE_FD
echo " I/O log directory : ${iolog_dir}" >&AS_MESSAGE_FD
echo " sudo_logsrvd relay directory : ${relay_dir}" >&AS_MESSAGE_FD
echo " time zone directory : ${tzdir}" >&AS_MESSAGE_FD
echo " path to sendmail : ${with_sendmail}" >&AS_MESSAGE_FD
if test -n "$TMPFILES_D"; then
echo " systemd tempfiles dir : ${TMPFILES_D}" >&AS_MESSAGE_FD
fi
if test ${with_netsvc-"no"} != "no"; then
echo " netsvc file : ${netsvc_conf}" >&AS_MESSAGE_FD
elif test ${with_nsswitch-"yes"} != "no"; then
echo " nsswitch file : ${nsswitch_conf}" >&AS_MESSAGE_FD
fi
2022-12-26 07:43:55 -07:00
echo " intercept file : ${intercept_file}" >&AS_MESSAGE_FD
2021-05-06 13:14:58 -06:00
echo " noexec file : ${noexec_file}" >&AS_MESSAGE_FD
echo " secure path : ${with_secure_path-no}" >&AS_MESSAGE_FD
echo " askpass helper file : ${with_askpass-no}" >&AS_MESSAGE_FD
echo " device search path : ${devsearch}" >&AS_MESSAGE_FD
echo " Other options:" >&AS_MESSAGE_FD
if test "${with_devel-no}" != "no"; then
echo " development build : ${with_devel}" >&AS_MESSAGE_FD
fi
case "$host_os" in
solaris2*) echo " Solaris project support : ${with_project-no}" >&AS_MESSAGE_FD;;
esac
if test "${with_logincap+set}" = "set"; then
echo " /etc/login.conf support : ${with_logincap}" >&AS_MESSAGE_FD
fi
echo " fully-qualified domain names : ${fqdn}" >&AS_MESSAGE_FD
echo " default umask : ${sudo_umask}" >&AS_MESSAGE_FD
echo " umask override : ${umask_override}" >&AS_MESSAGE_FD
echo " default runas user : ${runas_default}" >&AS_MESSAGE_FD
echo " probe network interfaces : ${with_interfaces-yes}" >&AS_MESSAGE_FD
echo " allow root to run sudo : ${root_sudo}" >&AS_MESSAGE_FD
echo " reset environment for commands: ${env_reset}" >&AS_MESSAGE_FD
echo " run shell if no args : ${enable_noargs_shell-no}" >&AS_MESSAGE_FD
echo " ignore '.' or '' in \$PATH : ${ignore_dot}" >&AS_MESSAGE_FD
echo " disable path info : ${enable_path_info-no}" >&AS_MESSAGE_FD
echo " sudoers file mode : ${SUDOERS_MODE}" >&AS_MESSAGE_FD
echo " sudoers file owner : ${SUDOERS_UID}:${SUDOERS_GID}" >&AS_MESSAGE_FD
echo " default visudo editor : ${editor}" >&AS_MESSAGE_FD
echo " visudo supports \$EDITOR : ${env_editor}" >&AS_MESSAGE_FD
if test "${enable_env_debug+set}" = "set"; then
echo " environment debugging : ${enable_env_debug-no}" >&AS_MESSAGE_FD
fi
echo "" >&AS_MESSAGE_FD
1998-09-11 23:47:29 +00:00
dnl
2021-05-06 14:41:35 -06:00
dnl Display any warnings/info the user needs to know about at the end.
1998-09-11 23:47:29 +00:00
dnl
2021-05-06 14:41:35 -06:00
if test "$openssl_missing" = "yes"; then
AC_MSG_WARN([OpenSSL dev libraries not found, Sudo logsrv connections will not be encrypted.])
fi
1998-09-11 23:47:29 +00:00
if test "$with_pam" = "yes"; then
2013-03-19 15:59:23 -04:00
case $host_os in
2022-11-11 08:45:58 -07:00
hpux*)
2012-01-17 13:07:35 -05:00
if test -f /usr/lib/security/libpam_hpsec.so.1; then
2021-05-06 14:41:35 -06:00
AC_MSG_NOTICE([you may wish to add the following line to /etc/pam.conf])
2011-12-08 09:10:07 -05:00
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*)
2021-05-06 14:41:35 -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
2021-05-06 14:41:35 -06:00
AC_MSG_NOTICE([warning: the $rundir/ts directory must be cleared at boot time.])
2014-02-04 15:14:48 -07:00
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.])
2022-11-16 10:10:20 -07: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.])
2022-11-16 10:10:20 -07:00
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.])
AH_TEMPLATE(HAVE_DISPCRYPT, [Define to 1 if you have the 'dispcrypt' function.])
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.])
2022-11-16 10:10:20 -07:00
AH_TEMPLATE(HAVE_FNMATCH, [Define to 1 if you have the 'fnmatch' function.])
2004-09-08 15:49:26 +00:00
AH_TEMPLATE(HAVE_FWTK, [Define to 1 if you use the FWTK authsrv daemon.])
2022-11-16 10:10:20 -07:00
AH_TEMPLATE(HAVE_GETPRPWNAM, [Define to 1 if you have the 'getprpwnam' function. (SecureWare-style shadow passwords).])
AH_TEMPLATE(HAVE_GETPWNAM_SHADOW, [Define to 1 if you have the 'getpwnam_shadow' function.])
AH_TEMPLATE(HAVE_GETSPNAM, [Define to 1 if you have the 'getspnam' function (SVR4-style shadow passwords).])
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.])
2022-11-16 10:10:20 -07:00
AH_TEMPLATE(HAVE_INET_NTOP, [Define to 1 if you have the 'inet_ntop' function.])
AH_TEMPLATE(HAVE_INET_PTON, [Define to 1 if you have the 'inet_pton' function.])
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.])
2022-11-16 10:10:20 -07:00
AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC, [Define to 1 if you have the 'krb5_get_init_creds_opt_alloc' function.])
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.])
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.])
2022-11-16 10:10:20 -07: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.])
2022-11-16 10:10:20 -07:00
AH_TEMPLATE(HAVE_SETKEYCREATECON, [Define to 1 if you have the 'setkeycreatecon' function.])
2022-05-23 00:55:16 -06:00
AH_TEMPLATE(HAVE_APPARMOR, [Define to 1 to enable AppArmor support.])
2022-11-16 10:10:20 -07: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.])
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.])
2022-11-16 10:10:20 -07:00
AH_TEMPLATE(HAVE_SYS_SIGABBREV, [Define to 1 if your libc has the 'sys_sigabbrev' symbol.])
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.])
AH_TEMPLATE(NEED_RESOLV_H, [Define to 1 if resolv.h must be included to get the 'inet_ntop' or 'inet_pton' function prototypes.])
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.])
2023-01-19 13:22:32 -07:00
AH_TEMPLATE(HAVE_KINFO_PROC_DFLY, [Define to 1 if your system has a Dragonfly-style kinfo_proc struct.])
2018-03-05 17:35:02 -07:00
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.])
2021-10-26 19:00:16 -06:00
AH_TEMPLATE(HAVE_WOLFSSL, [Define to 1 if you are using wolfSSL'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.])
2022-11-16 10:10:20 -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.])
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.])
2022-11-16 10:10:20 -07:00
AH_TEMPLATE(HAVE_VA_COPY, [Define to 1 if you have the 'va_copy' function.])
AH_TEMPLATE(HAVE___VA_COPY, [Define to 1 if you have the '__va_copy' function.])
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
2023-01-19 13:59:05 -07:00
AH_BOTTOM([/* Define C99 types if stdint.h and inttypes.h are missing. */
#if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H)
# ifndef HAVE_INT8_T
typedef char int8_t;
# endif
# ifndef HAVE_UINT8_T
typedef unsigned char uint8_t;
# endif
# ifndef HAVE_INT16_T
typedef short int16_t;
# endif
# ifndef HAVE_UINT16_T
typedef unsigned short uint16_t;
# endif
# ifndef HAVE_INT32_T
typedef int int32_t;
# endif
# ifndef HAVE_UINT32_T
typedef unsigned int uint32_t;
# endif
# ifndef HAVE_INT64_T
typedef long long int64_t;
# endif
# ifndef HAVE_UINT64_T
typedef unsigned long long uint64_t;
# endif
# ifndef HAVE_INTMAX_T
typedef long long intmax_t;
# endif
# ifndef HAVE_UINTMAX_T
typedef unsigned long long uintmax_t;
# endif
#endif /* !HAVE_STDINT_H && !HAVE_INTTYPES_H */
#ifndef HAVE_SIG_ATOMIC_T
typedef int sig_atomic_t;
#endif
#ifndef HAVE_SOCKLEN_T
typedef unsigned int socklen_t;
#endif
#ifndef __GNUC_PREREQ__
2022-09-07 07:48:31 -06:00
# ifdef __GNUC__
# define __GNUC_PREREQ__(ma, mi) \
((__GNUC__ > (ma)) || (__GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)))
# else
# define __GNUC_PREREQ__(ma, mi) 0
# endif
#endif
/* Define away __attribute__ for non-gcc or old gcc. */
#if !defined(__attribute__) && !__GNUC_PREREQ__(2, 5)
# define __attribute__(x)
#endif
/* For functions that call exit() directly. */
2022-11-29 16:28:27 -07:00
#ifdef __has_c_attribute
# if __has_c_attribute(__noreturn__)
# define sudo_noreturn [[__noreturn__]]
# endif
#endif
#ifndef sudo_noreturn
# if __GNUC_PREREQ__(2, 5)
# define sudo_noreturn __attribute__((__noreturn__))
# else
# define sudo_noreturn
# endif
2022-09-07 07:48:31 -06:00
#endif
/* For malloc-like functions that return uninitialized or zeroed memory. */
#if __GNUC_PREREQ__(2, 96)
# define sudo_malloclike __attribute__((__malloc__))
#else
# define sudo_malloclike
#endif
/* Compile-time checking for function arguments that must not be NULL. */
#if __GNUC_PREREQ__(3, 3)
# define sudo_attr_nonnull(_a) __attribute__((__nonnull__ (_a)))
#else
# define sudo_attr_nonnull(_a)
#endif
/* For catching format string mismatches. */
#if __GNUC_PREREQ__(2, 7)
# define sudo_printflike(_f, _v) __attribute__((__format__ (__printf__, _f, _v))) sudo_attr_nonnull(_f)
# define sudo_printf0like(_f, _v) __attribute__((__format__ (__printf__, _f, _v)))
# define sudo_attr_fmt_arg(_f) __attribute__((__format_arg__ (_f)))
#else
# define sudo_printflike(_f, _v)
# define sudo_printf0like(_f, _v)
# define sudo_attr_fmt_arg(_f)
#endif
2022-11-29 16:28:27 -07:00
/* C23 defines a fallthrough attribute, gcc 7.0 and clang 10 have their own. */
#ifdef __has_c_attribute
# if __has_c_attribute(__fallthrough__)
# define FALLTHROUGH [[__fallthrough__]]
# endif
#endif
#ifndef FALLTHROUGH
# if defined(HAVE_FALLTHROUGH_ATTRIBUTE)
# define FALLTHROUGH __attribute__((__fallthrough__))
# else
# define FALLTHROUGH do { } while (0)
# endif
#endif
2022-09-07 07:48:31 -06:00
/* Symbol visibility controls. */
2020-08-12 09:57:42 -06:00
#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 */])