2 dnl Process this file with GNU autoconf to produce a configure script.
4 dnl Copyright (c) 1994-1996,1998-2011 Todd C. Miller <Todd.Miller@courtesan.com>
6 AC_INIT([sudo], [1.8.1p2], [http://www.sudo.ws/bugs/], [sudo])
7 AC_CONFIG_HEADER([config.h pathnames.h])
9 dnl Note: this must come after AC_INIT
11 AC_MSG_NOTICE([Configuring Sudo version $PACKAGE_VERSION])
13 dnl Variables that get substituted in the Makefile and man pages
15 AC_SUBST([HAVE_BSM_AUDIT])
22 AC_SUBST([SUDOERS_LDFLAGS])
24 AC_SUBST([COMMON_OBJS])
25 AC_SUBST([SUDOERS_OBJS])
29 AC_SUBST([SUDOERS_LIBS])
32 AC_SUBST([REPLAY_LIBS])
33 AC_SUBST([GETGROUPS_LIB])
37 AC_SUBST([MAN_POSTINSTALL])
38 AC_SUBST([SUDOERS_MODE])
39 AC_SUBST([SUDOERS_UID])
40 AC_SUBST([SUDOERS_GID])
47 AC_SUBST([mansectform])
49 AC_SUBST([NOEXECFILE])
53 AC_SUBST([noexec_file])
54 AC_SUBST([INSTALL_NOEXEC])
55 AC_SUBST([DONT_LEAK_PATH_INFO])
56 AC_SUBST([BSDAUTH_USAGE])
57 AC_SUBST([SELINUX_USAGE])
59 AC_SUBST([LOGINCAP_USAGE])
62 AC_SUBST([LIBTOOL_DEPS])
63 AC_SUBST([ac_config_libobj_dir])
64 AC_SUBST([CONFIGURE_ARGS])
68 dnl Variables that get substituted in docs (not overridden by environment)
70 AC_SUBST([iolog_dir])dnl real initial value from SUDO_IO_LOGDIR
71 AC_SUBST([timedir])dnl real initial value from SUDO_TIMEDIR
73 AC_SUBST([password_timeout])
74 AC_SUBST([sudo_umask])
75 AC_SUBST([umask_override])
76 AC_SUBST([passprompt])
77 AC_SUBST([long_otp_prompt])
83 AC_SUBST([ignore_dot])
84 AC_SUBST([mail_no_user])
85 AC_SUBST([mail_no_host])
86 AC_SUBST([mail_no_perms])
89 AC_SUBST([badpass_message])
91 AC_SUBST([runas_default])
92 AC_SUBST([env_editor])
94 AC_SUBST([passwd_tries])
95 AC_SUBST([tty_tickets])
100 AC_SUBST([ldap_secret])
101 AC_SUBST([nsswitch_conf])
102 AC_SUBST([netsvc_conf])
103 AC_SUBST([secure_path])
106 # Begin initial values for man page substitution
108 iolog_dir=/var/log/sudo-io
109 timedir=/var/adm/sudo
114 passprompt="Password:"
126 mailsub="*** SECURITY information for %h ***"
127 badpass_message="Sorry, try again."
138 ldap_conf=/etc/ldap.conf
139 ldap_secret=/etc/ldap.secret
140 netsvc_conf=/etc/netsvc.conf
141 noexec_file=/usr/local/libexec/sudo_noexec.so
142 nsswitch_conf=/etc/nsswitch.conf
143 secure_path="not set"
145 # End initial values for man page substitution
148 dnl Initial values for Makefile variables listed above
149 dnl May be overridden by environment variables..
156 : ${SUDOERS_MODE='0440'}
179 shadow_libs_optional=
183 dnl libc replacement functions live in compat
185 AC_CONFIG_LIBOBJ_DIR(compat)
188 dnl Deprecated --with options (these all warn or generate an error)
191 AC_ARG_WITH(otp-only, [AS_HELP_STRING([--with-otp-only], [deprecated])],
192 [case $with_otp_only in
193 yes) with_passwd="no"
194 AC_MSG_NOTICE([--with-otp-only option deprecated, treating as --without-passwd])
198 AC_ARG_WITH(alertmail, [AS_HELP_STRING([--with-alertmail], [deprecated])],
199 [case $with_alertmail in
200 *) with_mailto="$with_alertmail"
201 AC_MSG_NOTICE([--with-alertmail option deprecated, treating as --mailto])
206 dnl Options for --with
209 AC_ARG_WITH(devel, [AS_HELP_STRING([--with-devel], [add development options])],
211 yes) AC_MSG_NOTICE([Setting up for development: -Wall, flex, yacc])
212 OSDEFS="${OSDEFS} -DSUDO_DEVEL"
217 *) AC_MSG_WARN([Ignoring unknown argument to --with-devel: $with_devel])
221 AC_ARG_WITH(CC, [AS_HELP_STRING([--with-CC], [C compiler to use])],
223 yes) AC_MSG_ERROR(["must give --with-CC an argument."])
225 no) AC_MSG_ERROR(["illegal argument: --without-CC."])
231 AC_ARG_WITH(rpath, [AS_HELP_STRING([--with-rpath], [pass -R flag in addition to -L for lib paths])],
234 *) AC_MSG_ERROR(["--with-rpath does not take an argument."])
238 AC_ARG_WITH(blibpath, [AS_HELP_STRING([--with-blibpath[=PATH]], [pass -blibpath flag to ld for additional lib paths])],
239 [case $with_blibpath in
241 *) AC_MSG_NOTICE([will pass -blibpath:${with_blibpath} to the loader.])
246 dnl Handle BSM auditing support.
248 AC_ARG_WITH(bsm-audit, [AS_HELP_STRING([--with-bsm-audit], [enable BSM audit support])],
249 [case $with_bsm_audit in
250 yes) AC_DEFINE(HAVE_BSM_AUDIT)
251 SUDOERS_LIBS="${SUDOERS_LIBS} -lbsm"
252 SUDOERS_OBJS="${SUDOERS_OBJS} bsm_audit.lo"
255 *) AC_MSG_ERROR(["--with-bsm-audit does not take an argument."])
260 dnl Handle Linux auditing support.
262 AC_ARG_WITH(linux-audit, [AS_HELP_STRING([--with-linux-audit], [enable Linux audit support])],
263 [case $with_linux_audit in
264 yes) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libaudit.h>]], [[int i = AUDIT_USER_CMD; (void)i;]])], [
265 AC_DEFINE(HAVE_LINUX_AUDIT)
266 SUDO_LIBS="${SUDO_LIBS} -laudit"
267 SUDOERS_LIBS="${SUDO_LIBS} -laudit"
268 SUDOERS_OBJS="${SUDOERS_OBJS} linux_audit.lo"
270 AC_MSG_ERROR([unable to find AUDIT_USER_CMD in libaudit.h for --with-linux-audit])
274 *) AC_MSG_ERROR(["--with-linux-audit does not take an argument."])
278 AC_ARG_WITH(incpath, [AS_HELP_STRING([--with-incpath], [additional places to look for include files])],
279 [case $with_incpath in
280 yes) AC_MSG_ERROR(["must give --with-incpath an argument."])
282 no) AC_MSG_ERROR(["--without-incpath not supported."])
284 *) AC_MSG_NOTICE([Adding ${with_incpath} to CPPFLAGS])
285 for i in ${with_incpath}; do
286 CPPFLAGS="${CPPFLAGS} -I${i}"
291 AC_ARG_WITH(libpath, [AS_HELP_STRING([--with-libpath], [additional places to look for libraries])],
292 [case $with_libpath in
293 yes) AC_MSG_ERROR(["must give --with-libpath an argument."])
295 no) AC_MSG_ERROR(["--without-libpath not supported."])
297 *) AC_MSG_NOTICE([Adding ${with_libpath} to LDFLAGS])
301 AC_ARG_WITH(libraries, [AS_HELP_STRING([--with-libraries], [additional libraries to link with])],
302 [case $with_libraries in
303 yes) AC_MSG_ERROR(["must give --with-libraries an argument."])
305 no) AC_MSG_ERROR(["--without-libraries not supported."])
307 *) AC_MSG_NOTICE([Adding ${with_libraries} to LIBS])
311 AC_ARG_WITH(efence, [AS_HELP_STRING([--with-efence], [link with -lefence for malloc() debugging])],
312 [case $with_efence in
313 yes) AC_MSG_NOTICE([Sudo will link with -lefence (Electric Fence)])
314 LIBS="${LIBS} -lefence"
315 if test -f /usr/local/lib/libefence.a; then
316 with_libpath="${with_libpath} /usr/local/lib"
320 *) AC_MSG_WARN([Ignoring unknown argument to --with-efence: $with_efence])
324 AC_ARG_WITH(csops, [AS_HELP_STRING([--with-csops], [add CSOps standard options])],
326 yes) AC_MSG_NOTICE([Adding CSOps standard options])
330 with_classic_insults=yes
331 with_csops_insults=yes
337 *) AC_MSG_WARN([Ignoring unknown argument to --with-csops: $with_csops])
341 AC_ARG_WITH(passwd, [AS_HELP_STRING([--without-passwd], [don't use passwd/shadow file for authentication])],
342 [case $with_passwd in
343 yes|no) AC_MSG_CHECKING(whether to use shadow/passwd file authentication)
344 AC_MSG_RESULT($with_passwd)
346 test "$with_passwd" = "yes" && AUTH_REG="$AUTH_REG passwd"
348 *) AC_MSG_ERROR(["Sorry, --with-passwd does not take an argument."])
352 AC_ARG_WITH(skey, [AS_HELP_STRING([--with-skey[=DIR]], [enable S/Key support ])],
355 *) AC_DEFINE(HAVE_SKEY)
356 AC_MSG_CHECKING(whether to try S/Key authentication)
358 AUTH_REG="$AUTH_REG S/Key"
362 AC_ARG_WITH(opie, [AS_HELP_STRING([--with-opie[=DIR]], [enable OPIE support ])],
365 *) AC_DEFINE(HAVE_OPIE)
366 AC_MSG_CHECKING(whether to try NRL OPIE authentication)
368 AUTH_REG="$AUTH_REG NRL_OPIE"
372 AC_ARG_WITH(long-otp-prompt, [AS_HELP_STRING([--with-long-otp-prompt], [use a two line OTP (skey/opie) prompt])],
373 [case $with_long_otp_prompt in
374 yes) AC_DEFINE(LONG_OTP_PROMPT)
375 AC_MSG_CHECKING(whether to use a two line prompt for OTP authentication)
379 no) long_otp_prompt=off
381 *) AC_MSG_ERROR(["--with-long-otp-prompt does not take an argument."])
385 AC_ARG_WITH(SecurID, [AS_HELP_STRING([--with-SecurID[[=DIR]]], [enable SecurID support])],
386 [case $with_SecurID in
388 *) AC_DEFINE(HAVE_SECURID)
389 AC_MSG_CHECKING(whether to use SecurID for authentication)
391 AUTH_EXCL="$AUTH_EXCL SecurID"
395 AC_ARG_WITH(fwtk, [AS_HELP_STRING([--with-fwtk[[=DIR]]], [enable FWTK AuthSRV support])],
398 *) AC_DEFINE(HAVE_FWTK)
399 AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication)
401 AUTH_EXCL="$AUTH_EXCL FWTK"
405 AC_ARG_WITH(kerb4, [AS_HELP_STRING([--with-kerb4[[=DIR]]], [enable Kerberos IV support])],
408 *) AC_MSG_CHECKING(whether to try kerberos IV authentication)
410 AUTH_REG="$AUTH_REG kerb4"
414 AC_ARG_WITH(kerb5, [AS_HELP_STRING([--with-kerb5[[=DIR]]], [enable Kerberos V support])],
417 *) AC_MSG_CHECKING(whether to try Kerberos V authentication)
419 AUTH_REG="$AUTH_REG kerb5"
423 AC_ARG_WITH(aixauth, [AS_HELP_STRING([--with-aixauth], [enable AIX general authentication support])],
424 [case $with_aixauth in
425 yes) AUTH_EXCL="$AUTH_EXCL AIX_AUTH";;
427 *) AC_MSG_ERROR(["--with-aixauth does not take an argument."])
431 AC_ARG_WITH(pam, [AS_HELP_STRING([--with-pam], [enable PAM support])],
433 yes) AUTH_EXCL="$AUTH_EXCL PAM";;
435 *) AC_MSG_ERROR(["--with-pam does not take an argument."])
439 AC_ARG_WITH(AFS, [AS_HELP_STRING([--with-AFS], [enable AFS support])],
441 yes) AC_DEFINE(HAVE_AFS)
442 AC_MSG_CHECKING(whether to try AFS (kerberos) authentication)
444 AUTH_REG="$AUTH_REG AFS"
447 *) AC_MSG_ERROR(["--with-AFS does not take an argument."])
451 AC_ARG_WITH(DCE, [AS_HELP_STRING([--with-DCE], [enable DCE support])],
453 yes) AC_DEFINE(HAVE_DCE)
454 AC_MSG_CHECKING(whether to try DCE (kerberos) authentication)
456 AUTH_REG="$AUTH_REG DCE"
459 *) AC_MSG_ERROR(["--with-DCE does not take an argument."])
463 AC_ARG_WITH(logincap, [AS_HELP_STRING([--with-logincap], [enable BSD login class support])],
464 [case $with_logincap in
466 *) AC_MSG_ERROR(["--with-logincap does not take an argument."])
470 AC_ARG_WITH(bsdauth, [AS_HELP_STRING([--with-bsdauth], [enable BSD authentication support])],
471 [case $with_bsdauth in
472 yes) AUTH_EXCL="$AUTH_EXCL BSD_AUTH";;
474 *) AC_MSG_ERROR(["--with-bsdauth does not take an argument."])
478 AC_ARG_WITH(project, [AS_HELP_STRING([--with-project], [enable Solaris project support])],
479 [case $with_project in
482 *) AC_MSG_ERROR(["--with-project does not take an argument."])
486 AC_MSG_CHECKING(whether to lecture users the first time they run sudo)
487 AC_ARG_WITH(lecture, [AS_HELP_STRING([--without-lecture], [don't print lecture for first-time sudoer])],
488 [case $with_lecture in
489 yes|short|always) lecture=once
491 no|none|never) lecture=never
493 *) AC_MSG_ERROR(["unknown argument to --with-lecture: $with_lecture"])
496 if test "$lecture" = "once"; then
499 AC_DEFINE(NO_LECTURE)
503 AC_MSG_CHECKING(whether sudo should log via syslog or to a file by default)
504 AC_ARG_WITH(logging, [AS_HELP_STRING([--with-logging], [log via syslog, file, or both])],
505 [case $with_logging in
506 yes) AC_MSG_ERROR(["must give --with-logging an argument."])
508 no) AC_MSG_ERROR(["--without-logging not supported."])
510 syslog) AC_DEFINE(LOGGING, SLOG_SYSLOG)
511 AC_MSG_RESULT(syslog)
513 file) AC_DEFINE(LOGGING, SLOG_FILE)
516 both) AC_DEFINE(LOGGING, SLOG_BOTH)
519 *) AC_MSG_ERROR(["unknown argument to --with-logging: $with_logging"])
521 esac], [AC_DEFINE(LOGGING, SLOG_SYSLOG) AC_MSG_RESULT(syslog)])
523 AC_ARG_WITH(logfac, [AS_HELP_STRING([--with-logfac], [syslog facility to log with (default is "auth")])],
524 [case $with_logfac in
525 yes) AC_MSG_ERROR(["must give --with-logfac an argument."])
527 no) AC_MSG_ERROR(["--without-logfac not supported."])
529 authpriv|auth|daemon|user|local0|local1|local2|local3|local4|local5|local6|local7) logfac=$with_logfac
531 *) AC_MSG_ERROR(["$with_logfac is not a supported syslog facility."])
535 AC_MSG_CHECKING(at which syslog priority to log commands)
536 AC_ARG_WITH(goodpri, [AS_HELP_STRING([--with-goodpri], [syslog priority for commands (def is "notice")])],
537 [case $with_goodpri in
538 yes) AC_MSG_ERROR(["must give --with-goodpri an argument."])
540 no) AC_MSG_ERROR(["--without-goodpri not supported."])
542 alert|crit|debug|emerg|err|info|notice|warning)
543 goodpri=$with_goodpri
545 *) AC_MSG_ERROR(["$with_goodpri is not a supported syslog priority."])
548 AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri", [The syslog priority sudo will use for successful attempts.])
549 AC_MSG_RESULT($goodpri)
551 AC_MSG_CHECKING(at which syslog priority to log failures)
552 AC_ARG_WITH(badpri, [AS_HELP_STRING([--with-badpri], [syslog priority for failures (def is "alert")])],
553 [case $with_badpri in
554 yes) AC_MSG_ERROR(["must give --with-badpri an argument."])
556 no) AC_MSG_ERROR(["--without-badpri not supported."])
558 alert|crit|debug|emerg|err|info|notice|warning)
561 *) AC_MSG_ERROR([$with_badpri is not a supported syslog priority.])
564 AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri", [The syslog priority sudo will use for unsuccessful attempts/errors.])
565 AC_MSG_RESULT($badpri)
567 AC_ARG_WITH(logpath, [AS_HELP_STRING([--with-logpath], [path to the sudo log file])],
568 [case $with_logpath in
569 yes) AC_MSG_ERROR(["must give --with-logpath an argument."])
571 no) AC_MSG_ERROR(["--without-logpath not supported."])
575 AC_MSG_CHECKING(how long a line in the log file should be)
576 AC_ARG_WITH(loglen, [AS_HELP_STRING([--with-loglen], [maximum length of a log file line (default is 80)])],
577 [case $with_loglen in
578 yes) AC_MSG_ERROR(["must give --with-loglen an argument."])
580 no) AC_MSG_ERROR(["--without-loglen not supported."])
582 [[0-9]]*) loglen=$with_loglen
584 *) AC_MSG_ERROR(["you must enter a number, not $with_loglen"])
587 AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen, [The max number of chars per log file line (for line wrapping).])
588 AC_MSG_RESULT($loglen)
590 AC_MSG_CHECKING(whether sudo should ignore '.' or '' in \$PATH)
591 AC_ARG_WITH(ignore-dot, [AS_HELP_STRING([--with-ignore-dot], [ignore '.' in the PATH])],
592 [case $with_ignore_dot in
597 *) AC_MSG_ERROR(["--with-ignore-dot does not take an argument."])
600 if test "$ignore_dot" = "on"; then
601 AC_DEFINE(IGNORE_DOT_PATH)
607 AC_MSG_CHECKING(whether to send mail when a user is not in sudoers)
608 AC_ARG_WITH(mail-if-no-user, [AS_HELP_STRING([--without-mail-if-no-user], [do not send mail if user not in sudoers])],
609 [case $with_mail_if_no_user in
614 *) AC_MSG_ERROR(["--with-mail-if-no-user does not take an argument."])
617 if test "$mail_no_user" = "on"; then
618 AC_DEFINE(SEND_MAIL_WHEN_NO_USER)
624 AC_MSG_CHECKING(whether to send mail when user listed but not for this host)
625 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])],
626 [case $with_mail_if_no_host in
631 *) AC_MSG_ERROR(["--with-mail-if-no-host does not take an argument."])
634 if test "$mail_no_host" = "on"; then
635 AC_DEFINE(SEND_MAIL_WHEN_NO_HOST)
641 AC_MSG_CHECKING(whether to send mail when a user tries a disallowed command)
642 AC_ARG_WITH(mail-if-noperms, [AS_HELP_STRING([--with-mail-if-noperms], [send mail if user not allowed to run command])],
643 [case $with_mail_if_noperms in
648 *) AC_MSG_ERROR(["--with-mail-if-noperms does not take an argument."])
651 if test "$mail_noperms" = "on"; then
652 AC_DEFINE(SEND_MAIL_WHEN_NOT_OK)
658 AC_MSG_CHECKING(who should get the mail that sudo sends)
659 AC_ARG_WITH(mailto, [AS_HELP_STRING([--with-mailto], [who should get sudo mail (default is "root")])],
660 [case $with_mailto in
661 yes) AC_MSG_ERROR(["must give --with-mailto an argument."])
663 no) AC_MSG_ERROR(["--without-mailto not supported."])
665 *) mailto=$with_mailto
668 AC_DEFINE_UNQUOTED(MAILTO, "$mailto", [The user or email address that sudo mail is sent to.])
669 AC_MSG_RESULT([$mailto])
671 AC_ARG_WITH(mailsubject, [AS_HELP_STRING([--with-mailsubject], [subject of sudo mail])],
672 [case $with_mailsubject in
673 yes) AC_MSG_ERROR(["must give --with-mailsubject an argument."])
675 no) AC_MSG_WARN([Sorry, --without-mailsubject not supported.])
677 *) mailsub="$with_mailsubject"
678 AC_MSG_CHECKING(sudo mail subject)
679 AC_MSG_RESULT([Using alert mail subject: $mailsub])
682 AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub", [The subject of the mail sent by sudo to the MAILTO user/address.])
684 AC_MSG_CHECKING(for bad password prompt)
685 AC_ARG_WITH(passprompt, [AS_HELP_STRING([--with-passprompt], [default password prompt])],
686 [case $with_passprompt in
687 yes) AC_MSG_ERROR(["must give --with-passprompt an argument."])
689 no) AC_MSG_WARN([Sorry, --without-passprompt not supported.])
691 *) passprompt="$with_passprompt"
693 AC_MSG_RESULT($passprompt)
694 AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt", [The default password prompt.])
696 AC_MSG_CHECKING(for bad password message)
697 AC_ARG_WITH(badpass-message, [AS_HELP_STRING([--with-badpass-message], [message the user sees when the password is wrong])],
698 [case $with_badpass_message in
699 yes) AC_MSG_ERROR(["Must give --with-badpass-message an argument."])
701 no) AC_MSG_WARN([Sorry, --without-badpass-message not supported.])
703 *) badpass_message="$with_badpass_message"
706 AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message", [The message given when a bad password is entered.])
707 AC_MSG_RESULT([$badpass_message])
709 AC_MSG_CHECKING(whether to expect fully qualified hosts in sudoers)
710 AC_ARG_WITH(fqdn, [AS_HELP_STRING([--with-fqdn], [expect fully qualified hosts in sudoers])],
716 *) AC_MSG_ERROR(["--with-fqdn does not take an argument."])
719 if test "$fqdn" = "on"; then
726 AC_ARG_WITH(timedir, [AS_HELP_STRING([--with-timedir], [path to the sudo timestamp dir])],
727 [case $with_timedir in
728 yes) AC_MSG_ERROR(["must give --with-timedir an argument."])
730 no) AC_MSG_ERROR(["--without-timedir not supported."])
734 AC_ARG_WITH(iologdir, [AS_HELP_STRING([--with-iologdir=DIR], [directory to store sudo I/O log files in])],
735 [case $with_iologdir in
737 no) AC_MSG_ERROR(["--without-iologdir not supported."])
741 AC_ARG_WITH(sendmail, [AS_HELP_STRING([--with-sendmail], [set path to sendmail])
742 AS_HELP_STRING([--without-sendmail], [do not send mail at all])],
743 [case $with_sendmail in
744 yes) with_sendmail=""
747 *) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail")
751 AC_ARG_WITH(sudoers-mode, [AS_HELP_STRING([--with-sudoers-mode], [mode of sudoers file (defaults to 0440)])],
752 [case $with_sudoers_mode in
753 yes) AC_MSG_ERROR(["must give --with-sudoers-mode an argument."])
755 no) AC_MSG_ERROR(["--without-sudoers-mode not supported."])
757 [[1-9]]*) SUDOERS_MODE=0${with_sudoers_mode}
759 0*) SUDOERS_MODE=$with_sudoers_mode
761 *) AC_MSG_ERROR(["you must use an octal mode, not a name."])
765 AC_ARG_WITH(sudoers-uid, [AS_HELP_STRING([--with-sudoers-uid], [uid that owns sudoers file (defaults to 0)])],
766 [case $with_sudoers_uid in
767 yes) AC_MSG_ERROR(["must give --with-sudoers-uid an argument."])
769 no) AC_MSG_ERROR(["--without-sudoers-uid not supported."])
771 [[0-9]]*) SUDOERS_UID=$with_sudoers_uid
773 *) AC_MSG_ERROR(["you must use an unsigned numeric uid, not a name."])
777 AC_ARG_WITH(sudoers-gid, [AS_HELP_STRING([--with-sudoers-gid], [gid that owns sudoers file (defaults to 0)])],
778 [case $with_sudoers_gid in
779 yes) AC_MSG_ERROR(["must give --with-sudoers-gid an argument."])
781 no) AC_MSG_ERROR(["--without-sudoers-gid not supported."])
783 [[0-9]]*) SUDOERS_GID=$with_sudoers_gid
785 *) AC_MSG_ERROR(["you must use an unsigned numeric gid, not a name."])
789 AC_MSG_CHECKING(for umask programs should be run with)
790 AC_ARG_WITH(umask, [AS_HELP_STRING([--with-umask], [umask with which the prog should run (default is 022)])
791 AS_HELP_STRING([--without-umask], [Preserves the umask of the user invoking sudo.])],
793 yes) AC_MSG_ERROR(["must give --with-umask an argument."])
797 [[0-9]]*) sudo_umask=$with_umask
799 *) AC_MSG_ERROR(["you must enter a numeric mask."])
802 AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask, [The umask that the sudo-run prog should use.])
803 if test "$sudo_umask" = "0777"; then
806 AC_MSG_RESULT($sudo_umask)
809 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.])],
810 [case $with_umask_override in
811 yes) AC_DEFINE(UMASK_OVERRIDE)
814 no) umask_override=off
816 *) AC_MSG_ERROR(["--with-umask-override does not take an argument."])
820 AC_MSG_CHECKING(for default user to run commands as)
821 AC_ARG_WITH(runas-default, [AS_HELP_STRING([--with-runas-default], [User to run commands as (default is "root")])],
822 [case $with_runas_default in
823 yes) AC_MSG_ERROR(["must give --with-runas-default an argument."])
825 no) AC_MSG_ERROR(["--without-runas-default not supported."])
827 *) runas_default="$with_runas_default"
830 AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default", [The user sudo should run commands as by default.])
831 AC_MSG_RESULT([$runas_default])
833 AC_ARG_WITH(exempt, [AS_HELP_STRING([--with-exempt=group], [no passwd needed for users in this group])],
834 [case $with_exempt in
835 yes) AC_MSG_ERROR(["must give --with-exempt an argument."])
837 no) AC_MSG_ERROR(["--without-exempt not supported."])
839 *) AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt", [If defined, users in this group need not enter a passwd (ie "sudo").])
840 AC_MSG_CHECKING(for group to be exempt from password)
841 AC_MSG_RESULT([$with_exempt])
845 AC_MSG_CHECKING(for editor that visudo should use)
846 AC_ARG_WITH(editor, [AS_HELP_STRING([--with-editor=path], [Default editor for visudo (defaults to vi)])],
847 [case $with_editor in
848 yes) AC_MSG_ERROR(["must give --with-editor an argument."])
850 no) AC_MSG_ERROR(["--without-editor not supported."])
852 *) AC_DEFINE_UNQUOTED(EDITOR, "$with_editor", [A colon-separated list of pathnames to be used as the editor for visudo.])
853 AC_MSG_RESULT([$with_editor])
854 editor="$with_editor"
856 esac], [AC_DEFINE(EDITOR, _PATH_VI) AC_MSG_RESULT(vi)])
858 AC_MSG_CHECKING(whether to obey EDITOR and VISUAL environment variables)
859 AC_ARG_WITH(env-editor, [AS_HELP_STRING([--with-env-editor], [Use the environment variable EDITOR for visudo])],
860 [case $with_env_editor in
865 *) AC_MSG_ERROR(["--with-env-editor does not take an argument."])
868 if test "$env_editor" = "on"; then
869 AC_DEFINE(ENV_EDITOR)
875 AC_MSG_CHECKING(number of tries a user gets to enter their password)
876 AC_ARG_WITH(passwd-tries, [AS_HELP_STRING([--with-passwd-tries], [number of tries to enter password (default is 3)])],
877 [case $with_passwd_tries in
879 no) AC_MSG_ERROR(["--without-editor not supported."])
881 [[1-9]]*) passwd_tries=$with_passwd_tries
883 *) AC_MSG_ERROR(["you must enter the numer of tries, > 0"])
886 AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries, [The number of tries a user gets to enter their password.])
887 AC_MSG_RESULT($passwd_tries)
889 AC_MSG_CHECKING(time in minutes after which sudo will ask for a password again)
890 AC_ARG_WITH(timeout, [AS_HELP_STRING([--with-timeout], [minutes before sudo asks for passwd again (def is 5 minutes)])],
891 [case $with_timeout in
895 [[0-9]]*) timeout=$with_timeout
897 *) AC_MSG_ERROR(["you must enter the numer of minutes."])
900 AC_DEFINE_UNQUOTED(TIMEOUT, $timeout, [The number of minutes before sudo asks for a password again.])
901 AC_MSG_RESULT($timeout)
903 AC_MSG_CHECKING(time in minutes after the password prompt will time out)
904 AC_ARG_WITH(password-timeout, [AS_HELP_STRING([--with-password-timeout], [passwd prompt timeout in minutes (default is 5 minutes)])],
905 [case $with_password_timeout in
907 no) password_timeout=0
909 [[0-9]]*) password_timeout=$with_password_timeout
911 *) AC_MSG_ERROR(["you must enter the numer of minutes."])
914 AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout, [The passwd prompt timeout (in minutes).])
915 AC_MSG_RESULT($password_timeout)
917 AC_MSG_CHECKING(whether to use per-tty ticket files)
918 AC_ARG_WITH(tty-tickets, [AS_HELP_STRING([--with-tty-tickets], [use a different ticket file for each tty])],
919 [case $with_tty_tickets in
924 *) AC_MSG_ERROR(["--with-tty-tickets does not take an argument."])
927 if test "$tty_tickets" = "off"; then
928 AC_DEFINE(NO_TTY_TICKETS)
934 AC_MSG_CHECKING(whether to include insults)
935 AC_ARG_WITH(insults, [AS_HELP_STRING([--with-insults], [insult the user for entering an incorrect password])],
936 [case $with_insults in
938 with_classic_insults=yes
939 with_csops_insults=yes
941 disabled) insults=off
942 with_classic_insults=yes
943 with_csops_insults=yes
947 *) AC_MSG_ERROR(["--with-insults does not take an argument."])
950 if test "$insults" = "on"; then
951 AC_DEFINE(USE_INSULTS)
957 AC_ARG_WITH(all-insults, [AS_HELP_STRING([--with-all-insults], [include all the sudo insult sets])],
958 [case $with_all_insults in
959 yes) with_classic_insults=yes
960 with_csops_insults=yes
962 with_goons_insults=yes
965 *) AC_MSG_ERROR(["--with-all-insults does not take an argument."])
969 AC_ARG_WITH(classic-insults, [AS_HELP_STRING([--with-classic-insults], [include the insults from the "classic" sudo])],
970 [case $with_classic_insults in
971 yes) AC_DEFINE(CLASSIC_INSULTS)
974 *) AC_MSG_ERROR(["--with-classic-insults does not take an argument."])
978 AC_ARG_WITH(csops-insults, [AS_HELP_STRING([--with-csops-insults], [include CSOps insults])],
979 [case $with_csops_insults in
980 yes) AC_DEFINE(CSOPS_INSULTS)
983 *) AC_MSG_ERROR(["--with-csops-insults does not take an argument."])
987 AC_ARG_WITH(hal-insults, [AS_HELP_STRING([--with-hal-insults], [include 2001-like insults])],
988 [case $with_hal_insults in
989 yes) AC_DEFINE(HAL_INSULTS)
992 *) AC_MSG_ERROR(["--with-hal-insults does not take an argument."])
996 AC_ARG_WITH(goons-insults, [AS_HELP_STRING([--with-goons-insults], [include the insults from the "Goon Show"])],
997 [case $with_goons_insults in
998 yes) AC_DEFINE(GOONS_INSULTS)
1001 *) AC_MSG_ERROR(["--with-goons-insults does not take an argument."])
1005 AC_ARG_WITH(nsswitch, [AS_HELP_STRING([--with-nsswitch[[=PATH]]], [path to nsswitch.conf])],
1006 [case $with_nsswitch in
1008 yes) with_nsswitch="/etc/nsswitch.conf"
1013 AC_ARG_WITH(ldap, [AS_HELP_STRING([--with-ldap[[=DIR]]], [enable LDAP support])],
1016 *) AC_DEFINE(HAVE_LDAP)
1017 AC_MSG_CHECKING(whether to use sudoers from LDAP)
1022 AC_ARG_WITH(ldap-conf-file, [AS_HELP_STRING([--with-ldap-conf-file], [path to LDAP configuration file])])
1023 test -n "$with_ldap_conf_file" && ldap_conf="$with_ldap_conf_file"
1024 SUDO_DEFINE_UNQUOTED(_PATH_LDAP_CONF, "$ldap_conf", [Path to the ldap.conf file])
1026 AC_ARG_WITH(ldap-secret-file, [AS_HELP_STRING([--with-ldap-secret-file], [path to LDAP secret password file])])
1027 test -n "$with_ldap_secret_file" && ldap_secret="$with_ldap_secret_file"
1028 SUDO_DEFINE_UNQUOTED(_PATH_LDAP_SECRET, "$ldap_secret", [Path to the ldap.secret file])
1030 AC_ARG_WITH(pc-insults, [AS_HELP_STRING([--with-pc-insults], [replace politically incorrect insults with less offensive ones])],
1031 [case $with_pc_insults in
1032 yes) AC_DEFINE(PC_INSULTS)
1035 *) AC_MSG_ERROR(["--with-pc-insults does not take an argument."])
1039 dnl include all insult sets on one line
1040 if test "$insults" = "on"; then
1041 AC_MSG_CHECKING(which insult sets to include)
1043 test "$with_goons_insults" = "yes" && i="goons ${i}"
1044 test "$with_hal_insults" = "yes" && i="hal ${i}"
1045 test "$with_csops_insults" = "yes" && i="csops ${i}"
1046 test "$with_classic_insults" = "yes" && i="classic ${i}"
1050 AC_MSG_CHECKING(whether to override the user's path)
1051 AC_ARG_WITH(secure-path, [AS_HELP_STRING([--with-secure-path], [override the user's path with a built-in one])],
1052 [case $with_secure_path in
1053 yes) with_secure_path="/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc"
1054 AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
1055 AC_MSG_RESULT([$with_secure_path])
1056 secure_path="set to $with_secure_path"
1058 no) AC_MSG_RESULT(no)
1060 *) AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
1061 AC_MSG_RESULT([$with_secure_path])
1062 secure_path="set to F<$with_secure_path>"
1064 esac], AC_MSG_RESULT(no))
1066 AC_MSG_CHECKING(whether to get ip addresses from the network interfaces)
1067 AC_ARG_WITH(interfaces, [AS_HELP_STRING([--without-interfaces], [don't try to read the ip addr of ether interfaces])],
1068 [case $with_interfaces in
1069 yes) AC_MSG_RESULT(yes)
1071 no) AC_DEFINE(STUB_LOAD_INTERFACES)
1074 *) AC_MSG_ERROR(["--with-interfaces does not take an argument."])
1076 esac], AC_MSG_RESULT(yes))
1078 AC_MSG_CHECKING(whether stow should be used)
1079 AC_ARG_WITH(stow, [AS_HELP_STRING([--with-stow], [properly handle GNU stow packaging])],
1081 yes) AC_MSG_RESULT(yes)
1084 no) AC_MSG_RESULT(no)
1086 *) AC_MSG_ERROR(["--with-stow does not take an argument."])
1088 esac], AC_MSG_RESULT(no))
1090 AC_MSG_CHECKING(whether to use an askpass helper)
1091 AC_ARG_WITH(askpass, [AS_HELP_STRING([--with-askpass=PATH], [Fully qualified pathname of askpass helper])],
1092 [case $with_askpass in
1093 yes) AC_MSG_ERROR(["--with-askpass takes a path as an argument."])
1096 *) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_ASKPASS, "$with_askpass", [The fully qualified pathname of askpass])
1098 esac], AC_MSG_RESULT(no))
1100 AC_ARG_WITH(plugindir, [AS_HELP_STRING([--with-plugindir], [set directory to load plugins from])],
1101 [case $with_plugindir in
1102 no) AC_MSG_ERROR(["illegal argument: --without-plugindir."])
1105 esac], [with_plugindir="$libexecdir"])
1108 dnl Options for --enable
1111 AC_MSG_CHECKING(whether to do user authentication by default)
1112 AC_ARG_ENABLE(authentication,
1113 [AS_HELP_STRING([--disable-authentication], [Do not require authentication by default])],
1114 [ case "$enableval" in
1115 yes) AC_MSG_RESULT(yes)
1117 no) AC_MSG_RESULT(no)
1118 AC_DEFINE(NO_AUTHENTICATION)
1120 *) AC_MSG_RESULT(no)
1121 AC_MSG_WARN([Ignoring unknown argument to --enable-authentication: $enableval])
1124 ], AC_MSG_RESULT(yes))
1126 AC_MSG_CHECKING(whether to disable running the mailer as root)
1127 AC_ARG_ENABLE(root-mailer,
1128 [AS_HELP_STRING([--disable-root-mailer], [Don't run the mailer as root, run as the user])],
1129 [ case "$enableval" in
1130 yes) AC_MSG_RESULT(no)
1132 no) AC_MSG_RESULT(yes)
1133 AC_DEFINE(NO_ROOT_MAILER)
1135 *) AC_MSG_RESULT(no)
1136 AC_MSG_WARN([Ignoring unknown argument to --enable-root-mailer: $enableval])
1139 ], AC_MSG_RESULT(no))
1141 AC_ARG_ENABLE(setreuid,
1142 [AS_HELP_STRING([--disable-setreuid], [Don't try to use the setreuid() function])],
1143 [ case "$enableval" in
1144 no) SKIP_SETREUID=yes
1150 AC_ARG_ENABLE(setresuid,
1151 [AS_HELP_STRING([--disable-setresuid], [Don't try to use the setresuid() function])],
1152 [ case "$enableval" in
1153 no) SKIP_SETRESUID=yes
1159 AC_MSG_CHECKING(whether to disable shadow password support)
1160 AC_ARG_ENABLE(shadow,
1161 [AS_HELP_STRING([--disable-shadow], [Never use shadow passwords])],
1162 [ case "$enableval" in
1163 yes) AC_MSG_RESULT(no)
1165 no) AC_MSG_RESULT(yes)
1168 *) AC_MSG_RESULT(no)
1169 AC_MSG_WARN([Ignoring unknown argument to --enable-shadow: $enableval])
1172 ], AC_MSG_RESULT(no))
1174 AC_MSG_CHECKING(whether root should be allowed to use sudo)
1175 AC_ARG_ENABLE(root-sudo,
1176 [AS_HELP_STRING([--disable-root-sudo], [Don't allow root to run sudo])],
1177 [ case "$enableval" in
1178 yes) AC_MSG_RESULT(yes)
1180 no) AC_DEFINE(NO_ROOT_SUDO)
1184 *) AC_MSG_ERROR(["--enable-root-sudo does not take an argument."])
1187 ], AC_MSG_RESULT(yes))
1189 AC_MSG_CHECKING(whether to log the hostname in the log file)
1190 AC_ARG_ENABLE(log-host,
1191 [AS_HELP_STRING([--enable-log-host], [Log the hostname in the log file])],
1192 [ case "$enableval" in
1193 yes) AC_MSG_RESULT(yes)
1194 AC_DEFINE(HOST_IN_LOG)
1196 no) AC_MSG_RESULT(no)
1198 *) AC_MSG_RESULT(no)
1199 AC_MSG_WARN([Ignoring unknown argument to --enable-log-host: $enableval])
1202 ], AC_MSG_RESULT(no))
1204 AC_MSG_CHECKING(whether to invoke a shell if sudo is given no arguments)
1205 AC_ARG_ENABLE(noargs-shell,
1206 [AS_HELP_STRING([--enable-noargs-shell], [If sudo is given no arguments run a shell])],
1207 [ case "$enableval" in
1208 yes) AC_MSG_RESULT(yes)
1209 AC_DEFINE(SHELL_IF_NO_ARGS)
1211 no) AC_MSG_RESULT(no)
1213 *) AC_MSG_RESULT(no)
1214 AC_MSG_WARN([Ignoring unknown argument to --enable-noargs-shell: $enableval])
1217 ], AC_MSG_RESULT(no))
1219 AC_MSG_CHECKING(whether to set \$HOME to target user in shell mode)
1220 AC_ARG_ENABLE(shell-sets-home,
1221 [AS_HELP_STRING([--enable-shell-sets-home], [Set $HOME to target user in shell mode])],
1222 [ case "$enableval" in
1223 yes) AC_MSG_RESULT(yes)
1224 AC_DEFINE(SHELL_SETS_HOME)
1226 no) AC_MSG_RESULT(no)
1228 *) AC_MSG_RESULT(no)
1229 AC_MSG_WARN([Ignoring unknown argument to --enable-shell-sets-home: $enableval])
1232 ], AC_MSG_RESULT(no))
1234 AC_MSG_CHECKING(whether to disable 'command not found' messages)
1235 AC_ARG_ENABLE(path_info,
1236 [AS_HELP_STRING([--disable-path-info], [Print 'command not allowed' not 'command not found'])],
1237 [ case "$enableval" in
1238 yes) AC_MSG_RESULT(no)
1240 no) AC_MSG_RESULT(yes)
1241 AC_DEFINE(DONT_LEAK_PATH_INFO)
1244 *) AC_MSG_RESULT(no)
1245 AC_MSG_WARN([Ignoring unknown argument to --enable-path-info: $enableval])
1248 ], AC_MSG_RESULT(no))
1250 AC_MSG_CHECKING(whether to enable environment debugging)
1251 AC_ARG_ENABLE(env_debug,
1252 [AS_HELP_STRING([--enable-env-debug], [Whether to enable environment debugging.])],
1253 [ case "$enableval" in
1254 yes) AC_MSG_RESULT(yes)
1255 AC_DEFINE(ENV_DEBUG)
1257 no) AC_MSG_RESULT(no)
1259 *) AC_MSG_RESULT(no)
1260 AC_MSG_WARN([Ignoring unknown argument to --enable-env-debug: $enableval])
1263 ], AC_MSG_RESULT(no))
1266 [AS_HELP_STRING([--enable-zlib[[=PATH]]], [Whether to enable or disable zlib])],
1269 AC_MSG_CHECKING(whether to enable environment resetting by default)
1270 AC_ARG_ENABLE(env_reset,
1271 [AS_HELP_STRING([--enable-env-reset], [Whether to enable environment resetting by default.])],
1272 [ case "$enableval" in
1278 AC_MSG_WARN([Ignoring unknown argument to --enable-env-reset: $enableval])
1282 if test "$env_reset" = "on"; then
1284 AC_DEFINE(ENV_RESET, TRUE)
1287 AC_DEFINE(ENV_RESET, FALSE)
1290 AC_ARG_ENABLE(warnings,
1291 [AS_HELP_STRING([--enable-warnings], [Whether to enable compiler warnings])],
1292 [ case "$enableval" in
1293 yes) if test X"$with_devel" != X"yes" -a -n "$GCC"; then
1294 CFLAGS="${CFLAGS} -Wall"
1298 *) AC_MSG_WARN([Ignoring unknown argument to --enable-warnings: $enableval])
1303 AC_ARG_ENABLE(admin-flag,
1304 [AS_HELP_STRING([--enable-admin-flag], [Whether to create a Ubuntu-style admin flag file])],
1305 [ case "$enableval" in
1306 yes) AC_DEFINE(USE_ADMIN_FLAG)
1309 *) AC_MSG_WARN([Ignoring unknown argument to --enable-admin-flag: $enableval])
1314 AC_ARG_WITH(selinux, [AS_HELP_STRING([--with-selinux], [enable SELinux support])],
1315 [case $with_selinux in
1316 yes) SELINUX_USAGE="[[-r role]] [[-t type]] "
1317 AC_DEFINE(HAVE_SELINUX)
1318 SUDO_LIBS="${SUDO_LIBS} -lselinux"
1319 SUDO_OBJS="${SUDO_OBJS} selinux.o"
1320 PROGS="${PROGS} sesh"
1322 AC_CHECK_LIB([selinux], [setkeycreatecon],
1323 [AC_DEFINE(HAVE_SETKEYCREATECON)])
1326 *) AC_MSG_ERROR(["--with-selinux does not take an argument."])
1331 dnl gss_krb5_ccache_name() may not work on Heimdal so we don't use it by default
1333 AC_ARG_ENABLE(gss_krb5_ccache_name,
1334 [AS_HELP_STRING([--enable-gss-krb5-ccache-name], [Use GSS-API to set the Kerberos V cred cache name])],
1335 [check_gss_krb5_ccache_name=$enableval], [check_gss_krb5_ccache_name=no])
1338 dnl C compiler checks
1340 AC_SEARCH_LIBS([strerror], [cposix])
1342 AC_CHECK_TOOL(AR, ar, false)
1343 AC_CHECK_TOOL(RANLIB, ranlib, :)
1344 if test X"$AR" = X"false"; then
1345 AC_MSG_ERROR([the "ar" utility is required to build sudo])
1348 if test "x$ac_cv_prog_cc_c89" = "xno"; then
1349 AC_MSG_ERROR([Sudo version $PACKAGE_VERSION requires an ANSI C compiler to build.])
1353 dnl Libtool setup, we require libtool 2.2.6b or higher
1356 AC_CONFIG_MACRO_DIR([m4])
1361 dnl Defer with_noexec until after libtool magic runs
1363 if test "$enable_shared" = "no"; then
1369 eval _shrext="$shrext_cmds"
1370 # Darwin uses .dylib for libraries but .so for modules
1371 if test X"$_shrext" = X".dylib"; then
1377 AC_MSG_CHECKING(path to sudo_noexec.so)
1378 AC_ARG_WITH(noexec, [AS_HELP_STRING([--with-noexec[=PATH]], [fully qualified pathname of sudo_noexec.so])],
1379 [case $with_noexec in
1380 yes) with_noexec="$libexecdir/sudo_noexec$_shrext"
1384 esac], [with_noexec="$libexecdir/sudo_noexec$_shrext"])
1385 AC_MSG_RESULT($with_noexec)
1386 NOEXECFILE="sudo_noexec$_shrext"
1387 NOEXECDIR="`echo $with_noexec|sed 's:^\(.*\)/[[^/]]*:\1:'`"
1390 dnl It is now safe to modify CFLAGS and CPPFLAGS
1392 if test X"$with_devel" = X"yes" -a -n "$GCC"; then
1393 CFLAGS="${CFLAGS} -Wall"
1397 dnl Find programs we use
1399 AC_CHECK_PROG(UNAMEPROG, [uname], [uname])
1400 AC_CHECK_PROG(TRPROG, [tr], [tr])
1401 AC_CHECK_PROGS(NROFFPROG, [nroff mandoc])
1402 if test -z "$NROFFPROG"; then
1404 mansrcdir='$(srcdir)'
1408 dnl What kind of beastie are we being run on?
1409 dnl Barf if config.cache was generated on another host.
1411 if test -n "$sudo_cv_prev_host"; then
1412 if test "$sudo_cv_prev_host" != "$host"; then
1413 AC_MSG_ERROR([config.cache was created on a different host; remove it and re-run configure.])
1415 AC_MSG_CHECKING(previous host type)
1416 AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
1417 AC_MSG_RESULT([$sudo_cv_prev_host])
1420 # this will produce no output since there is no cached value
1421 AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
1425 dnl We want to be able to differentiate between different rev's
1427 if test -n "$host_os"; then
1428 OS=`echo $host_os | sed 's/[[0-9]].*//'`
1429 OSREV=`echo $host_os | sed 's/^[[^0-9\.]]*\([[0-9\.]]*\).*$/\1/'`
1430 OSMAJOR=`echo $OSREV | sed 's/\..*$//'`
1439 # getcwd(3) opens a pipe to getpwd(1)!?!
1442 # system headers lack prototypes but gcc helps...
1443 if test -n "$GCC"; then
1444 OSDEFS="${OSDEFS} -D__USE_FIXED_PROTOTYPES__"
1447 shadow_funcs="getpwanam issecure"
1450 # To get the crypt(3) prototype (so we pass -Wall)
1451 OSDEFS="${OSDEFS} -D__EXTENSIONS__"
1452 # AFS support needs -lucb
1453 if test "$with_AFS" = "yes"; then
1454 AFS_LIBS="-lc -lucb"
1457 : ${mansectform='4'}
1458 : ${with_rpath='yes'}
1459 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1460 AC_CHECK_FUNCS(priv_set)
1463 # To get all prototypes (so we pass -Wall)
1464 OSDEFS="${OSDEFS} -D_ALL_SOURCE -D_LINUX_SOURCE_COMPAT"
1465 SUDOERS_LDFLAGS="${SUDOERS_LDFLAGS} -Wl,-bI:\$(srcdir)/aixcrypt.exp"
1466 if test X"$with_blibpath" != X"no"; then
1467 AC_MSG_CHECKING([if linker accepts -Wl,-blibpath])
1468 O_LDFLAGS="$LDFLAGS"
1469 LDFLAGS="$O_LDFLAGS -Wl,-blibpath:/usr/lib:/lib"
1470 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [
1471 if test -n "$with_blibpath" -a "$with_blibpath" != "yes"; then
1472 blibpath="$with_blibpath"
1473 elif test -n "$GCC"; then
1474 blibpath="/usr/lib:/lib:/usr/local/lib"
1476 blibpath="/usr/lib:/lib"
1479 ], [AC_MSG_RESULT(no)])
1481 LDFLAGS="$O_LDFLAGS"
1483 # Use authenticate(3) as the default authentication method
1484 if test X"$with_aixauth" = X""; then
1485 AC_CHECK_FUNCS(authenticate, [AUTH_EXCL_DEF="AIX_AUTH"])
1488 # AIX analog of nsswitch.conf, enabled by default
1489 AC_ARG_WITH(netsvc, [AS_HELP_STRING([--with-netsvc[[=PATH]]], [path to netsvc.conf])],
1490 [case $with_netsvc in
1492 yes) with_netsvc="/etc/netsvc.conf"
1496 if test -z "$with_nsswitch" -a -z "$with_netsvc"; then
1497 with_netsvc="/etc/netsvc.conf"
1500 # AIX-specific functions
1501 AC_CHECK_FUNCS(getuserattr setauthdb)
1502 COMMON_OBJS="$COMMON_OBJS aix.lo"
1506 : ${mansectform='4'}
1509 # AFS support needs -lBSD
1510 if test "$with_AFS" = "yes"; then
1511 AFS_LIBS="-lc -lBSD"
1514 : ${mansectform='4'}
1516 if test -z "$GCC"; then
1517 # Use the +DAportable flag on hppa if it is supported
1521 CFLAGS="$CFLAGS +DAportable"
1522 AC_CACHE_CHECK([whether $CC understands +DAportable],
1523 [sudo_cv_var_daportable],
1525 [AC_LANG_PROGRAM([[]], [[]])],
1526 [sudo_cv_var_daportable=yes],
1527 [sudo_cv_var_daportable=no]
1531 if test X"$sudo_cv_var_daportable" != X"yes"; then
1540 AC_DEFINE(BROKEN_SYSLOG)
1543 AC_DEFINE(BROKEN_SYSLOG)
1545 shadow_funcs="getspwuid"
1547 # DCE support (requires ANSI C compiler)
1548 if test "$with_DCE" = "yes"; then
1549 # order of libs in 9.X is important. -lc_r must be last
1550 SUDOERS_LIBS="${SUDOERS_LIBS} -ldce -lM -lc_r"
1551 LIBS="${LIBS} -ldce -lM -lc_r"
1552 CPPFLAGS="${CPPFLAGS} -D_REENTRANT -I/usr/include/reentrant"
1556 shadow_funcs="getprpwnam iscomsec"
1558 # HP-UX 10.20 libc has an incompatible getline
1559 ac_cv_func_getline="no"
1562 shadow_funcs="getspnam iscomsec"
1564 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1569 # ignore envariables wrt dynamic lib path
1570 SUDOERS_LDFLAGS="${SUDOERS_LDFLAGS} -Wl,-no_library_replacement"
1572 : ${CHECKSIA='true'}
1573 AC_MSG_CHECKING(whether to disable sia support on Digital UNIX)
1575 [AS_HELP_STRING([--disable-sia], [Disable SIA on Digital UNIX])],
1576 [ case "$enableval" in
1577 yes) AC_MSG_RESULT(no)
1580 no) AC_MSG_RESULT(yes)
1583 *) AC_MSG_RESULT(no)
1584 AC_MSG_WARN([Ignoring unknown argument to --enable-sia: $enableval])
1587 ], AC_MSG_RESULT(no))
1589 shadow_funcs="getprpwnam dispcrypt"
1590 # OSF/1 4.x and higher need -ldb too
1591 if test $OSMAJOR -lt 4; then
1592 shadow_libs="-lsecurity -laud -lm"
1594 shadow_libs="-lsecurity -ldb -laud -lm"
1597 # use SIA by default, if we have it
1598 test "$CHECKSIA" = "true" && AUTH_EXCL_DEF="SIA"
1601 # Some versions of Digital Unix ship with a broken
1602 # copy of prot.h, which we need for shadow passwords.
1603 # XXX - make should remove this as part of distclean
1605 AC_MSG_CHECKING([for broken prot.h])
1606 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1607 #include <sys/types.h>
1608 #include <sys/security.h>
1610 ]], [[exit(0);]])], [AC_MSG_RESULT(no)], [AC_MSG_RESULT([yes, fixing locally])
1611 sed 's:<acl.h>:<sys/acl.h>:g' < /usr/include/prot.h > prot.h
1614 : ${mansectform='4'}
1617 OSDEFS="${OSDEFS} -D_BSD_TYPES"
1618 if test -z "$NROFFPROG"; then
1619 MAN_POSTINSTALL=' /bin/rm -f $(mandirsu)/sudo.$(mansectsu).z $(mandirsu)/visudo.$(mansectsu).z $(mandirform)/sudoers.$(mansectform).z ; /usr/bin/pack $(mandirsu)/sudo.$(mansectsu) $(mandirsu)/visudo.$(mansectsu) $(mandirform)/sudoers.$(mansectform)'
1620 if test "$prefix" = "/usr/local" -a "$mandir" = '${datarootdir}/man'; then
1621 if test -d /usr/share/catman/local; then
1622 mandir="/usr/share/catman/local"
1624 mandir="/usr/catman/local"
1628 if test "$prefix" = "/usr/local" -a "$mandir" = '${datarootdir}/man'; then
1629 if test -d "/usr/share/man/local"; then
1630 mandir="/usr/share/man/local"
1632 mandir="/usr/man/local"
1636 # IRIX <= 4 needs -lsun
1637 if test "$OSMAJOR" -le 4; then
1638 AC_CHECK_LIB(sun, getpwnam, [LIBS="${LIBS} -lsun"])
1641 : ${mansectform='4'}
1643 *-*-linux*|*-*-k*bsd*-gnu)
1644 OSDEFS="${OSDEFS} -D_GNU_SOURCE"
1645 # Some Linux versions need to link with -lshadow
1646 shadow_funcs="getspnam"
1647 shadow_libs_optional="-lshadow"
1648 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1651 OSDEFS="${OSDEFS} -D_CONVEX_SOURCE"
1652 if test -z "$GCC"; then
1653 CFLAGS="${CFLAGS} -D__STDC__"
1656 shadow_defs="-D_AUDIT -D_ACL -DSecureWare"
1657 shadow_funcs="getprpwnam"
1658 shadow_libs="-lprot"
1662 shadow_funcs="getauthuid"
1663 shadow_libs="-lauth"
1666 LIBS="${LIBS} -lsun -lbsd"
1667 CPPFLAGS="${CPPFLAGS} -I/usr/include -I/usr/include/bsd"
1668 OSDEFS="${OSDEFS} -D_MIPS"
1670 : ${mansectform='4'}
1673 OSDEFS="${OSDEFS} -D_ISC"
1675 SUDOERS_LIBS="${SUDOERS_LIBS} -lcrypt"
1677 shadow_funcs="getspnam"
1681 : ${mansectform='4'}
1684 shadow_funcs="getprpwnam"
1685 shadow_libs="-lprot -lx"
1687 : ${mansectform='4'}
1689 m88k-motorola-sysv*)
1690 # motorolla's cc (a variant of gcc) does -O but not -O2
1691 CFLAGS=`echo $CFLAGS | sed 's/-O2/-O/g'`
1693 : ${mansectform='4'}
1696 shadow_funcs="getspnam"
1699 : ${mansectform='4'}
1700 : ${with_rpath='yes'}
1702 *-ncr-sysv4*|*-ncr-sysvr4*)
1703 AC_CHECK_LIB(c89, strcasecmp, [LIBS="${LIBS} -lc89"])
1705 : ${mansectform='4'}
1706 : ${with_rpath='yes'}
1708 *-ccur-sysv4*|*-ccur-sysvr4*)
1709 LIBS="${LIBS} -lgen"
1711 : ${mansectform='4'}
1712 : ${with_rpath='yes'}
1716 # Use shlicc for BSD/OS [23].x unless asked to do otherwise
1717 if test "${with_CC+set}" != set -a "$ac_cv_prog_CC" = gcc; then
1719 2|3) AC_MSG_NOTICE([using shlicc as CC])
1720 ac_cv_prog_CC=shlicc
1725 # Check for newer BSD auth API (just check for >= 3.0?)
1726 if test -z "$with_bsdauth"; then
1727 AC_CHECK_FUNCS(auth_challenge, [AUTH_EXCL_DEF="BSD_AUTH"])
1731 # FreeBSD has a real setreuid(2) starting with 2.1 and
1732 # backported to 2.0.5. We just take 2.1 and above...
1738 if test "${with_skey-'no'}" = "yes"; then
1739 SUDOERS_LIBS="${SUDOERS_LIBS} -lmd"
1742 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1743 : ${with_logincap='maybe'}
1746 # OpenBSD has a real setreuid(2) starting with 3.3 but
1747 # we will use setreuid(2) instead.
1750 # OpenBSD >= 3.0 supports BSD auth
1751 if test -z "$with_bsdauth"; then
1756 AUTH_EXCL_DEF="BSD_AUTH"
1760 : ${with_logincap='maybe'}
1763 # NetBSD has a real setreuid(2) starting with 1.3.2
1765 0.9*|1.[012]*|1.3|1.3.1)
1770 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1771 : ${with_logincap='maybe'}
1774 if test "${with_skey-'no'}" = "yes"; then
1775 SUDOERS_LIBS="${SUDOERS_LIBS} -lmd"
1778 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1779 : ${with_logincap='yes'}
1785 # Darwin has a real setreuid(2) starting with 9.0
1786 if test $OSMAJOR -lt 9; then
1790 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1791 : ${with_logincap='yes'}
1794 # lockf() on is broken on the NeXT -- use flock instead
1796 ac_cv_func_flock=yes
1800 : ${mansectform='4'}
1801 : ${with_rpath='yes'}
1805 : ${mansectform='4'}
1808 OSDEFS="${OSDEFS} -D_GNU_SOURCE"
1813 dnl Check for mixing mutually exclusive and regular auth methods
1815 AUTH_REG=${AUTH_REG# }
1816 AUTH_EXCL=${AUTH_EXCL# }
1817 if test -n "$AUTH_EXCL"; then
1819 if test $# != 1; then
1820 AC_MSG_ERROR([More than one mutually exclusive authentication method specified: $AUTH_EXCL])
1822 if test -n "$AUTH_REG"; then
1823 AC_MSG_ERROR([Cannot mix mutually exclusive ($AUTH_EXCL) and regular ($AUTH_REG) authentication methods])
1827 dnl Only one of S/Key and OPIE may be specified
1829 if test X"${with_skey}${with_opie}" = X"yesyes"; then
1830 AC_MSG_ERROR(["cannot use both S/Key and OPIE"])
1834 dnl Use BSD-style man sections by default
1837 : ${mansectform='5'}
1840 dnl Add in any libpaths or libraries specified via configure
1842 if test -n "$with_libpath"; then
1843 for i in ${with_libpath}; do
1844 SUDO_APPEND_LIBPATH(LDFLAGS, [$i])
1847 if test -n "$with_libraries"; then
1848 for i in ${with_libraries}; do
1860 dnl C compiler checks (to be done after os checks)
1862 AC_PROG_GCC_TRADITIONAL
1865 if test X"$with_gnu_ld" != "yes" -a -n "$GCC"; then
1866 LTLDFLAGS="$LTLDFLAGS -Wc,-static-libgcc"
1872 AC_PATH_PROG([FLEX], [flex], [flex])
1875 if test -z "$with_sendmail"; then
1880 dnl Check for authpriv support in syslog
1882 AC_MSG_CHECKING(which syslog facility sudo should log with)
1883 if test X"$with_logfac" = X""; then
1884 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <syslog.h>]], [[int i = LOG_AUTHPRIV; (void)i;]])], [logfac=authpriv])
1886 AC_DEFINE_UNQUOTED(LOGFAC, "$logfac", [The syslog facility sudo will use.])
1887 AC_MSG_RESULT($logfac)
1889 dnl Header file checks
1894 AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h utmpx.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h sys/sysmacros.h)
1896 dnl Check for large file support. HP-UX 11.23 has a broken sys/type.h
1897 dnl when large files support is enabled so work around it.
1902 AC_CACHE_CHECK([whether sys/types.h needs _XOPEN_SOURCE_EXTENDED], [sudo_cv_xopen_source_extended],
1903 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
1904 #include <sys/socket.h>], [])], [sudo_cv_xopen_source_extended=no], [
1905 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#define _XOPEN_SOURCE_EXTENDED
1907 #include <sys/socket.h>], [])], [sudo_cv_xopen_source_extended=yes],
1908 [sudo_cv_xopen_source_extended=error])
1910 if test "$sudo_cv_xopen_source_extended" = "yes"; then
1911 OSDEFS="${OSDEFS} -D_XOPEN_SOURCE_EXTENDED"
1912 SUDO_DEFINE(_XOPEN_SOURCE_EXTENDED)
1916 AC_SYS_POSIX_TERMIOS
1917 if test "$ac_cv_sys_posix_termios" != "yes"; then
1918 AC_MSG_ERROR([Must have POSIX termios to build sudo])
1921 if test ${with_logincap-'no'} != "no"; then
1922 AC_CHECK_HEADERS(login_cap.h, [LOGINCAP_USAGE='[[-c class|-]] '; LCMAN=1
1925 SUDO_LIBS="${SUDO_LIBS} -lutil"
1926 SUDOERS_LIBS="${SUDOERS_LIBS} -lutil"
1931 if test ${with_project-'no'} != "no"; then
1932 AC_CHECK_HEADER(project.h, AC_DEFINE(HAVE_PROJECT_H)
1933 [SUDO_LIBS="${SUDO_LIBS} -lproject"], -)
1940 AC_CHECK_TYPE([__signed char], [], [AC_CHECK_TYPE([signed char], [AC_DEFINE(__signed, signed)], [AC_DEFINE(__signed, [])])])
1941 AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h>
1942 #include <signal.h>])
1943 AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T)], [], [#include <sys/types.h>
1944 #include <signal.h>])
1945 AC_CHECK_TYPE([struct timespec], [AC_DEFINE(HAVE_TIMESPEC)], [], [#include <sys/types.h>
1946 #if TIME_WITH_SYS_TIME
1947 # include <sys/time.h>
1950 AC_CHECK_TYPES([struct in6_addr], [AC_DEFINE(HAVE_IN6_ADDR)], [], [#include <sys/types.h>
1951 #include <netinet/in.h>])
1952 AC_TYPE_LONG_LONG_INT
1953 AC_CHECK_SIZEOF([long int])
1961 dnl Check for utmp/utmpx struct members.
1962 dnl We need to include OSDEFS for glibc which only has __e_termination
1963 dnl visible when _GNU_SOURCE is *not* defined.
1966 CFLAGS="$CFLAGS $OSDEFS"
1967 if test $ac_cv_header_utmpx_h = "yes"; then
1968 AC_CHECK_MEMBERS([struct utmpx.ut_id, struct utmpx.ut_pid, struct utmpx.ut_tv, struct utmpx.ut_type], [], [], [
1969 #include <sys/types.h>
1973 dnl Check for ut_exit.__e_termination first, then ut_exit.e_termination
1975 AC_CHECK_MEMBERS([struct utmpx.ut_exit.__e_termination], [AC_DEFINE(HAVE_STRUCT_UTMPX_UT_EXIT)], [
1976 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination], [AC_DEFINE(HAVE_STRUCT_UTMPX_UT_EXIT)], [], [
1977 #include <sys/types.h>
1981 #include <sys/types.h>
1985 AC_CHECK_MEMBERS([struct utmp.ut_id, struct utmp.ut_pid, struct utmp.ut_tv, struct utmp.ut_type, struct utmp.ut_user], [], [], [
1986 #include <sys/types.h>
1990 dnl Check for ut_exit.__e_termination first, then ut_exit.e_termination
1992 AC_CHECK_MEMBERS([struct utmp.ut_exit.__e_termination], [AC_DEFINE(HAVE_STRUCT_UTMP_UT_EXIT)], [
1993 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination], [AC_DEFINE(HAVE_STRUCT_UTMP_UT_EXIT)], [], [
1994 #include <sys/types.h>
1998 #include <sys/types.h>
2008 AC_CHECK_FUNCS(strrchr sysconf tzset strftime initgroups getgroups fstat \
2009 regcomp setlocale nl_langinfo getaddrinfo mbr_check_membership \
2011 AC_CHECK_FUNCS(getline, [], [
2013 AC_CHECK_FUNCS(fgetln)
2016 AC_CHECK_FUNCS(getutxid getutid, [utmp_style=POSIX; break])
2017 if test "$utmp_style" = "LEGACY"; then
2018 AC_CHECK_FUNCS(getttyent ttyslot, [break])
2021 AC_CHECK_FUNCS(openpty, [AC_CHECK_HEADERS(util.h pty.h, [break])], [
2022 AC_CHECK_LIB(util, openpty, [
2023 AC_CHECK_HEADERS(util.h pty.h, [break])
2024 case "$SUDO_LIBS" in
2026 *) SUDO_LIBS="${SUDO_LIBS} -lutil";;
2028 AC_DEFINE(HAVE_OPENPTY)
2030 AC_CHECK_FUNCS(_getpty, [], [
2031 AC_CHECK_FUNCS(grantpt, [
2032 AC_CHECK_FUNCS(posix_openpt)
2034 AC_CHECK_FUNCS(revoke)
2039 AC_CHECK_FUNCS(unsetenv, [SUDO_FUNC_UNSETENV_VOID], [AC_LIBOBJ(unsetenv)])
2040 if test -z "$SKIP_SETRESUID"; then
2041 AC_CHECK_FUNCS(setresuid, [
2043 AC_CHECK_FUNCS(getresuid)
2046 if test -z "$SKIP_SETREUID"; then
2047 AC_CHECK_FUNCS(setreuid, [SKIP_SETEUID=yes])
2049 if test -z "$SKIP_SETEUID"; then
2050 AC_CHECK_FUNCS(seteuid)
2052 if test X"$with_interfaces" != X"no"; then
2053 AC_CHECK_FUNCS(getifaddrs, [AC_CHECK_FUNCS(freeifaddrs)])
2055 if test -z "$BROKEN_GETCWD"; then
2056 AC_REPLACE_FUNCS(getcwd)
2058 AC_CHECK_FUNCS(glob, [AC_MSG_CHECKING(for GLOB_BRACE and GLOB_TILDE in glob.h)
2059 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <glob.h>]], [[int i = GLOB_BRACE | GLOB_TILDE; (void)i;]])], [AC_DEFINE(HAVE_EXTENDED_GLOB)
2060 AC_MSG_RESULT(yes)], [AC_LIBOBJ(glob)
2061 AC_MSG_RESULT(no)])], [AC_LIBOBJ(glob)])
2062 AC_CHECK_FUNCS(lockf flock, [break])
2063 AC_CHECK_FUNCS(innetgr _innetgr, [AC_CHECK_FUNCS(getdomainname) [break]])
2064 AC_CHECK_FUNCS(utimes, [AC_CHECK_FUNCS(futimes futimesat, [break])], [AC_CHECK_FUNCS(futime) AC_LIBOBJ(utimes)])
2065 AC_CHECK_FUNCS(killpg, [], [AC_LIBOBJ(killpg)])
2066 SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [AC_LIBOBJ(fnmatch)])
2068 AC_REPLACE_FUNCS(memrchr strlcpy strlcat setenv)
2069 AC_CHECK_FUNCS(nanosleep, [], [
2070 # On Solaris, nanosleep is in librt
2071 AC_CHECK_LIB(rt, nanosleep, [REPLAY_LIBS="${REPLAY_LIBS} -lrt"], [AC_LIBOBJ(nanosleep)])
2073 AC_CHECK_FUNCS(closefrom, [], [AC_LIBOBJ(closefrom)
2074 AC_CHECK_DECL(F_CLOSEM, AC_DEFINE(HAVE_FCNTL_CLOSEM), [],
2075 [ #include <limits.h>
2076 #include <fcntl.h> ])
2078 AC_CHECK_FUNCS(mkstemps mkdtemp, [], [
2079 AC_CHECK_FUNCS(random lrand48, [break])
2082 AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf, , [NEED_SNPRINTF=1])
2083 if test X"$ac_cv_type_struct_timespec" != X"no"; then
2084 AC_CHECK_MEMBER([struct stat.st_mtim], [AC_DEFINE(HAVE_ST_MTIM)]
2085 [AC_CHECK_MEMBER([struct stat.st_mtim.st__tim], AC_DEFINE(HAVE_ST__TIM))],
2086 [AC_CHECK_MEMBER([struct stat.st_mtimespec], AC_DEFINE([HAVE_ST_MTIMESPEC]))])
2089 dnl Check for the dirfd function/macro. If not found, look for dd_fd in DIR.
2091 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2092 #include <$ac_header_dirent>]], [[DIR *d; (void)dirfd(d);]])], [AC_DEFINE(HAVE_DIRFD)], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2093 #include <$ac_header_dirent>]], [[DIR d; memset(&d, 0, sizeof(d)); return(d.dd_fd);]])], [AC_DEFINE(HAVE_DD_FD)], [])])
2095 dnl If NEED_SNPRINTF is set, add snprintf.c to LIBOBJS
2096 dnl (it contains snprintf, vsnprintf, asprintf, and vasprintf)
2098 if test -n "$NEED_SNPRINTF"; then
2102 dnl If socket(2) not in libc, check -lsocket and -linet
2103 dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
2104 dnl In this case we look for main(), not socket() to avoid using a cached value
2106 AC_CHECK_FUNC(socket, , [AC_CHECK_LIB(socket, socket, [NET_LIBS="${NET_LIBS} -lsocket"; LIBS="${LIBS} -lsocket"], AC_CHECK_LIB(inet, socket, [NET_LIBS="${NET_LIBS} -linet"; LIBS="${LIBS} -linet"], AC_MSG_WARN(unable to find socket() trying -lsocket -lnsl)
2107 AC_CHECK_LIB(socket, socket, [NET_LIBS="${NET_LIBS} -lsocket -lnsl"; LIBS="${LIBS} -lsocket -lnsl"], , -lnsl)))])
2109 dnl If inet_addr(3) not in libc, check -lnsl and -linet
2110 dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
2112 AC_CHECK_FUNC(inet_addr, , [AC_CHECK_FUNC(__inet_addr, , AC_CHECK_LIB(nsl, inet_addr, [NET_LIBS="${NET_LIBS} -lnsl"; LIBS="${LIBS} -lnsl"], AC_CHECK_LIB(inet, inet_addr, [NET_LIBS="${NET_LIBS} -linet"; LIBS="${LIBS} -linet"], AC_MSG_WARN(unable to find inet_addr() trying -lsocket -lnsl)
2113 AC_CHECK_LIB(socket, inet_addr, [NET_LIBS="${NET_LIBS} -lsocket -lnsl"; LIBS="${LIBS} -lsocket -lnsl"], , -lnsl))))])
2115 dnl If syslog(3) not in libc, check -lsocket, -lnsl and -linet
2117 AC_CHECK_FUNC(syslog, , [AC_CHECK_LIB(socket, syslog, [NET_LIBS="${NET_LIBS} -lsocket"; LIBS="${LIBS} -lsocket"], AC_CHECK_LIB(nsl, syslog, [NET_LIBS="${NET_LIBS} -lnsl"; LIBS="${LIBS} -lnsl"], AC_CHECK_LIB(inet, syslog, [NET_LIBS="${NET_LIBS} -linet"; LIBS="${LIBS} -linet"])))])
2119 dnl Check for getprogname() or __progname
2121 AC_CHECK_FUNCS(getprogname, , [
2122 AC_MSG_CHECKING([for __progname])
2123 AC_CACHE_VAL(sudo_cv___progname, [
2124 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *__progname; (void)puts(__progname);]])], [sudo_cv___progname=yes], [sudo_cv___progname=no])])
2125 if test "$sudo_cv___progname" = "yes"; then
2126 AC_DEFINE(HAVE___PROGNAME)
2128 AC_LIBOBJ(getprogname)
2130 AC_MSG_RESULT($sudo_cv___progname)
2134 dnl Deferred zlib option processing.
2135 dnl By default we use the system zlib if it is present.
2137 case ${enable_zlib-"yes"} in
2139 AC_CHECK_LIB(z, gzdopen, [
2140 AC_CHECK_HEADERS(zlib.h, [ZLIB="-lz"], [enable_zlib=builtin])
2146 AC_DEFINE(HAVE_ZLIB_H)
2153 AC_DEFINE(HAVE_ZLIB_H)
2154 CPPFLAGS="${CPPFLAGS} -I${enable_zlib}/include"
2155 SUDO_APPEND_LIBPATH(ZLIB, [$enable_zlib/lib])
2159 if test X"$enable_zlib" = X"builtin"; then
2160 AC_DEFINE(HAVE_ZLIB_H)
2161 CPPFLAGS="${CPPFLAGS}"' -I$(top_srcdir)/zlib'
2162 ZLIB="${ZLIB}"' $(top_builddir)/zlib/libz.la'
2164 AC_CONFIG_HEADER([zlib/zconf.h])
2165 AC_CONFIG_FILES([zlib/Makefile])
2169 dnl Check for strsignal() or sys_siglist
2171 AC_CHECK_FUNCS(strsignal, [], [
2172 AC_LIBOBJ(strsignal)
2173 HAVE_SIGLIST="false"
2174 AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], [
2181 if test "$HAVE_SIGLIST" != "true"; then
2187 dnl nsswitch.conf and its equivalents
2189 if test ${with_netsvc-"no"} != "no"; then
2190 SUDO_DEFINE_UNQUOTED(_PATH_NETSVC_CONF, "${with_netsvc-/etc/netsvc.conf}")
2191 netsvc_conf=${with_netsvc-/etc/netsvc.conf}
2192 elif test ${with_nsswitch-"yes"} != "no"; then
2193 SUDO_DEFINE_UNQUOTED(_PATH_NSSWITCH_CONF, "${with_nsswitch-/etc/nsswitch.conf}")
2194 nsswitch_conf=${with_nsswitch-/etc/nsswitch.conf}
2198 dnl Mutually exclusive auth checks come first, followed by
2199 dnl non-exclusive ones. Note: passwd must be last of all!
2203 dnl Convert default authentication methods to with_* if
2204 dnl no explicit authentication scheme was specified.
2206 if test -z "${AUTH_EXCL}${AUTH_REG}" -a -n "$AUTH_EXCL_DEF"; then
2207 for auth in $AUTH_EXCL_DEF; do
2209 AIX_AUTH) with_aixauth=maybe;;
2210 BSD_AUTH) with_bsdauth=maybe;;
2211 PAM) with_pam=maybe;;
2212 SIA) CHECKSIA=true;;
2218 dnl PAM support. Systems that use PAM by default set with_pam=default
2219 dnl and we do the actual tests here.
2221 if test ${with_pam-"no"} != "no"; then
2222 # Note: we already link the main sudo program with -ldl as needed
2223 SUDOERS_LIBS="${SUDOERS_LIBS} -lpam"
2226 dnl Some PAM implementations (MacOS X for example) put the PAM headers
2227 dnl in /usr/include/pam instead of /usr/include/security...
2229 AC_CHECK_HEADERS([security/pam_appl.h] [pam/pam_appl.h], [with_pam=yes; break])
2230 if test "$with_pam" = "yes"; then
2232 AUTH_OBJS="$AUTH_OBJS pam.lo";
2235 AC_ARG_WITH(pam-login, [AS_HELP_STRING([--with-pam-login], [enable specific PAM session for sudo -i])],
2236 [case $with_pam_login in
2237 yes) AC_DEFINE([HAVE_PAM_LOGIN])
2238 AC_MSG_CHECKING(whether to use PAM login)
2242 *) AC_MSG_ERROR(["--with-pam-login does not take an argument."])
2246 AC_MSG_CHECKING(whether to use PAM session support)
2247 AC_ARG_ENABLE(pam_session,
2248 [AS_HELP_STRING([--disable-pam-session], [Disable PAM session support])],
2249 [ case "$enableval" in
2250 yes) AC_MSG_RESULT(yes)
2252 no) AC_MSG_RESULT(no)
2253 AC_DEFINE(NO_PAM_SESSION)
2255 *) AC_MSG_RESULT(no)
2256 AC_MSG_WARN([Ignoring unknown argument to --enable-pam-session: $enableval])
2258 esac], AC_MSG_RESULT(yes))
2261 *-*-linux*|*-*-solaris*)
2262 # dgettext() may be defined to dgettext_libintl in the
2263 # header file, so first check that it links w/ additional
2264 # libs, then try with -lintl
2265 AC_LINK_IFELSE([AC_LANG_PROGRAM(
2266 [[#include <libintl.h>]], [(void)dgettext((char *)0, (char *)0);])],
2267 [AC_DEFINE(HAVE_DGETTEXT)],
2268 [AC_CHECK_LIB(intl, dgettext, [LIBS="${LIBS} -lintl"]
2269 [AC_DEFINE(HAVE_DGETTEXT)])])
2276 dnl AIX general authentication
2277 dnl If set to "maybe" only enable if no other exclusive method in use.
2279 if test ${with_aixauth-'no'} != "no"; then
2280 if test X"$with_aixauth" != X"maybe" -o X"$AUTH_EXCL" = X""; then
2281 AC_MSG_NOTICE([using AIX general authentication])
2282 AC_DEFINE(HAVE_AIXAUTH)
2283 AUTH_OBJS="$AUTH_OBJS aix_auth.lo";
2284 SUDOERS_LIBS="${SUDOERS_LIBS} -ls"
2290 dnl BSD authentication
2291 dnl If set to "maybe" only enable if no other exclusive method in use.
2293 if test ${with_bsdauth-'no'} != "no"; then
2294 AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H)
2295 [AUTH_OBJS="$AUTH_OBJS bsdauth.lo"]
2296 [BSDAUTH_USAGE='[[-a auth_type]] ']
2297 [AUTH_EXCL=BSD_AUTH; BAMAN=1],
2298 [AC_MSG_ERROR([BSD authentication was specified but bsd_auth.h could not be found])])
2302 dnl SIA authentication for Tru64 Unix
2304 if test ${CHECKSIA-'false'} = "true"; then
2305 AC_CHECK_FUNCS(sia_ses_init, [found=true], [found=false])
2306 if test "$found" = "true"; then
2308 AUTH_OBJS="$AUTH_OBJS sia.lo"
2313 dnl extra FWTK libs + includes
2315 if test ${with_fwtk-'no'} != "no"; then
2316 if test "$with_fwtk" != "yes"; then
2317 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_fwtk}])
2318 CPPFLAGS="${CPPFLAGS} -I${with_fwtk}"
2321 SUDOERS_LIBS="${SUDOERS_LIBS} -lauth -lfwall"
2322 AUTH_OBJS="$AUTH_OBJS fwtk.lo"
2326 dnl extra SecurID lib + includes
2328 if test ${with_SecurID-'no'} != "no"; then
2329 if test "$with_SecurID" != "yes"; then
2331 elif test -d /usr/ace/examples; then
2332 with_SecurID=/usr/ace/examples
2334 with_SecurID=/usr/ace
2336 CPPFLAGS="${CPPFLAGS} -I${with_SecurID}"
2337 _LDFLAGS="${LDFLAGS}"
2338 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_SecurID}])
2340 # Determine whether to use the new or old SecurID API
2342 AC_CHECK_LIB(aceclnt, SD_Init,
2344 AUTH_OBJS="$AUTH_OBJS securid5.lo";
2345 SUDOERS_LIBS="${SUDOERS_LIBS} -laceclnt -lpthread"
2348 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_SecurID}])
2350 AUTH_OBJS="$AUTH_OBJS securid.lo";
2351 SUDOERS_LIBS="${SUDOERS_LIBS} ${with_SecurID}/sdiclient.a"
2357 LDFLAGS="${_LDFLAGS}"
2361 dnl Non-mutually exclusive auth checks come next.
2362 dnl Note: passwd must be last of all!
2366 dnl Convert default authentication methods to with_* if
2367 dnl no explicit authentication scheme was specified.
2369 if test -z "${AUTH_EXCL}" -a -n "$AUTH_DEF"; then
2370 for auth in $AUTH_DEF; do
2372 passwd) : ${with_passwd='maybe'};;
2380 if test ${with_kerb4-'no'} != "no"; then
2381 AC_DEFINE(HAVE_KERB4)
2383 dnl Use the specified directory, if any, else search for correct inc dir
2385 O_LDFLAGS="$LDFLAGS"
2386 if test "$with_kerb4" = "yes"; then
2388 O_CPPFLAGS="$CPPFLAGS"
2389 for dir in "" "kerberosIV/" "krb4/" "kerberos4/" "kerberosv4/"; do
2390 CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
2391 AC_PREPROC_IFELSE([#include <krb.h>], [found=yes; break])
2393 test X"$found" = X"no" && CPPFLAGS="$O_CPPFLAGS"
2395 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_kerb4}/lib])
2396 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_kerb4}/lib])
2397 CPPFLAGS="$CPPFLAGS -I${with_kerb4}/include"
2398 AC_CHECK_HEADER([krb.h], [found=yes], [found=no])
2400 if test X"$found" = X"no"; then
2401 AC_MSG_WARN([Unable to locate Kerberos IV include files, you will have to edit the Makefile and add -I/path/to/krb/includes to CPPFLAGS])
2405 dnl Check for -ldes vs. -ldes425
2407 AC_CHECK_LIB(des, des_cbc_encrypt, [K4LIBS="-ldes"], [
2408 AC_CHECK_LIB(des425, des_cbc_encrypt, [K4LIBS="-ldes425"], [K4LIBS=""])
2411 dnl Try to determine whether we have KTH or MIT/CNS Kerberos IV
2413 AC_MSG_CHECKING(whether we are using KTH Kerberos IV)
2414 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[const char *tmp = krb4_version;]])], [
2416 K4LIBS="${K4LIBS} -lcom_err"
2417 AC_CHECK_LIB(roken, main, [K4LIBS="${K4LIBS} -lroken"])
2423 dnl The actual Kerberos IV lib might be -lkrb or -lkrb4
2425 AC_CHECK_LIB(krb, main, [K4LIBS="-lkrb $K4LIBS"], [
2426 AC_CHECK_LIB(krb4, main, [K4LIBS="-lkrb4 $K4LIBS"],
2427 [K4LIBS="-lkrb $K4LIBS"]
2428 [AC_MSG_WARN([Unable to locate Kerberos IV libraries, you will have to edit the Makefile and add -L/path/to/krb/libs to SUDOERS_LDFLAGS and possibly add Kerberos libs to SUDOERS_LIBS])]
2431 LDFLAGS="$O_LDFLAGS"
2432 SUDOERS_LIBS="${SUDOERS_LIBS} $K4LIBS"
2433 AUTH_OBJS="$AUTH_OBJS kerb4.lo"
2438 dnl There is an easy way and a hard way...
2440 if test ${with_kerb5-'no'} != "no"; then
2441 AC_CHECK_PROG(KRB5CONFIG, krb5-config, yes, "")
2442 if test -n "$KRB5CONFIG"; then
2443 AC_DEFINE(HAVE_KERB5)
2444 AUTH_OBJS="$AUTH_OBJS kerb5.lo"
2445 CPPFLAGS="$CPPFLAGS `krb5-config --cflags`"
2446 SUDOERS_LIBS="$SUDOERS_LIBS `krb5-config --libs`"
2448 dnl Try to determine whether we have Heimdal or MIT Kerberos
2450 AC_MSG_CHECKING(whether we are using Heimdal)
2451 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[const char *tmp = heimdal_version;]])], [
2453 AC_DEFINE(HAVE_HEIMDAL)
2459 AC_DEFINE(HAVE_KERB5)
2461 dnl Use the specified directory, if any, else search for correct inc dir
2463 if test "$with_kerb5" = "yes"; then
2465 O_CPPFLAGS="$CPPFLAGS"
2466 for dir in "" "kerberosV/" "krb5/" "kerberos5/" "kerberosv5/"; do
2467 CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
2468 AC_PREPROC_IFELSE([#include <krb5.h>], [found=yes; break])
2470 if test X"$found" = X"no"; then
2471 CPPFLAGS="$O_CPPFLAGS"
2472 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])
2475 dnl XXX - try to include krb5.h here too
2476 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_kerb5}/lib])
2477 CPPFLAGS="$CPPFLAGS -I${with_kerb5}/include"
2481 dnl Try to determine whether we have Heimdal or MIT Kerberos
2483 AC_MSG_CHECKING(whether we are using Heimdal)
2484 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[const char *tmp = heimdal_version;]])], [
2486 AC_DEFINE(HAVE_HEIMDAL)
2487 # XXX - need to check whether -lcrypo is needed!
2488 SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5 -lcrypto -ldes -lcom_err -lasn1"
2489 AC_CHECK_LIB(roken, main, [SUDOERS_LIBS="${SUDOERS_LIBS} -lroken"])
2492 SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5 -lk5crypto -lcom_err"
2493 AC_CHECK_LIB(krb5support, main, [SUDOERS_LIBS="${SUDOERS_LIBS} -lkrb5support"])
2495 AUTH_OBJS="$AUTH_OBJS kerb5.lo"
2498 LIBS="${LIBS} ${SUDOERS_LIBS}"
2499 AC_CHECK_FUNCS(krb5_verify_user krb5_init_secure_context)
2500 AC_CHECK_FUNCS(krb5_get_init_creds_opt_alloc, [
2501 AC_CACHE_CHECK([whether krb5_get_init_creds_opt_free takes a context],
2502 sudo_cv_krb5_get_init_creds_opt_free_two_args, [
2505 [[#include <krb5.h>]],
2506 [[krb5_get_init_creds_opt_free(NULL, NULL);]]
2508 [sudo_cv_krb5_get_init_creds_opt_free_two_args=yes],
2509 [sudo_cv_krb5_get_init_creds_opt_free_two_args=no]
2514 if test X"$sudo_cv_krb5_get_init_creds_opt_free_two_args" = X"yes"; then
2515 AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS)
2521 dnl extra AFS libs and includes
2523 if test ${with_AFS-'no'} = "yes"; then
2525 # looks like the "standard" place for AFS libs is /usr/afsws/lib
2526 AFSLIBDIRS="/usr/lib/afs /usr/afsws/lib /usr/afsws/lib/afs"
2527 for i in $AFSLIBDIRS; do
2528 if test -d ${i}; then
2529 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [$i])
2530 FOUND_AFSLIBDIR=true
2533 if test -z "$FOUND_AFSLIBDIR"; then
2534 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.])
2537 # Order is important here. Note that we build AFS_LIBS from right to left
2538 # since AFS_LIBS may be initialized with BSD compat libs that must go last
2539 AFS_LIBS="-laudit ${AFS_LIBS}"
2540 for i in $AFSLIBDIRS; do
2541 if test -f ${i}/util.a; then
2542 AFS_LIBS="${i}/util.a ${AFS_LIBS}"
2547 if test -z "$FOUND_UTIL_A"; then
2548 AFS_LIBS="-lutil ${AFS_LIBS}"
2550 AFS_LIBS="-lkauth -lprot -lubik -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err ${AFS_LIBS}"
2552 # AFS includes may live in /usr/include on some machines...
2553 for i in /usr/afsws/include; do
2554 if test -d ${i}; then
2555 CPPFLAGS="${CPPFLAGS} -I${i}"
2556 FOUND_AFSINCDIR=true
2560 if test -z "$FOUND_AFSLIBDIR"; then
2561 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.])
2564 AUTH_OBJS="$AUTH_OBJS afs.lo"
2568 dnl extra DCE obj + lib
2569 dnl Order of libs in HP-UX 10.x is important, -ldce must be last.
2571 if test ${with_DCE-'no'} = "yes"; then
2572 DCE_OBJS="${DCE_OBJS} dce_pwent.o"
2573 SUDOERS_LIBS="${SUDOERS_LIBS} -ldce"
2574 AUTH_OBJS="$AUTH_OBJS dce.lo"
2578 dnl extra S/Key lib and includes
2580 if test "${with_skey-'no'}" = "yes"; then
2581 O_LDFLAGS="$LDFLAGS"
2582 if test "$with_skey" != "yes"; then
2583 CPPFLAGS="${CPPFLAGS} -I${with_skey}/include"
2584 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_skey}/lib])
2585 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_skey}/lib])
2586 AC_CHECK_HEADER([skey.h], [found=yes], [found=no], [#include <stdio.h>])
2589 O_CPPFLAGS="$CPPFLAGS"
2590 for dir in "" "/usr/local" "/usr/contrib"; do
2591 test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include"
2592 AC_CHECK_HEADER([skey.h], [found=yes; break], [],
2593 [#include <stdio.h>])
2595 if test "$found" = "no" -o -z "$dir"; then
2596 CPPFLAGS="$O_CPPFLAGS"
2598 SUDO_APPEND_LIBPATH(LDFLAGS, [${dir}/lib])
2599 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${dir}/lib])
2601 if test "$found" = "no"; then
2602 AC_MSG_WARN([Unable to locate skey.h, you will have to edit the Makefile and add -I/path/to/skey/includes to CPPFLAGS])
2605 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])])
2606 AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS))
2608 AC_MSG_CHECKING([for RFC1938-compliant skeychallenge])
2611 [[#include <stdio.h>
2612 #include <skey.h>]],
2613 [[skeychallenge(NULL, NULL, NULL, 0);]]
2615 AC_DEFINE(HAVE_RFC1938_SKEYCHALLENGE)
2616 AC_MSG_RESULT([yes])
2622 LDFLAGS="$O_LDFLAGS"
2623 SUDOERS_LIBS="${SUDOERS_LIBS} -lskey"
2624 AUTH_OBJS="$AUTH_OBJS rfc1938.lo"
2628 dnl extra OPIE lib and includes
2630 if test "${with_opie-'no'}" = "yes"; then
2631 O_LDFLAGS="$LDFLAGS"
2632 if test "$with_opie" != "yes"; then
2633 CPPFLAGS="${CPPFLAGS} -I${with_opie}/include"
2634 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_opie}/lib])
2635 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_opie}/lib])
2636 AC_PREPROC_IFELSE([#include <opie.h>], [found=yes], [found=no])
2639 O_CPPFLAGS="$CPPFLAGS"
2640 for dir in "" "/usr/local" "/usr/contrib"; do
2641 test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include"
2642 AC_PREPROC_IFELSE([#include <opie.h>], [found=yes; break])
2644 if test "$found" = "no" -o -z "$dir"; then
2645 CPPFLAGS="$O_CPPFLAGS"
2647 SUDO_APPEND_LIBPATH(LDFLAGS, [${dir}/lib])
2648 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${dir}/lib])
2650 if test "$found" = "no"; then
2651 AC_MSG_WARN([Unable to locate opie.h, you will have to edit the Makefile and add -I/path/to/opie/includes to CPPFLAGS])
2654 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])])
2655 LDFLAGS="$O_LDFLAGS"
2656 SUDOERS_LIBS="${SUDOERS_LIBS} -lopie"
2657 AUTH_OBJS="$AUTH_OBJS rfc1938.lo"
2661 dnl Check for shadow password routines if we have not already done so.
2662 dnl If there is a specific list of functions to check we do that first.
2663 dnl Otherwise, we check for SVR4-style and then SecureWare-style.
2665 if test ${with_passwd-'no'} != "no"; then
2667 dnl if crypt(3) not in libc, look elsewhere
2669 if test -z "$LIB_CRYPT"; then
2671 AC_SEARCH_LIBS([crypt], [crypt crypt_d ufc], [test -n "$ac_lib" && SUDOERS_LIBS="${SUDOERS_LIBS} $ac_res"])
2675 if test "$CHECKSHADOW" = "true" -a -n "$shadow_funcs"; then
2677 LIBS="$LIBS $shadow_libs"
2679 AC_CHECK_FUNCS($shadow_funcs, [found=yes])
2680 if test "$found" = "yes"; then
2681 SUDOERS_LIBS="$SUDOERS_LIBS $shadow_libs"
2682 elif test -n "$shadow_libs_optional"; then
2683 LIBS="$LIBS $shadow_libs_optional"
2684 AC_CHECK_FUNCS($shadow_funcs, [found=yes])
2685 if test "$found" = "yes"; then
2686 SUDOERS_LIBS="$SUDOERS_LIBS $shadow_libs $shadow_libs_optional"
2689 if test "$found" = "yes"; then
2690 case "$shadow_funcs" in
2691 *getprpwnam*) SECUREWARE=1;;
2693 test -n "$shadow_defs" && OSDEFS="${OSDEFS} $shadow_defs"
2699 if test "$CHECKSHADOW" = "true"; then
2700 AC_SEARCH_LIBS([getspnam], [gen], [AC_DEFINE(HAVE_GETSPNAM)] [CHECKSHADOW=false; test -n "$ac_lib" && SUDOERS_LIBS="${SUDOERS_LIBS} $ac_res"])
2702 if test "$CHECKSHADOW" = "true"; then
2703 AC_SEARCH_LIBS([getprpwnam], [sec security prot], [AC_DEFINE(HAVE_GETPRPWNAM)] [CHECKSHADOW=false; SECUREWARE=1; test -n "$ac_lib" && SUDOERS_LIBS="${SUDOERS_LIBS} $ac_res"])
2705 if test -n "$SECUREWARE"; then
2706 AC_CHECK_FUNCS(bigcrypt set_auth_parameters initprivs)
2707 AUTH_OBJS="$AUTH_OBJS secureware.lo"
2712 dnl extra lib and .o file for LDAP support
2714 if test ${with_ldap-'no'} != "no"; then
2716 if test "$with_ldap" != "yes"; then
2717 SUDO_APPEND_LIBPATH(SUDOERS_LDFLAGS, [${with_ldap}/lib])
2718 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_ldap}/lib])
2719 CPPFLAGS="${CPPFLAGS} -I${with_ldap}/include"
2722 SUDOERS_OBJS="${SUDOERS_OBJS} ldap.lo"
2725 AC_MSG_CHECKING([for LDAP libraries])
2729 for l in -lldap -llber '-lssl -lcrypto'; do
2731 LDAP_LIBS="${LDAP_LIBS} $l"
2732 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2734 #include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [found=yes; break])
2736 dnl if nothing linked just try with -lldap
2737 if test "$found" = "no"; then
2738 LIBS="${_LIBS} -lldap"
2740 AC_MSG_RESULT([not found, using -lldap])
2742 AC_MSG_RESULT([$LDAP_LIBS])
2744 dnl check if we need to link with -llber for ber_set_option
2746 AC_SEARCH_LIBS([ber_set_option], [lber], [found=yes], [found=no])
2747 if test X"$found" = X"yes" -a X"$LIBS" != X"$OLIBS"; then
2748 LDAP_LIBS="$LDAP_LIBS -llber"
2750 dnl check if ldap.h includes lber.h for us
2751 AC_MSG_CHECKING([whether lber.h is needed])
2752 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2753 #include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [AC_MSG_RESULT([no])], [
2754 AC_MSG_RESULT([yes])
2755 AC_DEFINE(HAVE_LBER_H)])
2757 AC_CHECK_HEADERS([sasl/sasl.h] [sasl.h], [AC_CHECK_FUNCS(ldap_sasl_interactive_bind_s)], [break])
2758 AC_CHECK_HEADERS([ldap_ssl.h] [mps/ldap_ssl.h], [break], [], [#include <ldap.h>])
2759 AC_CHECK_FUNCS(ldap_initialize ldap_start_tls_s ldapssl_init ldapssl_set_strength ldap_unbind_ext_s ldap_str2dn ldap_create ldap_sasl_bind_s ldap_ssl_client_init ldap_start_tls_s_np)
2760 AC_CHECK_FUNCS(ldap_search_ext_s ldap_search_st, [break])
2762 if test X"$check_gss_krb5_ccache_name" = X"yes"; then
2763 AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,
2764 AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME)
2765 [LDAP_LIBS="${LDAP_LIBS} -lgssapi"],
2766 AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,
2767 AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME)
2768 [LDAP_LIBS="${LDAP_LIBS} -lgssapi_krb5"])
2771 # gssapi headers may be separate or part of Kerberos V
2773 O_CPPFLAGS="$CPPFLAGS"
2774 for dir in "" "kerberosV" "krb5" "kerberos5" "kerberosv5"; do
2775 test X"$dir" != X"" && CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
2776 AC_PREPROC_IFELSE([#include <gssapi/gssapi.h>], [found="gssapi/gssapi.h"; break], [AC_PREPROC_IFELSE([#include <gssapi.h>], [found="gssapi.h"; break])])
2778 if test X"$found" != X"no"; then
2779 AC_CHECK_HEADERS([$found])
2780 if test X"$found" = X"gssapi/gssapi.h"; then
2781 AC_CHECK_HEADERS([gssapi/gssapi_krb5.h])
2784 CPPFLAGS="$O_CPPFLAGS"
2785 AC_MSG_WARN([Unable to locate gssapi.h, you will have to edit the Makefile and add -I/path/to/gssapi/includes to CPPFLAGS])
2789 SUDOERS_LIBS="${SUDOERS_LIBS} ${LDAP_LIBS}"
2795 # How to do dynamic object loading.
2796 # We support dlopen() and sh_load(), else fall back to static loading.
2798 case "$lt_cv_dlopen" in
2800 AC_DEFINE(HAVE_DLOPEN)
2801 SUDOERS_OBJS="$SUDOERS_OBJS plugin_error.lo"
2802 LT_STATIC="--tag=disable-static"
2805 AC_DEFINE(HAVE_SHL_LOAD)
2806 SUDOERS_OBJS="$SUDOERS_OBJS plugin_error.lo"
2807 LT_STATIC="--tag=disable-static"
2811 # Preload sudoers module symbols
2812 SUDO_OBJS="${SUDO_OBJS} preload.o"
2813 SUDO_LIBS="${SUDO_LIBS} \$(top_builddir)/plugins/sudoers/sudoers.la"
2820 # Add library needed for dynamic loading, if any.
2822 LIBDL="$lt_cv_dlopen_libs"
2823 if test X"$LIBDL" != X""; then
2824 SUDO_LIBS="${SUDO_LIBS} $LIBDL"
2825 SUDOERS_LIBS="${SUDOERS_LIBS} $LIBDL"
2828 # On HP-UX, you cannot dlopen() a shared object that uses pthreads
2829 # unless the main program is linked against -lpthread. Since we
2830 # have no knowledge what libraries a plugin may depend on, we always
2831 # link against -lpthread on HP-UX if it is available.
2832 # This check should go after all other libraries tests.
2835 AC_CHECK_LIB(pthread, main, [SUDO_LIBS="${SUDO_LIBS} -lpthread"])
2840 dnl Add $blibpath to SUDOERS_LDFLAGS if specified by the user or if we
2841 dnl added -L dirpaths to SUDOERS_LDFLAGS.
2843 if test -n "$blibpath"; then
2844 if test -n "$blibpath_add"; then
2845 SUDOERS_LDFLAGS="$SUDOERS_LDFLAGS -Wl,-blibpath:${blibpath}${blibpath_add}"
2846 elif test -n "$with_blibpath" -a "$with_blibpath" != "yes"; then
2847 SUDOERS_LDFLAGS="$SUDOERS_LDFLAGS -Wl,-blibpath:${blibpath}"
2852 dnl Check for log file, timestamp and iolog locations
2854 if test "$utmp_style" = "LEGACY"; then
2862 dnl Use passwd auth module?
2864 case "$with_passwd" in
2866 AUTH_OBJS="$AUTH_OBJS getspwuid.lo passwd.lo"
2869 AC_DEFINE(WITHOUT_PASSWD)
2870 if test -z "$AUTH_OBJS"; then
2871 AC_MSG_ERROR([no authentication methods defined.])
2875 AUTH_OBJS=${AUTH_OBJS# }
2876 _AUTH=`echo "$AUTH_OBJS" | sed -e 's/\.lo//g' -e 's/getspwuid *//'`
2877 AC_MSG_NOTICE([using the following authentication methods: $_AUTH])
2880 dnl LIBS may contain duplicates from SUDO_LIBS, SUDOERS_LIBS, or NET_LIBS
2882 if test -n "$LIBS"; then
2887 for sl in ${SUDO_LIBS} ${SUDOERS_LIBS} ${NET_LIBS}; do
2888 test $l = $sl && dupe=1
2890 test $dupe = 0 && LIBS="${LIBS} $l"
2897 test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
2900 dnl Defer setting _PATH_SUDO_NOEXEC until after exec_prefix is set
2901 dnl XXX - this is gross!
2903 if test X"$with_noexec" != X"no" -o X"$with_selinux" != X"no"; then
2904 oexec_prefix="$exec_prefix"
2905 if test "$exec_prefix" = '$(prefix)'; then
2906 if test "$prefix" = "NONE"; then
2907 exec_prefix="$ac_default_prefix"
2909 exec_prefix="$prefix"
2912 if test X"$with_noexec" != X"no"; then
2913 PROGS="${PROGS} libsudo_noexec.la"
2914 INSTALL_NOEXEC="install-noexec"
2916 eval noexec_file="$with_noexec"
2917 SUDO_DEFINE_UNQUOTED(_PATH_SUDO_NOEXEC, "$noexec_file", [The fully qualified pathname of sudo_noexec.so])
2919 if test X"$with_selinux" != X"no"; then
2920 eval sesh_file="$libexecdir/sesh"
2921 SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SESH, "$sesh_file", [The fully qualified pathname of sesh])
2923 eval PLUGINDIR="$with_plugindir"
2924 SUDO_DEFINE_UNQUOTED(_PATH_SUDO_PLUGIN_DIR, "$PLUGINDIR/")
2925 SUDO_DEFINE_UNQUOTED(SUDOERS_PLUGIN, "sudoers${SOEXT}")
2926 exec_prefix="$oexec_prefix"
2930 dnl Override default configure dirs for the Makefile
2932 if test X"$prefix" = X"NONE"; then
2933 test "$mandir" = '${datarootdir}/man' && mandir='$(prefix)/man'
2935 test "$mandir" = '${datarootdir}/man' && mandir='$(datarootdir)/man'
2937 test "$bindir" = '${exec_prefix}/bin' && bindir='$(exec_prefix)/bin'
2938 test "$sbindir" = '${exec_prefix}/sbin' && sbindir='$(exec_prefix)/sbin'
2939 test "$libexecdir" = '${exec_prefix}/libexec' && libexecdir='$(exec_prefix)/libexec'
2940 test "$includedir" = '${prefix}/include' && includedir='$(prefix)/include'
2941 test "$datarootdir" = '${prefix}/share' && datarootdir='$(prefix)/share'
2942 test "$docdir" = '${datarootdir}/doc/${PACKAGE_TARNAME}' && docdir='$(datarootdir)/doc/$(PACKAGE_TARNAME)'
2943 test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc'
2946 dnl Substitute into the Makefile and man pages
2948 dnl AC_CONFIG_FILES([doc/sudo.man doc/visudo.man doc/sudoers.man doc/sudoers.ldap.man doc/sudoreplay.man src/Makefile src/sudo_usage.h])
2949 AC_CONFIG_FILES([Makefile common/Makefile compat/Makefile doc/Makefile include/Makefile src/sudo_usage.h src/Makefile plugins/sample/Makefile plugins/sample_group/Makefile plugins/sudoers/Makefile plugins/sudoers/sudoers])
2953 dnl Spew any text the user needs to know about
2955 if test "$with_pam" = "yes"; then
2958 AC_MSG_NOTICE([You will need to customize sample.pam and install it as /etc/pam.d/sudo])
2964 dnl Autoheader templates
2966 AH_TEMPLATE(BROKEN_SYSLOG, [Define to 1 if the `syslog' function returns a non-zero int to denote failure.])
2967 AH_TEMPLATE(CLASSIC_INSULTS, [Define to 1 if you want the insults from the "classic" version sudo.])
2968 AH_TEMPLATE(CSOPS_INSULTS, [Define to 1 if you want insults culled from the twisted minds of CSOps.])
2969 AH_TEMPLATE(SUDOERS_PLUGIN, [The name of the sudoers plugin, including extension.])
2970 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.])
2971 AH_TEMPLATE(ENV_DEBUG, [Define to 1 to enable environment function debugging.])
2972 AH_TEMPLATE(ENV_EDITOR, [Define to 1 if you want visudo to honor the EDITOR and VISUAL env variables.])
2973 AH_TEMPLATE(FQDN, [Define to 1 if you want to require fully qualified hosts in sudoers.])
2974 AH_TEMPLATE(ENV_RESET, [Define to 1 to enable environment resetting by default.])
2975 AH_TEMPLATE(GOONS_INSULTS, [Define to 1 if you want insults from the "Goon Show".])
2976 AH_TEMPLATE(HAL_INSULTS, [Define to 1 if you want 2001-like insults.])
2977 AH_TEMPLATE(HAVE_AFS, [Define to 1 if you use AFS.])
2978 AH_TEMPLATE(HAVE_AIXAUTH, [Define to 1 if you use AIX general authentication.])
2979 AH_TEMPLATE(HAVE_BSD_AUTH_H, [Define to 1 if you use BSD authentication.])
2980 AH_TEMPLATE(HAVE_BSM_AUDIT, [Define to 1 to enable BSM audit support.])
2981 AH_TEMPLATE(HAVE_DCE, [Define to 1 if you use OSF DCE.])
2982 AH_TEMPLATE(HAVE_DD_FD, [Define to 1 if your `DIR' contains dd_fd.])
2983 AH_TEMPLATE(HAVE_DIRFD, [Define to 1 if you have the `dirfd' function or macro.])
2984 AH_TEMPLATE(HAVE_DGETTEXT, [Define to 1 if you have the `dgettext' function.])
2985 AH_TEMPLATE(HAVE_DISPCRYPT, [Define to 1 if you have the `dispcrypt' function.])
2986 AH_TEMPLATE(HAVE_DLOPEN, [Define to 1 if you have the `dlopen' function.])
2987 AH_TEMPLATE(HAVE_EXTENDED_GLOB, [Define to 1 if your glob.h defines the GLOB_BRACE and GLOB_TILDE flags.])
2988 AH_TEMPLATE(HAVE_FCNTL_CLOSEM, [Define to 1 if your system has the F_CLOSEM fcntl.])
2989 AH_TEMPLATE(HAVE_FNMATCH, [Define to 1 if you have the `fnmatch' function.])
2990 AH_TEMPLATE(HAVE_FWTK, [Define to 1 if you use the FWTK authsrv daemon.])
2991 AH_TEMPLATE(HAVE_GETAUTHUID, [Define to 1 if you have the `getauthuid' function. (ULTRIX 4.x shadow passwords)])
2992 AH_TEMPLATE(HAVE_GETPRPWNAM, [Define to 1 if you have the `getprpwnam' function. (SecureWare-style shadow passwords)])
2993 AH_TEMPLATE(HAVE_GETPWANAM, [Define to 1 if you have the `getpwanam' function. (SunOS 4.x shadow passwords)])
2994 AH_TEMPLATE(HAVE_GETSPNAM, [Define to 1 if you have the `getspnam' function (SVR4-style shadow passwords)])
2995 AH_TEMPLATE(HAVE_GETSPWUID, [Define to 1 if you have the `getspwuid' function. (HP-UX <= 9.X shadow passwords)])
2996 AH_TEMPLATE(HAVE_GSS_KRB5_CCACHE_NAME, [Define to 1 if you have the `gss_krb5_ccache_name' function.])
2997 AH_TEMPLATE(HAVE_HEIMDAL, [Define to 1 if your Kerberos is Heimdal.])
2998 AH_TEMPLATE(HAVE_IN6_ADDR, [Define to 1 if <netinet/in.h> contains struct in6_addr.])
2999 AH_TEMPLATE(HAVE_ISCOMSEC, [Define to 1 if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled)])
3000 AH_TEMPLATE(HAVE_ISSECURE, [Define to 1 if you have the `issecure' function. (SunOS 4.x check for shadow enabled)])
3001 AH_TEMPLATE(HAVE_KERB4, [Define to 1 if you use Kerberos IV.])
3002 AH_TEMPLATE(HAVE_KERB5, [Define to 1 if you use Kerberos V.])
3003 AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC, [Define to 1 if you have the `krb5_get_init_creds_opt_alloc' function.])
3004 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.])
3005 AH_TEMPLATE(HAVE_KRB5_INIT_SECURE_CONTEXT, [Define to 1 if you have the `krb5_init_secure_context' function.])
3006 AH_TEMPLATE(HAVE_KRB5_VERIFY_USER, [Define to 1 if you have the `krb5_verify_user' function.])
3007 AH_TEMPLATE(HAVE_LBER_H, [Define to 1 if your LDAP needs <lber.h>. (OpenLDAP does not)])
3008 AH_TEMPLATE(HAVE_LDAP, [Define to 1 if you use LDAP for sudoers.])
3009 AH_TEMPLATE(HAVE_LINUX_AUDIT, [Define to 1 to enable Linux audit support.])
3010 AH_TEMPLATE(HAVE_OPIE, [Define to 1 if you use NRL OPIE.])
3011 AH_TEMPLATE(HAVE_PAM, [Define to 1 if you use PAM authentication.])
3012 AH_TEMPLATE(HAVE_PAM_LOGIN, [Define to 1 if you use a specific PAM session for sudo -i.])
3013 AH_TEMPLATE(HAVE_PROJECT_H, [Define to 1 if you have the <project.h> header file.])
3014 AH_TEMPLATE(HAVE_SECURID, [Define to 1 if you use SecurID for authentication.])
3015 AH_TEMPLATE(HAVE_SELINUX, [Define to 1 to enable SELinux RBAC support.])
3016 AH_TEMPLATE(HAVE_SETKEYCREATECON, [Define to 1 if you have the `setkeycreatecon' function.])
3017 AH_TEMPLATE(HAVE_SHL_LOAD, [Define to 1 if you have the `shl_load' function.])
3018 AH_TEMPLATE(HAVE_SIGACTION_T, [Define to 1 if <signal.h> has the sigaction_t typedef.])
3019 AH_TEMPLATE(HAVE_SKEY, [Define to 1 if you use S/Key.])
3020 AH_TEMPLATE(HAVE_SKEYACCESS, [Define to 1 if your S/Key library has skeyaccess().])
3021 AH_TEMPLATE(HAVE_RFC1938_SKEYCHALLENGE, [Define to 1 if the skeychallenge() function is RFC1938-compliant and takes 4 arguments])
3022 AH_TEMPLATE(HAVE_ST__TIM, [Define to 1 if your struct stat uses an st__tim union])
3023 AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member])
3024 AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member])
3025 AH_TEMPLATE(HAVE_TIMESPEC, [Define to 1 if you have struct timespec in sys/time.h])
3026 AH_TEMPLATE(HAVE___PROGNAME, [Define to 1 if your crt0.o defines the __progname symbol for you.])
3027 AH_TEMPLATE(HOST_IN_LOG, [Define to 1 if you want the hostname to be entered into the log file.])
3028 AH_TEMPLATE(IGNORE_DOT_PATH, [Define to 1 if you want to ignore '.' and empty PATH elements])
3029 AH_TEMPLATE(LOGGING, [Define to SLOG_SYSLOG, SLOG_FILE, or SLOG_BOTH.])
3030 AH_TEMPLATE(LONG_OTP_PROMPT, [Define to 1 if you want a two line OTP (S/Key or OPIE) prompt.])
3031 AH_TEMPLATE(NO_AUTHENTICATION, [Define to 1 if you don't want sudo to prompt for a password by default.])
3032 AH_TEMPLATE(NO_LECTURE, [Define to 1 if you don't want users to get the lecture the first they user sudo.])
3033 AH_TEMPLATE(NO_PAM_SESSION, [Define to 1 if you don't want to use sudo's PAM session support])
3034 AH_TEMPLATE(NO_ROOT_MAILER, [Define to avoid runing the mailer as root.])
3035 AH_TEMPLATE(NO_ROOT_SUDO, [Define to 1 if root should not be allowed to use sudo.])
3036 AH_TEMPLATE(NO_TTY_TICKETS, [Define to 1 if you want a single ticket file instead of per-tty files.])
3037 AH_TEMPLATE(PC_INSULTS, [Define to 1 to replace politically incorrect insults with less offensive ones.])
3038 AH_TEMPLATE(SECURE_PATH, [Define to 1 to override the user's path with a built-in one.])
3039 AH_TEMPLATE(SEND_MAIL_WHEN_NOT_OK, [Define to 1 to send mail when the user is not allowed to run a command.])
3040 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.])
3041 AH_TEMPLATE(SEND_MAIL_WHEN_NO_USER, [Define to 1 to send mail when the user is not in the sudoers file.])
3042 AH_TEMPLATE(SHELL_IF_NO_ARGS, [Define to 1 if you want sudo to start a shell if given no arguments.])
3043 AH_TEMPLATE(SHELL_SETS_HOME, [Define to 1 if you want sudo to set $HOME in shell mode.])
3044 AH_TEMPLATE(STUB_LOAD_INTERFACES, [Define to 1 if the code in interfaces.c does not compile for you.])
3045 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.])
3046 AH_TEMPLATE(USE_ADMIN_FLAG, [Define to 1 if you want to create ~/.sudo_as_admin_successful if the user is in the admin group the first time they run sudo.])
3047 AH_TEMPLATE(USE_INSULTS, [Define to 1 if you want to insult the user for entering an incorrect password.])
3048 AH_TEMPLATE(USE_STOW, [Define to 1 if you use GNU stow packaging.])
3049 AH_TEMPLATE(WITHOUT_PASSWD, [Define to avoid using the passwd/shadow file for authentication.])
3050 AH_TEMPLATE(sig_atomic_t, [Define to `int' if <signal.h> does not define.])
3051 AH_TEMPLATE(__signed, [Define to `signed' or nothing if compiler does not support a signed type qualifier.])
3052 AH_TEMPLATE(HAVE_STRUCT_UTMP_UT_EXIT, [Define to 1 if `ut_exit' is a member of `struct utmp'.])
3053 AH_TEMPLATE(HAVE_STRUCT_UTMPX_UT_EXIT, [Define to 1 if `ut_exit' is a member of `struct utmpx'.])
3056 dnl Bits to copy verbatim into config.h.in
3058 AH_TOP([#ifndef _SUDO_CONFIG_H
3059 #define _SUDO_CONFIG_H])
3062 * Macros to convert ctime and mtime into timevals.
3064 #define timespec2timeval(_ts, _tv) do { \
3065 (_tv)->tv_sec = (_ts)->tv_sec; \
3066 (_tv)->tv_usec = (_ts)->tv_nsec / 1000; \
3070 # ifdef HAVE_ST__TIM
3071 # define ctim_get(_x, _y) timespec2timeval(&(_x)->st_ctim.st__tim, (_y))
3072 # define mtim_get(_x, _y) timespec2timeval(&(_x)->st_mtim.st__tim, (_y))
3074 # define ctim_get(_x, _y) timespec2timeval(&(_x)->st_ctim, (_y))
3075 # define mtim_get(_x, _y) timespec2timeval(&(_x)->st_mtim, (_y))
3078 # ifdef HAVE_ST_MTIMESPEC
3079 # define ctim_get(_x, _y) timespec2timeval(&(_x)->st_ctimespec, (_y))
3080 # define mtim_get(_x, _y) timespec2timeval(&(_x)->st_mtimespec, (_y))
3082 # define ctim_get(_x, _y) do { (_y)->tv_sec = (_x)->st_ctime; (_y)->tv_usec = 0; } while (0)
3083 # define mtim_get(_x, _y) do { (_y)->tv_sec = (_x)->st_mtime; (_y)->tv_usec = 0; } while (0)
3084 # endif /* HAVE_ST_MTIMESPEC */
3085 #endif /* HAVE_ST_MTIM */
3087 /* GNU stow needs /etc/sudoers to be a symlink. */
3089 # define stat_sudoers stat
3091 # define stat_sudoers lstat
3094 /* Macros to set/clear/test flags. */
3096 #define SET(t, f) ((t) |= (f))
3098 #define CLR(t, f) ((t) &= ~(f))
3100 #define ISSET(t, f) ((t) & (f))
3102 /* New ANSI-style OS defs for HP-UX and ConvexOS. */
3103 #if defined(hpux) && !defined(__hpux)
3107 #if defined(convex) && !defined(__convex__)
3108 # define __convex__ 1
3111 /* BSD compatibility on some SVR4 systems. */
3114 #endif /* __svr4__ */
3116 #endif /* _SUDO_CONFIG_H */])