2 dnl Process this file with GNU autoconf to produce a configure script.
3 dnl $Sudo: configure.in,v 1.538 2008/12/09 21:13:01 millert Exp $
5 dnl Copyright (c) 1994-1996,1998-2008 Todd C. Miller <Todd.Miller@courtesan.com>
8 AC_CONFIG_HEADER(config.h pathnames.h)
10 dnl This won't work before AC_INIT
12 AC_MSG_NOTICE([Configuring Sudo version 1.7])
14 dnl Variables that get substituted in the Makefile and man pages
21 AC_SUBST(SUDO_LDFLAGS)
27 AC_SUBST(GETGROUPS_LIB)
31 AC_SUBST(MAN_POSTINSTALL)
32 AC_SUBST(SUDOERS_MODE)
47 AC_SUBST(INSTALL_NOEXEC)
48 AC_SUBST(DONT_LEAK_PATH_INFO)
49 AC_SUBST(BSDAUTH_USAGE)
50 AC_SUBST(SELINUX_USAGE)
52 AC_SUBST(LOGINCAP_USAGE)
54 dnl Variables that get substituted in docs (not overridden by environment)
56 AC_SUBST(timedir)dnl initial value from SUDO_TIMEDIR
58 AC_SUBST(password_timeout)
61 AC_SUBST(long_otp_prompt)
68 AC_SUBST(mail_no_user)
69 AC_SUBST(mail_no_host)
70 AC_SUBST(mail_no_perms)
73 AC_SUBST(badpass_message)
75 AC_SUBST(runas_default)
77 AC_SUBST(passwd_tries)
84 AC_SUBST(nsswitch_conf)
86 dnl Initial values for above
91 passprompt="Password:"
103 mailsub='*** SECURITY information for %h ***'
104 badpass_message='Sorry, try again.'
116 dnl Initial values for Makefile variables listed above
117 dnl May be overridden by environment variables..
122 : ${SUDOERS_MODE='0440'}
144 shadow_libs_optional=
147 dnl Override default configure dirs...
149 if test X"$prefix" = X"NONE"; then
150 test "$mandir" = '${datarootdir}/man' && mandir='$(prefix)/man'
152 test "$mandir" = '${datarootdir}/man' && mandir='$(datarootdir)/man'
154 test "$bindir" = '${exec_prefix}/bin' && bindir='$(exec_prefix)/bin'
155 test "$sbindir" = '${exec_prefix}/sbin' && sbindir='$(exec_prefix)/sbin'
156 test "$sysconfdir" = '${prefix}/etc' -a X"$with_stow" != X"yes" && sysconfdir='/etc'
159 dnl Deprecated --with options (these all warn or generate an error)
162 AC_ARG_WITH(otp-only, [ --with-otp-only deprecated],
163 [case $with_otp_only in
164 yes) with_passwd="no"
165 AC_MSG_NOTICE([--with-otp-only option deprecated, treating as --without-passwd])
169 AC_ARG_WITH(alertmail, [ --with-alertmail deprecated],
170 [case $with_alertmail in
171 *) with_mailto="$with_alertmail"
172 AC_MSG_NOTICE([--with-alertmail option deprecated, treating as --mailto])
177 dnl Options for --with
180 AC_ARG_WITH(CC, [ --with-CC C compiler to use],
182 yes) AC_MSG_ERROR(["must give --with-CC an argument."])
184 no) AC_MSG_ERROR(["illegal argument: --without-CC."])
190 AC_ARG_WITH(rpath, [ --with-rpath pass -R flag in addition to -L for lib paths],
193 *) AC_MSG_ERROR(["--with-rpath does not take an argument."])
197 AC_ARG_WITH(blibpath, [ --with-blibpath[=PATH] pass -blibpath flag to ld for additional lib paths],
198 [case $with_blibpath in
200 *) AC_MSG_NOTICE([will pass -blibpath:${with_blibpath} to the loader.])
204 AC_ARG_WITH(incpath, [ --with-incpath additional places to look for include files],
205 [case $with_incpath in
206 yes) AC_MSG_ERROR(["must give --with-incpath an argument."])
208 no) AC_MSG_ERROR(["--without-incpath not supported."])
210 *) AC_MSG_NOTICE([Adding ${with_incpath} to CPPFLAGS])
211 for i in ${with_incpath}; do
212 CPPFLAGS="${CPPFLAGS} -I${i}"
217 AC_ARG_WITH(libpath, [ --with-libpath additional places to look for libraries],
218 [case $with_libpath in
219 yes) AC_MSG_ERROR(["must give --with-libpath an argument."])
221 no) AC_MSG_ERROR(["--without-libpath not supported."])
223 *) AC_MSG_NOTICE([Adding ${with_libpath} to LDFLAGS])
227 AC_ARG_WITH(libraries, [ --with-libraries additional libraries to link with],
228 [case $with_libraries in
229 yes) AC_MSG_ERROR(["must give --with-libraries an argument."])
231 no) AC_MSG_ERROR(["--without-libraries not supported."])
233 *) AC_MSG_NOTICE([Adding ${with_libraries} to LIBS])
237 AC_ARG_WITH(devel, [ --with-devel add development options],
239 yes) AC_MSG_NOTICE([Setting up for development: -Wall, flex, yacc])
240 PROGS="${PROGS} testsudoers"
241 OSDEFS="${OSDEFS} -DSUDO_DEVEL"
246 *) AC_MSG_WARN([Ignoring unknown argument to --with-devel: $with_devel])
250 AC_ARG_WITH(efence, [ --with-efence link with -lefence for malloc() debugging],
251 [case $with_efence in
252 yes) AC_MSG_NOTICE([Sudo will link with -lefence (Electric Fence)])
253 LIBS="${LIBS} -lefence"
254 if test -f /usr/local/lib/libefence.a; then
255 with_libpath="${with_libpath} /usr/local/lib"
259 *) AC_MSG_WARN([Ignoring unknown argument to --with-efence: $with_efence])
263 AC_ARG_WITH(csops, [ --with-csops add CSOps standard options],
265 yes) AC_MSG_NOTICE([Adding CSOps standard options])
269 with_classic_insults=yes
270 with_csops_insults=yes
276 *) AC_MSG_WARN([Ignoring unknown argument to --with-csops: $with_csops])
280 AC_ARG_WITH(passwd, [ --without-passwd don't use passwd/shadow file for authentication],
281 [case $with_passwd in
282 yes|no) AC_MSG_CHECKING(whether to use shadow/passwd file authentication)
283 AC_MSG_RESULT($with_passwd)
285 test "$with_passwd" = "yes" && AUTH_REG="$AUTH_REG passwd"
287 *) AC_MSG_ERROR(["Sorry, --with-passwd does not take an argument."])
291 AC_ARG_WITH(skey, [ --with-skey[=DIR] enable S/Key support ],
295 *) AC_DEFINE(HAVE_SKEY)
296 AC_MSG_CHECKING(whether to try S/Key authentication)
298 AUTH_REG="$AUTH_REG S/Key"
302 AC_ARG_WITH(opie, [ --with-opie[=DIR] enable OPIE support ],
306 *) AC_DEFINE(HAVE_OPIE)
307 AC_MSG_CHECKING(whether to try NRL OPIE authentication)
309 AUTH_REG="$AUTH_REG NRL_OPIE"
313 AC_ARG_WITH(long-otp-prompt, [ --with-long-otp-prompt use a two line OTP (skey/opie) prompt],
314 [case $with_long_otp_prompt in
315 yes) AC_DEFINE(LONG_OTP_PROMPT)
316 AC_MSG_CHECKING(whether to use a two line prompt for OTP authentication)
320 no) long_otp_prompt=off
322 *) AC_MSG_ERROR(["--with-long-otp-prompt does not take an argument."])
326 AC_ARG_WITH(SecurID, [ --with-SecurID[[=DIR]] enable SecurID support],
327 [case $with_SecurID in
328 no) with_SecurID="";;
329 *) AC_DEFINE(HAVE_SECURID)
330 AC_MSG_CHECKING(whether to use SecurID for authentication)
332 AUTH_EXCL="$AUTH_EXCL SecurID"
336 AC_ARG_WITH(fwtk, [ --with-fwtk[[=DIR]] enable FWTK AuthSRV support],
339 *) AC_DEFINE(HAVE_FWTK)
340 AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication)
342 AUTH_EXCL="$AUTH_EXCL FWTK"
346 AC_ARG_WITH(kerb4, [ --with-kerb4[[=DIR]] enable Kerberos IV support],
349 *) AC_MSG_CHECKING(whether to try kerberos IV authentication)
351 AUTH_REG="$AUTH_REG kerb4"
355 AC_ARG_WITH(kerb5, [ --with-kerb5[[=DIR]] enable Kerberos V support],
358 *) AC_MSG_CHECKING(whether to try Kerberos V authentication)
360 AUTH_REG="$AUTH_REG kerb5"
364 AC_ARG_WITH(aixauth, [ --with-aixauth enable AIX general authentication support],
365 [case $with_aixauth in
366 yes) AUTH_EXCL="$AUTH_EXCL AIX_AUTH";;
368 *) AC_MSG_ERROR(["--with-aixauth does not take an argument."])
372 AC_ARG_WITH(pam, [ --with-pam enable PAM support],
374 yes) AUTH_EXCL="$AUTH_EXCL PAM";;
376 *) AC_MSG_ERROR(["--with-pam does not take an argument."])
380 AC_ARG_WITH(AFS, [ --with-AFS enable AFS support],
382 yes) AC_DEFINE(HAVE_AFS)
383 AC_MSG_CHECKING(whether to try AFS (kerberos) authentication)
385 AUTH_REG="$AUTH_REG AFS"
388 *) AC_MSG_ERROR(["--with-AFS does not take an argument."])
392 AC_ARG_WITH(DCE, [ --with-DCE enable DCE support],
394 yes) AC_DEFINE(HAVE_DCE)
395 AC_MSG_CHECKING(whether to try DCE (kerberos) authentication)
397 AUTH_REG="$AUTH_REG DCE"
400 *) AC_MSG_ERROR(["--with-DCE does not take an argument."])
404 AC_ARG_WITH(logincap, [ --with-logincap enable BSD login class support],
405 [case $with_logincap in
407 *) AC_MSG_ERROR(["--with-logincap does not take an argument."])
411 AC_ARG_WITH(bsdauth, [ --with-bsdauth enable BSD authentication support],
412 [case $with_bsdauth in
413 yes) AUTH_EXCL="$AUTH_EXCL BSD_AUTH";;
415 *) AC_MSG_ERROR(["--with-bsdauth does not take an argument."])
419 AC_ARG_WITH(project, [ --with-project enable Solaris project support],
420 [case $with_project in
423 *) AC_MSG_ERROR(["--with-project does not take an argument."])
427 AC_MSG_CHECKING(whether to lecture users the first time they run sudo)
428 AC_ARG_WITH(lecture, [ --without-lecture don't print lecture for first-time sudoer],
429 [case $with_lecture in
430 yes|short|always) lecture=once
432 no|none|never) lecture=never
434 *) AC_MSG_ERROR(["unknown argument to --with-lecture: $with_lecture"])
437 if test "$lecture" = "once"; then
440 AC_DEFINE(NO_LECTURE)
444 AC_MSG_CHECKING(whether sudo should log via syslog or to a file by default)
445 AC_ARG_WITH(logging, [ --with-logging log via syslog, file, or both],
446 [case $with_logging in
447 yes) AC_MSG_ERROR(["must give --with-logging an argument."])
449 no) AC_MSG_ERROR(["--without-logging not supported."])
451 syslog) AC_DEFINE(LOGGING, SLOG_SYSLOG)
452 AC_MSG_RESULT(syslog)
454 file) AC_DEFINE(LOGGING, SLOG_FILE)
457 both) AC_DEFINE(LOGGING, SLOG_BOTH)
460 *) AC_MSG_ERROR(["unknown argument to --with-logging: $with_logging"])
462 esac], [AC_DEFINE(LOGGING, SLOG_SYSLOG) AC_MSG_RESULT(syslog)])
464 AC_MSG_CHECKING(which syslog facility sudo should log with)
465 AC_ARG_WITH(logfac, [ --with-logfac syslog facility to log with (default is "local2")],
466 [case $with_logfac in
467 yes) AC_MSG_ERROR(["must give --with-logfac an argument."])
469 no) AC_MSG_ERROR(["--without-logfac not supported."])
471 authpriv|auth|daemon|user|local0|local1|local2|local3|local4|local5|local6|local7) logfac=$with_logfac
473 *) AC_MSG_ERROR(["$with_logfac is not a supported syslog facility."])
476 AC_DEFINE_UNQUOTED(LOGFAC, "$logfac", [The syslog facility sudo will use.])
477 AC_MSG_RESULT($logfac)
479 AC_MSG_CHECKING(at which syslog priority to log commands)
480 AC_ARG_WITH(goodpri, [ --with-goodpri syslog priority for commands (def is "notice")],
481 [case $with_goodpri in
482 yes) AC_MSG_ERROR(["must give --with-goodpri an argument."])
484 no) AC_MSG_ERROR(["--without-goodpri not supported."])
486 alert|crit|debug|emerg|err|info|notice|warning)
487 goodpri=$with_goodpri
489 *) AC_MSG_ERROR(["$with_goodpri is not a supported syslog priority."])
492 AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri", [The syslog priority sudo will use for successful attempts.])
493 AC_MSG_RESULT($goodpri)
495 AC_MSG_CHECKING(at which syslog priority to log failures)
496 AC_ARG_WITH(badpri, [ --with-badpri syslog priority for failures (def is "alert")],
497 [case $with_badpri in
498 yes) AC_MSG_ERROR(["must give --with-badpri an argument."])
500 no) AC_MSG_ERROR(["--without-badpri not supported."])
502 alert|crit|debug|emerg|err|info|notice|warning)
505 *) AC_MSG_ERROR([$with_badpri is not a supported syslog priority.])
508 AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri", [The syslog priority sudo will use for unsuccessful attempts/errors.])
509 AC_MSG_RESULT($badpri)
511 AC_ARG_WITH(logpath, [ --with-logpath path to the sudo log file],
512 [case $with_logpath in
513 yes) AC_MSG_ERROR(["must give --with-logpath an argument."])
515 no) AC_MSG_ERROR(["--without-logpath not supported."])
519 AC_MSG_CHECKING(how long a line in the log file should be)
520 AC_ARG_WITH(loglen, [ --with-loglen maximum length of a log file line (default is 80)],
521 [case $with_loglen in
522 yes) AC_MSG_ERROR(["must give --with-loglen an argument."])
524 no) AC_MSG_ERROR(["--without-loglen not supported."])
526 [[0-9]]*) loglen=$with_loglen
528 *) AC_MSG_ERROR(["you must enter a number, not $with_loglen"])
531 AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen, [The max number of chars per log file line (for line wrapping).])
532 AC_MSG_RESULT($loglen)
534 AC_MSG_CHECKING(whether sudo should ignore '.' or '' in \$PATH)
535 AC_ARG_WITH(ignore-dot, [ --with-ignore-dot ignore '.' in the PATH],
536 [case $with_ignore_dot in
541 *) AC_MSG_ERROR(["--with-ignore-dot does not take an argument."])
544 if test "$ignore_dot" = "on"; then
545 AC_DEFINE(IGNORE_DOT_PATH)
551 AC_MSG_CHECKING(whether to send mail when a user is not in sudoers)
552 AC_ARG_WITH(mail-if-no-user, [ --without-mail-if-no-user do not send mail if user not in sudoers],
553 [case $with_mail_if_no_user in
558 *) AC_MSG_ERROR(["--with-mail-if-no-user does not take an argument."])
561 if test "$mail_no_user" = "on"; then
562 AC_DEFINE(SEND_MAIL_WHEN_NO_USER)
568 AC_MSG_CHECKING(whether to send mail when user listed but not for this host)
569 AC_ARG_WITH(mail-if-no-host, [ --with-mail-if-no-host send mail if user in sudoers but not for this host],
570 [case $with_mail_if_no_host in
575 *) AC_MSG_ERROR(["--with-mail-if-no-host does not take an argument."])
578 if test "$mail_no_host" = "on"; then
579 AC_DEFINE(SEND_MAIL_WHEN_NO_HOST)
585 AC_MSG_CHECKING(whether to send mail when a user tries a disallowed command)
586 AC_ARG_WITH(mail-if-noperms, [ --with-mail-if-noperms send mail if user not allowed to run command],
587 [case $with_mail_if_noperms in
592 *) AC_MSG_ERROR(["--with-mail-if-noperms does not take an argument."])
595 if test "$mail_noperms" = "on"; then
596 AC_DEFINE(SEND_MAIL_WHEN_NOT_OK)
602 AC_MSG_CHECKING(who should get the mail that sudo sends)
603 AC_ARG_WITH(mailto, [ --with-mailto who should get sudo mail (default is "root")],
604 [case $with_mailto in
605 yes) AC_MSG_ERROR(["must give --with-mailto an argument."])
607 no) AC_MSG_ERROR(["--without-mailto not supported."])
609 *) mailto=$with_mailto
612 AC_DEFINE_UNQUOTED(MAILTO, "$mailto", [The user or email address that sudo mail is sent to.])
613 AC_MSG_RESULT([$mailto])
615 AC_ARG_WITH(mailsubject, [ --with-mailsubject subject of sudo mail],
616 [case $with_mailsubject in
617 yes) AC_MSG_ERROR(["must give --with-mailsubject an argument."])
619 no) AC_MSG_WARN([Sorry, --without-mailsubject not supported.])
621 *) mailsub="$with_mailsubject"
622 AC_MSG_CHECKING(sudo mail subject)
623 AC_MSG_RESULT([Using alert mail subject: $mailsub])
626 AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub", [The subject of the mail sent by sudo to the MAILTO user/address.])
628 AC_MSG_CHECKING(for bad password prompt)
629 AC_ARG_WITH(passprompt, [ --with-passprompt default password prompt],
630 [case $with_passprompt in
631 yes) AC_MSG_ERROR(["must give --with-passprompt an argument."])
633 no) AC_MSG_WARN([Sorry, --without-passprompt not supported.])
635 *) passprompt="$with_passprompt"
637 AC_MSG_RESULT($passprompt)
638 AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt", [The default password prompt.])
640 AC_MSG_CHECKING(for bad password message)
641 AC_ARG_WITH(badpass-message, [ --with-badpass-message message the user sees when the password is wrong],
642 [case $with_badpass_message in
643 yes) AC_MSG_ERROR(["Must give --with-badpass-message an argument."])
645 no) AC_MSG_WARN([Sorry, --without-badpass-message not supported.])
647 *) badpass_message="$with_badpass_message"
650 AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message", [The message given when a bad password is entered.])
651 AC_MSG_RESULT([$badpass_message])
653 AC_MSG_CHECKING(whether to expect fully qualified hosts in sudoers)
654 AC_ARG_WITH(fqdn, [ --with-fqdn expect fully qualified hosts in sudoers],
660 *) AC_MSG_ERROR(["--with-fqdn does not take an argument."])
663 if test "$fqdn" = "on"; then
670 AC_ARG_WITH(timedir, [ --with-timedir path to the sudo timestamp dir],
671 [case $with_timedir in
672 yes) AC_MSG_ERROR(["must give --with-timedir an argument."])
674 no) AC_MSG_ERROR(["--without-timedir not supported."])
678 AC_ARG_WITH(sendmail, [ --with-sendmail=path set path to sendmail
679 --without-sendmail do not send mail at all],
680 [case $with_sendmail in
681 yes) with_sendmail=""
684 *) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail")
688 AC_ARG_WITH(sudoers-mode, [ --with-sudoers-mode mode of sudoers file (defaults to 0440)],
689 [case $with_sudoers_mode in
690 yes) AC_MSG_ERROR(["must give --with-sudoers-mode an argument."])
692 no) AC_MSG_ERROR(["--without-sudoers-mode not supported."])
694 [[1-9]]*) SUDOERS_MODE=0${with_sudoers_mode}
696 0*) SUDOERS_MODE=$with_sudoers_mode
698 *) AC_MSG_ERROR(["you must use an octal mode, not a name."])
702 AC_ARG_WITH(sudoers-uid, [ --with-sudoers-uid uid that owns sudoers file (defaults to 0)],
703 [case $with_sudoers_uid in
704 yes) AC_MSG_ERROR(["must give --with-sudoers-uid an argument."])
706 no) AC_MSG_ERROR(["--without-sudoers-uid not supported."])
708 [[0-9]]*) SUDOERS_UID=$with_sudoers_uid
710 *) AC_MSG_ERROR(["you must use an unsigned numeric uid, not a name."])
714 AC_ARG_WITH(sudoers-gid, [ --with-sudoers-gid gid that owns sudoers file (defaults to 0)],
715 [case $with_sudoers_gid in
716 yes) AC_MSG_ERROR(["must give --with-sudoers-gid an argument."])
718 no) AC_MSG_ERROR(["--without-sudoers-gid not supported."])
720 [[0-9]]*) SUDOERS_GID=$with_sudoers_gid
722 *) AC_MSG_ERROR(["you must use an unsigned numeric gid, not a name."])
726 AC_MSG_CHECKING(for umask programs should be run with)
727 AC_ARG_WITH(umask, [ --with-umask umask with which the prog should run (default is 022)
728 --without-umask Preserves the umask of the user invoking sudo.],
730 yes) AC_MSG_ERROR(["must give --with-umask an argument."])
734 [[0-9]]*) sudo_umask=$with_umask
736 *) AC_MSG_ERROR(["you must enter a numeric mask."])
739 AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask, [The umask that the root-run prog should use.])
740 if test "$sudo_umask" = "0777"; then
743 AC_MSG_RESULT($sudo_umask)
746 AC_MSG_CHECKING(for default user to run commands as)
747 AC_ARG_WITH(runas-default, [ --with-runas-default User to run commands as (default is "root")],
748 [case $with_runas_default in
749 yes) AC_MSG_ERROR(["must give --with-runas-default an argument."])
751 no) AC_MSG_ERROR(["--without-runas-default not supported."])
753 *) runas_default="$with_runas_default"
756 AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default", [The user sudo should run commands as by default.])
757 AC_MSG_RESULT([$runas_default])
759 AC_ARG_WITH(exempt, [ --with-exempt=group no passwd needed for users in this group],
760 [case $with_exempt in
761 yes) AC_MSG_ERROR(["must give --with-exempt an argument."])
763 no) AC_MSG_ERROR(["--without-exempt not supported."])
765 *) AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt", [If defined, users in this group need not enter a passwd (ie "sudo").])
766 AC_MSG_CHECKING(for group to be exempt from password)
767 AC_MSG_RESULT([$with_exempt])
771 AC_MSG_CHECKING(for editor that visudo should use)
772 AC_ARG_WITH(editor, [ --with-editor=path Default editor for visudo (defaults to vi)],
773 [case $with_editor in
774 yes) AC_MSG_ERROR(["must give --with-editor an argument."])
776 no) AC_MSG_ERROR(["--without-editor not supported."])
778 *) AC_DEFINE_UNQUOTED(EDITOR, "$with_editor", [A colon-separated list of pathnames to be used as the editor for visudo.])
779 AC_MSG_RESULT([$with_editor])
781 esac], [AC_DEFINE(EDITOR, _PATH_VI) AC_MSG_RESULT(vi)])
783 AC_MSG_CHECKING(whether to obey EDITOR and VISUAL environment variables)
784 AC_ARG_WITH(env-editor, [ --with-env-editor Use the environment variable EDITOR for visudo],
785 [case $with_env_editor in
790 *) AC_MSG_ERROR(["--with-env-editor does not take an argument."])
793 if test "$env_editor" = "on"; then
794 AC_DEFINE(ENV_EDITOR)
800 AC_MSG_CHECKING(number of tries a user gets to enter their password)
801 AC_ARG_WITH(passwd-tries, [ --with-passwd-tries number of tries to enter password (default is 3)],
802 [case $with_passwd_tries in
804 no) AC_MSG_ERROR(["--without-editor not supported."])
806 [[1-9]]*) passwd_tries=$with_passwd_tries
808 *) AC_MSG_ERROR(["you must enter the numer of tries, > 0"])
811 AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries, [The number of tries a user gets to enter their password.])
812 AC_MSG_RESULT($passwd_tries)
814 AC_MSG_CHECKING(time in minutes after which sudo will ask for a password again)
815 AC_ARG_WITH(timeout, [ --with-timeout minutes before sudo asks for passwd again (def is 5 minutes)],
816 [case $with_timeout in
820 [[0-9]]*) timeout=$with_timeout
822 *) AC_MSG_ERROR(["you must enter the numer of minutes."])
825 AC_DEFINE_UNQUOTED(TIMEOUT, $timeout, [The number of minutes before sudo asks for a password again.])
826 AC_MSG_RESULT($timeout)
828 AC_MSG_CHECKING(time in minutes after the password prompt will time out)
829 AC_ARG_WITH(password-timeout, [ --with-password-timeout passwd prompt timeout in minutes (default is 5 minutes)],
830 [case $with_password_timeout in
832 no) password_timeout=0
834 [[0-9]]*) password_timeout=$with_password_timeout
836 *) AC_MSG_ERROR(["you must enter the numer of minutes."])
839 AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout, [The passwd prompt timeout (in minutes).])
840 AC_MSG_RESULT($password_timeout)
842 AC_MSG_CHECKING(whether to use per-tty ticket files)
843 AC_ARG_WITH(tty-tickets, [ --with-tty-tickets use a different ticket file for each tty],
844 [case $with_tty_tickets in
849 *) AC_MSG_ERROR(["--with-tty-tickets does not take an argument."])
852 if test "$tty_tickets" = "on"; then
853 AC_DEFINE(USE_TTY_TICKETS)
859 AC_MSG_CHECKING(whether to include insults)
860 AC_ARG_WITH(insults, [ --with-insults insult the user for entering an incorrect password],
861 [case $with_insults in
863 with_classic_insults=yes
864 with_csops_insults=yes
868 *) AC_MSG_ERROR(["--with-insults does not take an argument."])
871 if test "$insults" = "on"; then
872 AC_DEFINE(USE_INSULTS)
878 AC_ARG_WITH(all-insults, [ --with-all-insults include all the sudo insult sets],
879 [case $with_all_insults in
880 yes) with_classic_insults=yes
881 with_csops_insults=yes
883 with_goons_insults=yes
886 *) AC_MSG_ERROR(["--with-all-insults does not take an argument."])
890 AC_ARG_WITH(classic-insults, [ --with-classic-insults include the insults from the "classic" sudo],
891 [case $with_classic_insults in
892 yes) AC_DEFINE(CLASSIC_INSULTS)
895 *) AC_MSG_ERROR(["--with-classic-insults does not take an argument."])
899 AC_ARG_WITH(csops-insults, [ --with-csops-insults include CSOps insults],
900 [case $with_csops_insults in
901 yes) AC_DEFINE(CSOPS_INSULTS)
904 *) AC_MSG_ERROR(["--with-csops-insults does not take an argument."])
908 AC_ARG_WITH(hal-insults, [ --with-hal-insults include 2001-like insults],
909 [case $with_hal_insults in
910 yes) AC_DEFINE(HAL_INSULTS)
913 *) AC_MSG_ERROR(["--with-hal-insults does not take an argument."])
917 AC_ARG_WITH(goons-insults, [ --with-goons-insults include the insults from the "Goon Show"],
918 [case $with_goons_insults in
919 yes) AC_DEFINE(GOONS_INSULTS)
922 *) AC_MSG_ERROR(["--with-goons-insults does not take an argument."])
926 AC_ARG_WITH(nsswitch, [ --with-nsswitch[[=PATH]] path to nsswitch.conf],
927 [case $with_nsswitch in
929 yes) with_nsswitch="/etc/nsswitch.conf"
933 if test ${with_nsswitch-"yes"} != "no"; then
934 SUDO_DEFINE_UNQUOTED(_PATH_NSSWITCH_CONF, "${with_nsswitch-/etc/nsswitch.conf}")
935 nsswitch_conf=${with_nsswitch-/etc/nsswitch.conf}
937 nsswitch_conf='/etc/nsswitch.conf'
940 AC_ARG_WITH(ldap, [ --with-ldap[[=DIR]] enable LDAP support],
943 *) AC_DEFINE(HAVE_LDAP)
944 AC_MSG_CHECKING(whether to use sudoers from LDAP)
949 AC_ARG_WITH(ldap-conf-file, [ --with-ldap-conf-file path to LDAP configuration file])
950 SUDO_DEFINE_UNQUOTED(_PATH_LDAP_CONF, "${with_ldap_conf_file-/etc/ldap.conf}", [Path to the ldap.conf file])
951 ldap_conf=${with_ldap_conf_file-'/etc/ldap.conf'}
953 AC_ARG_WITH(ldap-secret-file, [ --with-ldap-secret-file path to LDAP secret password file])
954 SUDO_DEFINE_UNQUOTED(_PATH_LDAP_SECRET, "${with_ldap_secret_file-/etc/ldap.secret}", [Path to the ldap.secret file])
955 ldap_secret=${with_ldap_secret_file-'/etc/ldap.secret'}
957 AC_ARG_WITH(pc-insults, [ --with-pc-insults replace politically incorrect insults with less offensive ones],
958 [case $with_pc_insults in
959 yes) AC_DEFINE(PC_INSULTS)
962 *) AC_MSG_ERROR(["--with-pc-insults does not take an argument."])
966 dnl include all insult sets on one line
967 if test "$insults" = "on"; then
968 AC_MSG_CHECKING(which insult sets to include)
970 test "$with_goons_insults" = "yes" && i="goons ${i}"
971 test "$with_hal_insults" = "yes" && i="hal ${i}"
972 test "$with_csops_insults" = "yes" && i="csops ${i}"
973 test "$with_classic_insults" = "yes" && i="classic ${i}"
977 AC_MSG_CHECKING(whether to override the user's path)
978 AC_ARG_WITH(secure-path, [ --with-secure-path override the user's path with a built-in one],
979 [case $with_secure_path in
980 yes) AC_DEFINE_UNQUOTED(SECURE_PATH, "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc")
981 AC_MSG_RESULT([:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc])
983 no) AC_MSG_RESULT(no)
985 *) AC_DEFINE_UNQUOTED(SECURE_PATH, "$with_secure_path")
986 AC_MSG_RESULT([$with_secure_path])
988 esac], AC_MSG_RESULT(no))
990 AC_MSG_CHECKING(whether to get ip addresses from the network interfaces)
991 AC_ARG_WITH(interfaces, [ --without-interfaces don't try to read the ip addr of ether interfaces],
992 [case $with_interfaces in
993 yes) AC_MSG_RESULT(yes)
995 no) AC_DEFINE(STUB_LOAD_INTERFACES)
998 *) AC_MSG_ERROR(["--with-interfaces does not take an argument."])
1000 esac], AC_MSG_RESULT(yes))
1002 AC_MSG_CHECKING(whether stow should be used)
1003 AC_ARG_WITH(stow, [ --with-stow properly handle GNU stow packaging],
1005 yes) AC_MSG_RESULT(yes)
1008 no) AC_MSG_RESULT(no)
1010 *) AC_MSG_ERROR(["--with-stow does not take an argument."])
1012 esac], AC_MSG_RESULT(no))
1014 AC_MSG_CHECKING(whether to use an askpass helper)
1015 AC_ARG_WITH(askpass, [ --with-askpass=PATH Fully qualified pathname of askpass helper],
1016 [case $with_askpass in
1017 yes) AC_MSG_ERROR(["--with-askpass takes a path as an argument."])
1020 *) AC_DEFINE_UNQUOTED(_PATH_SUDO_ASKPASS, "$with_askpass", [The fully qualified pathname of askpass])
1022 esac], AC_MSG_RESULT(no))
1025 dnl Options for --enable
1028 AC_MSG_CHECKING(whether to do user authentication by default)
1029 AC_ARG_ENABLE(authentication,
1030 [ --disable-authentication
1031 Do not require authentication by default],
1032 [ case "$enableval" in
1033 yes) AC_MSG_RESULT(yes)
1035 no) AC_MSG_RESULT(no)
1036 AC_DEFINE(NO_AUTHENTICATION)
1038 *) AC_MSG_RESULT(no)
1039 AC_MSG_WARN([Ignoring unknown argument to --enable-authentication: $enableval])
1042 ], AC_MSG_RESULT(yes))
1044 AC_MSG_CHECKING(whether to disable running the mailer as root)
1045 AC_ARG_ENABLE(root-mailer,
1046 [ --disable-root-mailer Don't run the mailer as root, run as the user],
1047 [ case "$enableval" in
1048 yes) AC_MSG_RESULT(no)
1050 no) AC_MSG_RESULT(yes)
1051 AC_DEFINE(NO_ROOT_MAILER)
1053 *) AC_MSG_RESULT(no)
1054 AC_MSG_WARN([Ignoring unknown argument to --enable-root-mailer: $enableval])
1057 ], AC_MSG_RESULT(no))
1059 AC_ARG_ENABLE(setreuid,
1060 [ --disable-setreuid Don't try to use the setreuid() function],
1061 [ case "$enableval" in
1062 no) SKIP_SETREUID=yes
1068 AC_ARG_ENABLE(setresuid,
1069 [ --disable-setresuid Don't try to use the setresuid() function],
1070 [ case "$enableval" in
1071 no) SKIP_SETRESUID=yes
1077 AC_MSG_CHECKING(whether to disable shadow password support)
1078 AC_ARG_ENABLE(shadow,
1079 [ --disable-shadow Never use shadow passwords],
1080 [ case "$enableval" in
1081 yes) AC_MSG_RESULT(no)
1083 no) AC_MSG_RESULT(yes)
1086 *) AC_MSG_RESULT(no)
1087 AC_MSG_WARN([Ignoring unknown argument to --enable-shadow: $enableval])
1090 ], AC_MSG_RESULT(no))
1092 AC_MSG_CHECKING(whether root should be allowed to use sudo)
1093 AC_ARG_ENABLE(root-sudo,
1094 [ --disable-root-sudo Don't allow root to run sudo],
1095 [ case "$enableval" in
1096 yes) AC_MSG_RESULT(yes)
1098 no) AC_DEFINE(NO_ROOT_SUDO)
1102 *) AC_MSG_ERROR(["--enable-root-sudo does not take an argument."])
1105 ], AC_MSG_RESULT(yes))
1107 AC_MSG_CHECKING(whether to log the hostname in the log file)
1108 AC_ARG_ENABLE(log-host,
1109 [ --enable-log-host Log the hostname in the log file],
1110 [ case "$enableval" in
1111 yes) AC_MSG_RESULT(yes)
1112 AC_DEFINE(HOST_IN_LOG)
1114 no) AC_MSG_RESULT(no)
1116 *) AC_MSG_RESULT(no)
1117 AC_MSG_WARN([Ignoring unknown argument to --enable-log-host: $enableval])
1120 ], AC_MSG_RESULT(no))
1122 AC_MSG_CHECKING(whether to invoke a shell if sudo is given no arguments)
1123 AC_ARG_ENABLE(noargs-shell,
1124 [ --enable-noargs-shell If sudo is given no arguments run a shell],
1125 [ case "$enableval" in
1126 yes) AC_MSG_RESULT(yes)
1127 AC_DEFINE(SHELL_IF_NO_ARGS)
1129 no) AC_MSG_RESULT(no)
1131 *) AC_MSG_RESULT(no)
1132 AC_MSG_WARN([Ignoring unknown argument to --enable-noargs-shell: $enableval])
1135 ], AC_MSG_RESULT(no))
1137 AC_MSG_CHECKING(whether to set \$HOME to target user in shell mode)
1138 AC_ARG_ENABLE(shell-sets-home,
1139 [ --enable-shell-sets-home
1140 Set $HOME to target user in shell mode],
1141 [ case "$enableval" in
1142 yes) AC_MSG_RESULT(yes)
1143 AC_DEFINE(SHELL_SETS_HOME)
1145 no) AC_MSG_RESULT(no)
1147 *) AC_MSG_RESULT(no)
1148 AC_MSG_WARN([Ignoring unknown argument to --enable-shell-sets-home: $enableval])
1151 ], AC_MSG_RESULT(no))
1153 AC_MSG_CHECKING(whether to disable 'command not found' messages)
1154 AC_ARG_ENABLE(path_info,
1155 [ --disable-path-info Print 'command not allowed' not 'command not found'],
1156 [ case "$enableval" in
1157 yes) AC_MSG_RESULT(no)
1159 no) AC_MSG_RESULT(yes)
1160 AC_DEFINE(DONT_LEAK_PATH_INFO)
1163 *) AC_MSG_RESULT(no)
1164 AC_MSG_WARN([Ignoring unknown argument to --enable-path-info: $enableval])
1167 ], AC_MSG_RESULT(no))
1169 AC_ARG_WITH(selinux, [ --with-selinux enable SELinux support],
1170 [case $with_selinux in
1171 yes) SELINUX_USAGE="[[-r role]] [[-t type]] "
1172 AC_DEFINE(HAVE_SELINUX)
1173 SUDO_LIBS="${SUDO_LIBS} -lselinux"
1174 SUDO_OBJS="${SUDO_OBJS} selinux.o"
1175 PROGS="${PROGS} sesh"
1180 *) AC_MSG_ERROR(["--with-selinux does not take an argument."])
1185 dnl gss_krb5_ccache_name() may not work on Heimdal so we don't use it by default
1187 AC_ARG_ENABLE(gss_krb5_ccache_name, [ --enable-gss-krb5-ccache-name
1188 Use GSS-API to set the Kerberos V cred cache name], [check_gss_krb5_ccache_name=$enableval], [check_gss_krb5_ccache_name=no])
1191 dnl If we don't have egrep we can't do anything...
1193 AC_CHECK_PROG(EGREPPROG, egrep, egrep)
1194 if test -z "$EGREPPROG"; then
1195 AC_MSG_ERROR([Sorry, configure requires egrep to run.])
1199 dnl Prevent configure from adding the -g flag unless in devel mode
1201 if test "$with_devel" != "yes"; then
1206 dnl C compiler checks
1212 dnl Libtool magic; enable shared libs and disable static libs
1215 AC_CANONICAL_TARGET([])
1220 dnl Defer with_noexec until after libtool magic runs
1222 if test "$enable_shared" = "no"; then
1225 eval _shrext="$shrext_cmds"
1227 AC_MSG_CHECKING(path to sudo_noexec.so)
1228 AC_ARG_WITH(noexec, [ --with-noexec[=PATH] fully qualified pathname of sudo_noexec.so],
1229 [case $with_noexec in
1230 yes) with_noexec="$libexecdir/sudo_noexec$_shrext"
1234 esac], [with_noexec="$libexecdir/sudo_noexec$_shrext"])
1235 AC_MSG_RESULT($with_noexec)
1236 NOEXECFILE="sudo_noexec$_shrext"
1237 NOEXECDIR="`echo $with_noexec|sed 's:^\(.*\)/[[^/]]*:\1:'`"
1240 dnl It is now safe to modify CFLAGS and CPPFLAGS
1242 if test "$with_devel" = "yes" -a -n "$GCC"; then
1243 CFLAGS="${CFLAGS} -Wall"
1247 dnl Find programs we use
1249 AC_CHECK_PROG(UNAMEPROG, uname, uname)
1250 AC_CHECK_PROG(TRPROG, tr, tr)
1251 AC_CHECK_PROG(NROFFPROG, nroff, nroff)
1252 if test -z "$NROFFPROG"; then
1254 mansrcdir='$(srcdir)'
1258 dnl What kind of beastie are we being run on?
1259 dnl Barf if config.cache was generated on another host.
1261 if test -n "$sudo_cv_prev_host"; then
1262 if test "$sudo_cv_prev_host" != "$host"; then
1263 AC_MSG_ERROR([config.cache was created on a different host; remove it and re-run configure.])
1265 AC_MSG_CHECKING(previous host type)
1266 AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
1267 AC_MSG_RESULT([$sudo_cv_prev_host])
1270 # this will produce no output since there is no cached value
1271 AC_CACHE_VAL(sudo_cv_prev_host, sudo_cv_prev_host="$host")
1275 dnl We want to be able to differentiate between different rev's
1277 if test -n "$host_os"; then
1278 OS=`echo $host_os | sed 's/[[0-9]].*//'`
1279 OSREV=`echo $host_os | sed 's/^[[^0-9\.]]*\([[0-9\.]]*\).*$/\1/'`
1280 OSMAJOR=`echo $OSREV | sed 's/\..*$//'`
1289 # getcwd(3) opens a pipe to getpwd(1)!?!
1292 # system headers lack prototypes but gcc helps...
1293 if test -n "$GCC"; then
1294 OSDEFS="${OSDEFS} -D__USE_FIXED_PROTOTYPES__"
1297 shadow_funcs="getpwanam issecure"
1300 # To get the crypt(3) prototype (so we pass -Wall)
1301 OSDEFS="${OSDEFS} -D__EXTENSIONS__"
1302 # AFS support needs -lucb
1303 if test "$with_AFS" = "yes"; then
1304 AFS_LIBS="-lc -lucb"
1307 : ${mansectform='4'}
1308 : ${with_rpath='yes'}
1309 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1312 # To get all prototypes (so we pass -Wall)
1313 OSDEFS="${OSDEFS} -D_XOPEN_EXTENDED_SOURCE -D_ALL_SOURCE"
1314 SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-bI:\$(srcdir)/aixcrypt.exp"
1315 if test X"$with_blibpath" != X"no"; then
1316 AC_MSG_CHECKING([if linker accepts -Wl,-blibpath])
1317 O_LDFLAGS="$LDFLAGS"
1318 LDFLAGS="$O_LDFLAGS -Wl,-blibpath:/usr/lib:/lib"
1319 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [
1320 if test -n "$with_blibpath" -a "$with_blibpath" != "yes"; then
1321 blibpath="$with_blibpath"
1322 elif test -n "$GCC"; then
1323 blibpath="/usr/lib:/lib:/usr/local/lib"
1325 blibpath="/usr/lib:/lib"
1328 ], [AC_MSG_RESULT(no)])
1330 LDFLAGS="$O_LDFLAGS"
1332 # Use authenticate(3) as the default authentication method
1333 if test X"$with_aixauth" = X""; then
1334 AC_CHECK_FUNCS(authenticate, [AUTH_EXCL_DEF="AIX_AUTH"])
1337 # AIX-specific functions
1338 AC_CHECK_FUNCS(getuserattr)
1339 SUDO_OBJS="$SUDO_OBJS aix.o"
1343 : ${mansectform='4'}
1346 # AFS support needs -lBSD
1347 if test "$with_AFS" = "yes"; then
1348 AFS_LIBS="-lc -lBSD"
1351 : ${mansectform='4'}
1353 # HP-UX bundled compiler can't generate shared objects
1354 if test "x$ac_cv_prog_cc_c89" = "xno"; then
1359 AC_DEFINE(BROKEN_SYSLOG)
1361 # Not sure if setuid binaries are safe in < 9.x
1362 if test -n "$GCC"; then
1363 SUDO_LDFLAGS="${SUDO_LDFLAGS} -static"
1365 SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-a,archive"
1369 AC_DEFINE(BROKEN_SYSLOG)
1371 shadow_funcs="getspwuid"
1373 # DCE support (requires ANSI C compiler)
1374 if test "$with_DCE" = "yes"; then
1375 # order of libs in 9.X is important. -lc_r must be last
1376 SUDO_LIBS="${SUDO_LIBS} -ldce -lM -lc_r"
1377 LIBS="${LIBS} -ldce -lM -lc_r"
1378 CPPFLAGS="${CPPFLAGS} -D_REENTRANT -I/usr/include/reentrant"
1382 shadow_funcs="getprpwnam iscomsec"
1386 shadow_funcs="getspnam iscomsec"
1388 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1393 # ignore envariables wrt dynamic lib path
1394 SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-no_library_replacement"
1396 : ${CHECKSIA='true'}
1397 AC_MSG_CHECKING(whether to disable sia support on Digital UNIX)
1399 [ --disable-sia Disable SIA on Digital UNIX],
1400 [ case "$enableval" in
1401 yes) AC_MSG_RESULT(no)
1404 no) AC_MSG_RESULT(yes)
1407 *) AC_MSG_RESULT(no)
1408 AC_MSG_WARN([Ignoring unknown argument to --enable-sia: $enableval])
1411 ], AC_MSG_RESULT(no))
1413 shadow_funcs="getprpwnam dispcrypt"
1414 # OSF/1 4.x and higher need -ldb too
1415 if test $OSMAJOR -lt 4; then
1416 shadow_libs="-lsecurity -laud -lm"
1418 shadow_libs="-lsecurity -ldb -laud -lm"
1421 # use SIA by default, if we have it
1422 test "$CHECKSIA" = "true" && AUTH_EXCL_DEF="SIA"
1425 # Some versions of Digital Unix ship with a broken
1426 # copy of prot.h, which we need for shadow passwords.
1427 # XXX - make should remove this as part of distclean
1429 AC_MSG_CHECKING([for broken prot.h])
1430 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1431 #include <sys/types.h>
1432 #include <sys/security.h>
1434 ]], [[exit(0);]])], [AC_MSG_RESULT(no)], [AC_MSG_RESULT([yes, fixing locally])
1435 sed 's:<acl.h>:<sys/acl.h>:g' < /usr/include/prot.h > prot.h
1438 : ${mansectform='4'}
1441 OSDEFS="${OSDEFS} -D_BSD_TYPES"
1442 if test -z "$NROFFPROG"; then
1443 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)'
1444 if test "$prefix" = "/usr/local" -a "$mandir" = '$(prefix)/man'; then
1445 if test -d /usr/share/catman/local; then
1446 mandir="/usr/share/catman/local"
1448 mandir="/usr/catman/local"
1452 if test "$prefix" = "/usr/local" -a "$mandir" = '$(prefix)/man'; then
1453 if test -d "/usr/share/man/local"; then
1454 mandir="/usr/share/man/local"
1456 mandir="/usr/man/local"
1460 # IRIX <= 4 needs -lsun
1461 if test "$OSMAJOR" -le 4; then
1462 AC_CHECK_LIB(sun, getpwnam, [LIBS="${LIBS} -lsun"])
1465 : ${mansectform='4'}
1467 *-*-linux*|*-*-k*bsd*-gnu)
1468 OSDEFS="${OSDEFS} -D_GNU_SOURCE"
1469 # Some Linux versions need to link with -lshadow
1470 shadow_funcs="getspnam"
1471 shadow_libs_optional="-lshadow"
1472 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1475 OSDEFS="${OSDEFS} -D_CONVEX_SOURCE"
1476 if test -z "$GCC"; then
1477 CFLAGS="${CFLAGS} -D__STDC__"
1480 shadow_defs="-D_AUDIT -D_ACL -DSecureWare"
1481 shadow_funcs="getprpwnam"
1482 shadow_libs="-lprot"
1486 shadow_funcs="getauthuid"
1487 shadow_libs="-lauth"
1490 LIBS="${LIBS} -lsun -lbsd"
1491 CPPFLAGS="${CPPFLAGS} -I/usr/include -I/usr/include/bsd"
1492 OSDEFS="${OSDEFS} -D_MIPS"
1494 : ${mansectform='4'}
1497 OSDEFS="${OSDEFS} -D_ISC"
1499 SUDO_LIBS="${SUDO_LIBS} -lcrypt"
1500 LIBS="${LIBS} -lcrypt"
1502 shadow_funcs="getspnam"
1506 : ${mansectform='4'}
1509 shadow_funcs="getprpwnam"
1510 shadow_libs="-lprot -lx"
1512 : ${mansectform='4'}
1514 m88k-motorola-sysv*)
1515 # motorolla's cc (a variant of gcc) does -O but not -O2
1516 CFLAGS=`echo $CFLAGS | sed 's/-O2/-O/g'`
1518 : ${mansectform='4'}
1521 shadow_funcs="getspnam"
1524 : ${mansectform='4'}
1525 : ${with_rpath='yes'}
1527 *-ncr-sysv4*|*-ncr-sysvr4*)
1528 AC_CHECK_LIB(c89, strcasecmp, AC_DEFINE(HAVE_STRCASECMP) [LIBS="${LIBS} -lc89"; ac_cv_func_strcasecmp=yes])
1530 : ${mansectform='4'}
1531 : ${with_rpath='yes'}
1533 *-ccur-sysv4*|*-ccur-sysvr4*)
1534 LIBS="${LIBS} -lgen"
1535 SUDO_LIBS="${SUDO_LIBS} -lgen"
1537 : ${mansectform='4'}
1538 : ${with_rpath='yes'}
1542 # Use shlicc for BSD/OS [23].x unless asked to do otherwise
1543 if test "${with_CC+set}" != set -a "$ac_cv_prog_CC" = gcc; then
1545 2|3) AC_MSG_NOTICE([using shlicc as CC])
1546 ac_cv_prog_CC=shlicc
1551 # Check for newer BSD auth API (just check for >= 3.0?)
1552 if test -z "$with_bsdauth"; then
1553 AC_CHECK_FUNCS(auth_challenge, [AUTH_EXCL_DEF="BSD_AUTH"])
1557 # FreeBSD has a real setreuid(2) starting with 2.1 and
1558 # backported to 2.0.5. We just take 2.1 and above...
1564 if test "$with_skey" = "yes"; then
1565 SUDO_LIBS="${SUDO_LIBS} -lmd"
1568 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1569 : ${with_logincap='maybe'}
1572 # OpenBSD has a real setreuid(2) starting with 3.3 but
1573 # we will use setreuid(2) instead.
1576 # OpenBSD >= 3.0 supports BSD auth
1577 if test -z "$with_bsdauth"; then
1582 AUTH_EXCL_DEF="BSD_AUTH"
1586 : ${with_logincap='maybe'}
1589 # NetBSD has a real setreuid(2) starting with 1.3.2
1591 0.9*|1.[012]*|1.3|1.3.1)
1596 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1597 : ${with_logincap='maybe'}
1600 if test "$with_skey" = "yes"; then
1601 SUDO_LIBS="${SUDO_LIBS} -lmd"
1604 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1605 : ${with_logincap='yes'}
1613 test -z "$with_pam" && AUTH_EXCL_DEF="PAM"
1614 : ${with_logincap='yes'}
1617 # lockf() on is broken on the NeXT -- use flock instead
1619 ac_cv_func_flock=yes
1623 : ${mansectform='4'}
1624 : ${with_rpath='yes'}
1628 : ${mansectform='4'}
1631 OSDEFS="${OSDEFS} -D_GNU_SOURCE"
1636 dnl Check for mixing mutually exclusive and regular auth methods
1638 AUTH_REG=${AUTH_REG# }
1639 AUTH_EXCL=${AUTH_EXCL# }
1640 if test -n "$AUTH_EXCL"; then
1642 if test $# != 1; then
1643 AC_MSG_ERROR([More than one mutually exclusive authentication method specified: $AUTH_EXCL])
1645 if test -n "$AUTH_REG"; then
1646 AC_MSG_ERROR([Cannot mix mutually exclusive ($AUTH_EXCL) and regular ($AUTH_REG) authentication methods])
1650 dnl Only one of S/Key and OPIE may be specified
1652 if test X"${with_skey}${with_opie}" = X"yesyes"; then
1653 AC_MSG_ERROR(["cannot use both S/Key and OPIE"])
1657 dnl Use BSD-style man sections by default
1660 : ${mansectform='5'}
1663 dnl Add in any libpaths or libraries specified via configure
1665 if test -n "$with_libpath"; then
1666 for i in ${with_libpath}; do
1667 SUDO_APPEND_LIBPATH(LDFLAGS, [$i])
1670 if test -n "$with_libraries"; then
1671 for i in ${with_libraries}; do
1683 dnl C compiler checks (to be done after os checks)
1685 AC_PROG_GCC_TRADITIONAL
1694 if test -z "$with_sendmail"; then
1697 if test -z "$with_editor"; then
1701 dnl Header file checks
1706 AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h)
1707 dnl ultrix termio/termios are broken
1708 if test "$OS" != "ultrix"; then
1709 AC_SYS_POSIX_TERMIOS
1710 if test "$ac_cv_sys_posix_termios" = "yes"; then
1711 AC_DEFINE(HAVE_TERMIOS_H)
1713 AC_CHECK_HEADERS(termio.h)
1716 if test ${with_logincap-'no'} != "no"; then
1717 AC_CHECK_HEADERS(login_cap.h, [LOGINCAP_USAGE='[[-c class|-]] '; LCMAN=""
1719 freebsd|netbsd) SUDO_LIBS="${SUDO_LIBS} -lutil"
1724 if test ${with_project-'no'} != "no"; then
1725 AC_CHECK_HEADER(project.h, AC_DEFINE(HAVE_PROJECT_H)
1726 [SUDO_LIBS="${SUDO_LIBS} -lproject"], -)
1733 AC_CHECK_TYPE([__signed char], [], [AC_CHECK_TYPE([signed char], [AC_DEFINE(__signed, signed)], [AC_DEFINE(__signed, [])])])
1734 AC_CHECK_TYPE([sig_atomic_t], [], [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h>
1735 #include <signal.h>])
1736 AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T)], [], [#include <sys/types.h>
1737 #include <signal.h>])
1738 AC_CHECK_TYPE([struct timespec], [AC_DEFINE(HAVE_TIMESPEC)], [], [#include <sys/types.h>
1739 #if TIME_WITH_SYS_TIME
1740 # include <sys/time.h>
1743 AC_CHECK_TYPES([struct in6_addr], [AC_DEFINE(HAVE_IN6_ADDR)], [], [#include <sys/types.h>
1744 #include <netinet/in.h>])
1753 dnl only set RETSIGTYPE if it is not set already
1763 AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf tzset \
1764 strftime setrlimit initgroups getgroups fstat gettimeofday \
1765 setlocale getaddrinfo setsid)
1766 if test -z "$SKIP_SETRESUID"; then
1767 AC_CHECK_FUNCS(setresuid, [SKIP_SETREUID=yes])
1769 if test -z "$SKIP_SETREUID"; then
1770 AC_CHECK_FUNCS(setreuid, [SKIP_SETEUID=yes])
1772 if test -z "$SKIP_SETEUID"; then
1773 AC_CHECK_FUNCS(seteuid)
1775 if test X"$with_interfaces" != X"no"; then
1776 AC_CHECK_FUNCS(getifaddrs, [AC_CHECK_FUNCS(freeifaddrs)])
1778 if test -z "$BROKEN_GETCWD"; then
1779 AC_REPLACE_FUNCS(getcwd)
1781 AC_CHECK_FUNCS(glob, [AC_MSG_CHECKING(for GLOB_BRACE and GLOB_TILDE in glob.h)
1782 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <glob.h>]], [[int i = GLOB_BRACE | GLOB_TILDE; (void)i;]])], [AC_DEFINE(HAVE_EXTENDED_GLOB)
1783 AC_MSG_RESULT(yes)], [AC_LIBOBJ(glob)
1784 AC_MSG_RESULT(no)])], [AC_LIBOBJ(glob)])
1785 AC_CHECK_FUNCS(lockf flock, [break])
1786 AC_CHECK_FUNCS(waitpid wait3, [break])
1787 AC_CHECK_FUNCS(innetgr _innetgr, [AC_CHECK_FUNCS(getdomainname) [break]])
1788 AC_CHECK_FUNCS(utimes, [AC_CHECK_FUNCS(futimes futimesat, [break])], [AC_CHECK_FUNCS(futime) AC_LIBOBJ(utimes)])
1789 SUDO_FUNC_FNMATCH([AC_DEFINE(HAVE_FNMATCH)], [AC_LIBOBJ(fnmatch)])
1791 AC_REPLACE_FUNCS(memrchr strerror strcasecmp sigaction strlcpy strlcat)
1792 AC_CHECK_FUNCS(closefrom, [], [AC_LIBOBJ(closefrom)
1793 AC_CHECK_DECL(F_CLOSEM, AC_DEFINE(HAVE_FCNTL_CLOSEM), [],
1794 [ #include <limits.h>
1795 #include <fcntl.h> ])
1797 AC_CHECK_FUNCS(mkstemp, [], [SUDO_OBJS="${SUDO_OBJS} mkstemp.o"
1798 AC_CHECK_FUNCS(random lrand48, [break])
1800 AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf, , [NEED_SNPRINTF=1])
1801 if test X"$ac_cv_type_struct_timespec" != X"no"; then
1802 AC_CHECK_MEMBER([struct stat.st_mtim], [AC_DEFINE(HAVE_ST_MTIM)]
1803 [AC_CHECK_MEMBER([struct stat.st_mtim.st__tim], AC_DEFINE(HAVE_ST__TIM))],
1804 [AC_CHECK_MEMBER([struct stat.st_mtimespec], AC_DEFINE([HAVE_ST_MTIMESPEC]))])
1805 AC_MSG_CHECKING([for two-parameter timespecsub])
1806 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1807 #include <sys/time.h>]], [[struct timespec ts1, ts2;
1808 ts1.tv_sec = 1; ts1.tv_nsec = 0; ts2.tv_sec = 0; ts2.tv_nsec = 0;
1810 #error missing timespecsub
1812 timespecsub(&ts1, &ts2);]])], [AC_DEFINE(HAVE_TIMESPECSUB2)
1813 AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])
1816 dnl Check for the dirfd function/macro. If not found, look for dd_fd in DIR.
1818 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
1819 #include <$ac_header_dirent>]], [[DIR *d; (void)dirfd(d);]])], [AC_DEFINE(HAVE_DIRFD)], [AC_TRY_LINK([#include <sys/types.h>
1820 #include <$ac_header_dirent>], [DIR d; memset(&d, 0, sizeof(d)); return(d.dd_fd);], [AC_DEFINE(HAVE_DD_FD)])])
1822 dnl If NEED_SNPRINTF is set, add snprintf.c to LIBOBJS
1823 dnl (it contains snprintf, vsnprintf, asprintf, and vasprintf)
1825 if test -n "$NEED_SNPRINTF"; then
1829 dnl If socket(2) not in libc, check -lsocket and -linet
1830 dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
1831 dnl In this case we look for main(), not socket() to avoid using a cached value
1833 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)
1834 AC_CHECK_LIB(socket, socket, [NET_LIBS="${NET_LIBS} -lsocket -lnsl"; LIBS="${LIBS} -lsocket -lnsl"], , -lnsl)))])
1836 dnl If inet_addr(3) not in libc, check -lnsl and -linet
1837 dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
1839 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)
1840 AC_CHECK_LIB(socket, inet_addr, [NET_LIBS="${NET_LIBS} -lsocket -lnsl"; LIBS="${LIBS} -lsocket -lnsl"], , -lnsl))))])
1842 dnl If syslog(3) not in libc, check -lsocket, -lnsl and -linet
1844 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"])))])
1846 dnl Check for getprogname() or __progname
1848 AC_CHECK_FUNCS(getprogname, , [
1849 AC_MSG_CHECKING([for __progname])
1850 AC_CACHE_VAL(sudo_cv___progname, [
1851 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[extern char *__progname; (void)puts(__progname);]])], [sudo_cv___progname=yes], [sudo_cv___progname=no])])
1852 if test "$sudo_cv___progname" = "yes"; then
1853 AC_DEFINE(HAVE___PROGNAME)
1855 AC_LIBOBJ(getprogname)
1857 AC_MSG_RESULT($sudo_cv___progname)
1861 dnl Mutually exclusive auth checks come first, followed by
1862 dnl non-exclusive ones. Note: passwd must be last of all!
1866 dnl Convert default authentication methods to with_* if
1867 dnl no explicit authentication scheme was specified.
1869 if test -z "${AUTH_EXCL}${AUTH_REG}" -a -n "$AUTH_EXCL_DEF"; then
1870 for auth in $AUTH_EXCL_DEF; do
1872 AIX_AUTH) with_aixauth=maybe;;
1873 BSD_AUTH) with_bsdauth=maybe;;
1874 PAM) with_pam=maybe;;
1875 SIA) CHECKSIA=true;;
1881 dnl PAM support. Systems that use PAM by default set with_pam=default
1882 dnl and we do the actual tests here.
1884 if test ${with_pam-"no"} != "no"; then
1886 dnl Linux may need this
1888 AC_CHECK_LIB([dl], [main], [SUDO_LIBS="${SUDO_LIBS} -lpam -ldl"], [SUDO_LIBS="${SUDO_LIBS} -lpam"])
1889 ac_cv_lib_dl=ac_cv_lib_dl_main
1892 dnl Some PAM implementations (MacOS X for example) put the PAM headers
1893 dnl in /usr/include/pam instead of /usr/include/security...
1895 AC_CHECK_HEADERS([security/pam_appl.h] [pam/pam_appl.h], [with_pam=yes; break])
1896 if test "$with_pam" = "yes"; then
1898 AUTH_OBJS="$AUTH_OBJS pam.o";
1900 AC_MSG_CHECKING(whether to use PAM session support)
1901 AC_ARG_ENABLE(pam_session,
1902 [ --disable-pam-session Disable PAM session support],
1903 [ case "$enableval" in
1904 yes) AC_MSG_RESULT(yes)
1906 no) AC_MSG_RESULT(no)
1907 AC_DEFINE([NO_PAM_SESSION], [], [PAM session support disabled])
1909 *) AC_MSG_RESULT(no)
1910 AC_MSG_WARN([Ignoring unknown argument to --enable-pam-session: $enableval])
1912 esac], AC_MSG_RESULT(yes))
1914 *-*-linux*|*-*-solaris*)
1915 # dgettext() may be defined to dgettext_libintl in the
1916 # header file, so first check that it links w/ additional
1917 # libs, then try with -lintl
1918 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1919 [[#include <libintl.h>]], [(void)dgettext((char *)0, (char *)0);])],
1920 [AC_DEFINE(HAVE_DGETTEXT)],
1921 [AC_CHECK_LIB(intl, dgettext, [LIBS="${LIBS} -lintl"]
1922 [AC_DEFINE(HAVE_DGETTEXT)])])
1929 dnl AIX general authentication
1930 dnl If set to "maybe" only enable if no other exclusive method in use.
1932 if test ${with_aixauth-'no'} != "no"; then
1933 if test X"$with_aixauth" != X"maybe" -o X"$AUTH_EXCL" = X""; then
1934 AC_MSG_NOTICE([using AIX general authentication])
1935 AC_DEFINE(HAVE_AIXAUTH)
1936 AUTH_OBJS="$AUTH_OBJS aix_auth.o";
1937 SUDO_LIBS="${SUDO_LIBS} -ls"
1943 dnl BSD authentication
1944 dnl If set to "maybe" only enable if no other exclusive method in use.
1946 if test ${with_bsdauth-'no'} != "no"; then
1947 AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H)
1948 [AUTH_OBJS="$AUTH_OBJS bsdauth.o"]
1949 [BSDAUTH_USAGE='[[-a auth_type]] ']
1950 [AUTH_EXCL=BSD_AUTH; BAMAN=""],
1951 [AC_MSG_ERROR([BSD authentication was specified but bsd_auth.h could not be found])])
1955 dnl SIA authentication for Tru64 Unix
1957 if test ${CHECKSIA-'false'} = "true"; then
1958 AC_CHECK_FUNCS(sia_ses_init, [found=true], [found=false])
1959 if test "$found" = "true"; then
1961 AUTH_OBJS="$AUTH_OBJS sia.o"
1966 dnl extra FWTK libs + includes
1968 if test ${with_fwtk-'no'} != "no"; then
1969 if test "$with_fwtk" != "yes"; then
1970 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_fwtk}])
1971 CPPFLAGS="${CPPFLAGS} -I${with_fwtk}"
1974 SUDO_LIBS="${SUDO_LIBS} -lauth -lfwall"
1975 AUTH_OBJS="$AUTH_OBJS fwtk.o"
1979 dnl extra SecurID lib + includes
1981 if test ${with_SecurID-'no'} != "no"; then
1982 if test "$with_SecurID" != "yes"; then
1984 elif test -d /usr/ace/examples; then
1985 with_SecurID=/usr/ace/examples
1987 with_SecurID=/usr/ace
1989 CPPFLAGS="${CPPFLAGS} -I${with_SecurID}"
1990 _LDFLAGS="${LDFLAGS}"
1991 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_SecurID}])
1993 # Determine whether to use the new or old SecurID API
1995 AC_CHECK_LIB(aceclnt, SD_Init,
1997 AUTH_OBJS="$AUTH_OBJS securid5.o";
1998 SUDO_LIBS="${SUDO_LIBS} -laceclnt -lpthread"
2001 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_SecurID}])
2003 AUTH_OBJS="$AUTH_OBJS securid.o";
2004 SUDO_LIBS="${SUDO_LIBS} ${with_SecurID}/sdiclient.a"
2010 LDFLAGS="${_LDFLAGS}"
2014 dnl Non-mutually exclusive auth checks come next.
2015 dnl Note: passwd must be last of all!
2019 dnl Convert default authentication methods to with_* if
2020 dnl no explicit authentication scheme was specified.
2022 if test -z "${AUTH_EXCL}" -a -n "$AUTH_DEF"; then
2023 for auth in $AUTH_DEF; do
2025 passwd) : ${with_passwd='maybe'};;
2033 if test ${with_kerb4-'no'} != "no"; then
2034 AC_DEFINE(HAVE_KERB4)
2036 dnl Use the specified directory, if any, else search for correct inc dir
2038 O_LDFLAGS="$LDFLAGS"
2039 if test "$with_kerb4" = "yes"; then
2041 O_CPPFLAGS="$CPPFLAGS"
2042 for dir in "" "kerberosIV/" "krb4/" "kerberos4/" "kerberosv4/"; do
2043 CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
2044 AC_PREPROC_IFELSE([#include <krb.h>], [found=yes; break])
2046 test X"$found" = X"no" && CPPFLAGS="$O_CPPFLAGS"
2048 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_kerb4}/lib])
2049 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_kerb4}/lib])
2050 CPPFLAGS="$CPPFLAGS -I${with_kerb4}/include"
2051 AC_CHECK_HEADER([krb.h], [found=yes], [found=no])
2053 if test X"$found" = X"no"; then
2054 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])
2058 dnl Check for -ldes vs. -ldes425
2060 AC_CHECK_LIB(des, des_cbc_encrypt, [K4LIBS="-ldes"], [
2061 AC_CHECK_LIB(des425, des_cbc_encrypt, [K4LIBS="-ldes425"], [K4LIBS=""])
2064 dnl Try to determine whether we have KTH or MIT/CNS Kerberos IV
2066 AC_MSG_CHECKING(whether we are using KTH Kerberos IV)
2067 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb.h>]], [[const char *tmp = krb4_version;]])], [
2069 K4LIBS="${K4LIBS} -lcom_err"
2070 AC_CHECK_LIB(roken, main, [K4LIBS="${K4LIBS} -lroken"])
2076 dnl The actual Kerberos IV lib might be -lkrb or -lkrb4
2078 AC_CHECK_LIB(krb, main, [K4LIBS="-lkrb $K4LIBS"], [
2079 AC_CHECK_LIB(krb4, main, [K4LIBS="-lkrb4 $K4LIBS"],
2080 [K4LIBS="-lkrb $K4LIBS"]
2081 [AC_MSG_WARN([Unable to locate Kerberos IV libraries, you will have to edit the Makefile and add -L/path/to/krb/libs to SUDO_LDFLAGS and possibly add Kerberos libs to SUDO_LIBS])]
2084 LDFLAGS="$O_LDFLAGS"
2085 SUDO_LIBS="${SUDO_LIBS} $K4LIBS"
2086 AUTH_OBJS="$AUTH_OBJS kerb4.o"
2091 dnl There is an easy way and a hard way...
2093 if test ${with_kerb5-'no'} != "no"; then
2094 AC_CHECK_PROG(KRB5CONFIG, krb5-config, yes, "")
2095 if test -n "$KRB5CONFIG"; then
2096 AC_DEFINE(HAVE_KERB5)
2097 AUTH_OBJS="$AUTH_OBJS kerb5.o"
2098 CPPFLAGS="$CPPFLAGS `krb5-config --cflags`"
2099 SUDO_LIBS="$SUDO_LIBS `krb5-config --libs`"
2101 dnl Try to determine whether we have Heimdal or MIT Kerberos
2103 AC_MSG_CHECKING(whether we are using Heimdal)
2104 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[const char *tmp = heimdal_version;]])], [
2106 AC_DEFINE(HAVE_HEIMDAL)
2113 if test ${with_kerb5-'no'} != "no" -a -z "$KRB5CONFIG"; then
2114 AC_DEFINE(HAVE_KERB5)
2116 dnl Use the specified directory, if any, else search for correct inc dir
2118 if test "$with_kerb5" = "yes"; then
2120 O_CPPFLAGS="$CPPFLAGS"
2121 for dir in "" "kerberosV/" "krb5/" "kerberos5/" "kerberosv5/"; do
2122 CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
2123 AC_PREPROC_IFELSE([#include <krb5.h>], [found=yes; break])
2125 if test X"$found" = X"no"; then
2126 CPPFLAGS="$O_CPPFLAGS"
2127 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])
2130 dnl XXX - try to include krb5.h here too
2131 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_kerb5}/lib])
2132 CPPFLAGS="$CPPFLAGS -I${with_kerb5}/include"
2136 dnl Try to determine whether we have Heimdal or MIT Kerberos
2138 AC_MSG_CHECKING(whether we are using Heimdal)
2139 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[const char *tmp = heimdal_version;]])], [
2141 AC_DEFINE(HAVE_HEIMDAL)
2142 # XXX - need to check whether -lcrypo is needed!
2143 SUDO_LIBS="${SUDO_LIBS} -lkrb5 -lcrypto -ldes -lcom_err -lasn1"
2144 AC_CHECK_LIB(roken, main, [SUDO_LIBS="${SUDO_LIBS} -lroken"])
2147 SUDO_LIBS="${SUDO_LIBS} -lkrb5 -lk5crypto -lcom_err"
2148 AC_CHECK_LIB(krb5support, main, [SUDO_LIBS="${SUDO_LIBS} -lkrb5support,"])
2150 AUTH_OBJS="$AUTH_OBJS kerb5.o"
2152 LIBS="${LIBS} ${SUDO_LIBS}"
2153 AC_CHECK_FUNCS(krb5_verify_user krb5_init_secure_context krb5_get_init_creds_opt_alloc)
2154 AC_CACHE_CHECK(whether krb5_get_init_creds_opt_free takes a two argument2,
2155 sudo_cv_krb5_get_init_creds_opt_free_two_args, [
2156 AC_TRY_COMPILE([#include <krb5.h>],
2158 krb5_context context = NULL;
2159 krb5_get_init_creds_opt *opts = NULL;
2160 krb5_get_init_creds_opt_free(context, opts);
2162 [sudo_cv_krb5_get_init_creds_opt_free_two_args=yes],
2163 [sudo_cv_krb5_get_init_creds_opt_free_two_args=no]
2167 if test X"$sudo_cv_krb5_get_init_creds_opt_free_two_args" = X"yes"; then
2168 AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS)
2174 dnl extra AFS libs and includes
2176 if test ${with_AFS-'no'} = "yes"; then
2178 # looks like the "standard" place for AFS libs is /usr/afsws/lib
2179 AFSLIBDIRS="/usr/lib/afs /usr/afsws/lib /usr/afsws/lib/afs"
2180 for i in $AFSLIBDIRS; do
2181 if test -d ${i}; then
2182 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [$i])
2183 FOUND_AFSLIBDIR=true
2186 if test -z "$FOUND_AFSLIBDIR"; then
2187 AC_MSG_WARN([Unable to locate AFS libraries, you will have to edit the Makefile and add -L/path/to/afs/libs to SUDO_LDFLAGS or rerun configure with the --with-libpath options.])
2190 # Order is important here. Note that we build AFS_LIBS from right to left
2191 # since AFS_LIBS may be initialized with BSD compat libs that must go last
2192 AFS_LIBS="-laudit ${AFS_LIBS}"
2193 for i in $AFSLIBDIRS; do
2194 if test -f ${i}/util.a; then
2195 AFS_LIBS="${i}/util.a ${AFS_LIBS}"
2200 if test -z "$FOUND_UTIL_A"; then
2201 AFS_LIBS="-lutil ${AFS_LIBS}"
2203 AFS_LIBS="-lkauth -lprot -lubik -lauth -lrxkad -lsys -ldes -lrx -llwp -lcom_err ${AFS_LIBS}"
2205 # AFS includes may live in /usr/include on some machines...
2206 for i in /usr/afsws/include; do
2207 if test -d ${i}; then
2208 CPPFLAGS="${CPPFLAGS} -I${i}"
2209 FOUND_AFSINCDIR=true
2213 if test -z "$FOUND_AFSLIBDIR"; then
2214 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.])
2217 AUTH_OBJS="$AUTH_OBJS afs.o"
2221 dnl extra DCE obj + lib
2222 dnl Order of libs in HP-UX 10.x is important, -ldce must be last.
2224 if test ${with_DCE-'no'} = "yes"; then
2225 DCE_OBJS="${DCE_OBJS} dce_pwent.o"
2226 SUDO_LIBS="${SUDO_LIBS} -ldce"
2227 AUTH_OBJS="$AUTH_OBJS dce.o"
2231 dnl extra S/Key lib and includes
2233 if test ${with_skey-'no'} = "yes"; then
2234 O_LDFLAGS="$LDFLAGS"
2235 if test "$with_skey" != "yes"; then
2236 CPPFLAGS="${CPPFLAGS} -I${with_skey}/include"
2237 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_skey}/lib])
2238 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_skey}/lib])
2239 AC_PREPROC_IFELSE([#include <skey.h>], [found=yes], [found=no])
2242 O_CPPFLAGS="$CPPFLAGS"
2243 for dir in "" "/usr/local" "/usr/contrib"; do
2244 test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include"
2245 AC_PREPROC_IFELSE([#include <skey.h>], [found=yes; break])
2247 if test "$found" = "no" -o -z "$dir"; then
2248 CPPFLAGS="$O_CPPFLAGS"
2250 SUDO_APPEND_LIBPATH(LDFLAGS, [${dir}/lib])
2251 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${dir}/lib])
2254 if test "$found" = "no"; then
2255 AC_MSG_WARN([Unable to locate skey.h, you will have to edit the Makefile and add -I/path/to/skey/includes to CPPFLAGS])
2257 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 SUDO_LDFLAGS])])
2258 AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS))
2259 LDFLAGS="$O_LDFLAGS"
2260 SUDO_LIBS="${SUDO_LIBS} -lskey"
2261 AUTH_OBJS="$AUTH_OBJS rfc1938.o"
2265 dnl extra OPIE lib and includes
2267 if test ${with_opie-'no'} = "yes"; then
2268 O_LDFLAGS="$LDFLAGS"
2269 if test "$with_opie" != "yes"; then
2270 CPPFLAGS="${CPPFLAGS} -I${with_opie}/include"
2271 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_opie}/lib])
2272 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_opie}/lib])
2273 AC_PREPROC_IFELSE([#include <opie.h>], [found=yes], [found=no])
2276 O_CPPFLAGS="$CPPFLAGS"
2277 for dir in "" "/usr/local" "/usr/contrib"; do
2278 test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include"
2279 AC_PREPROC_IFELSE([#include <opie.h>], [found=yes; break])
2281 if test "$found" = "no" -o -z "$dir"; then
2282 CPPFLAGS="$O_CPPFLAGS"
2284 SUDO_APPEND_LIBPATH(LDFLAGS, [${dir}/lib])
2285 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${dir}/lib])
2288 if test "$found" = "no"; then
2289 AC_MSG_WARN([Unable to locate opie.h, you will have to edit the Makefile and add -I/path/to/opie/includes to CPPFLAGS])
2291 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 SUDO_LDFLAGS])])
2292 LDFLAGS="$O_LDFLAGS"
2293 SUDO_LIBS="${SUDO_LIBS} -lopie"
2294 AUTH_OBJS="$AUTH_OBJS rfc1938.o"
2298 dnl Check for shadow password routines if we have not already done so.
2299 dnl If there is a specific list of functions to check we do that first.
2300 dnl Otherwise, we check for SVR4-style and then SecureWare-style.
2302 if test ${with_passwd-'no'} != "no"; then
2304 dnl if crypt(3) not in libc, look elsewhere
2306 if test -z "$LIB_CRYPT" -a "$with_passwd" != "no"; then
2307 AC_SEARCH_LIBS([crypt], [crypt crypt_d ufc], [test -n "$ac_lib" && SUDO_LIBS="${SUDO_LIBS} $ac_res"])
2310 if test "$CHECKSHADOW" = "true" -a -n "$shadow_funcs"; then
2312 LIBS="$LIBS $shadow_libs"
2314 AC_CHECK_FUNCS($shadow_funcs, [found=yes])
2315 if test "$found" = "yes"; then
2316 SUDO_LIBS="$SUDO_LIBS $shadow_libs"
2317 elif test -n "$shadow_libs_optional"; then
2318 LIBS="$LIBS $shadow_libs_optional"
2319 AC_CHECK_FUNCS($shadow_funcs, [found=yes])
2320 if test "$found" = "yes"; then
2321 SUDO_LIBS="$SUDO_LIBS $shadow_libs $shadow_libs_optional"
2324 if test "$found" = "yes"; then
2325 case "$shadow_funcs" in
2326 *getprpwnam*) SECUREWARE=1;;
2328 test -n "$shadow_defs" && OSDEFS="${OSDEFS} $shadow_defs"
2334 if test "$CHECKSHADOW" = "true"; then
2335 AC_SEARCH_LIBS([getspnam], [gen], [AC_DEFINE(HAVE_GETSPNAM)] [CHECKSHADOW=false; test -n "$ac_lib" && SUDO_LIBS="${SUDO_LIBS} $ac_res"])
2337 if test "$CHECKSHADOW" = "true"; then
2338 AC_SEARCH_LIBS([getprpwnam], [sec security prot], [AC_DEFINE(HAVE_GETPRPWNAM)] [CHECKSHADOW=false; SECUREWARE=1; test -n "$ac_lib" && SUDO_LIBS="${SUDO_LIBS} $ac_res"])
2340 if test -n "$SECUREWARE"; then
2341 AC_CHECK_FUNCS(bigcrypt set_auth_parameters initprivs)
2342 AUTH_OBJS="$AUTH_OBJS secureware.o"
2347 dnl extra lib and .o file for LDAP support
2349 if test ${with_ldap-'no'} != "no"; then
2351 if test "$with_ldap" != "yes"; then
2352 SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_ldap}/lib])
2353 SUDO_APPEND_LIBPATH(LDFLAGS, [${with_ldap}/lib])
2354 CPPFLAGS="${CPPFLAGS} -I${with_ldap}/include"
2358 SUDO_OBJS="${SUDO_OBJS} ldap.o"
2360 AC_MSG_CHECKING([for LDAP libraries])
2364 for l in -lldap -llber '-lssl -lcrypto'; do
2366 LDAP_LIBS="${LDAP_LIBS} $l"
2367 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2369 #include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [found=yes; break])
2371 dnl if nothing linked just try with -lldap
2372 if test "$found" = "no"; then
2373 LIBS="${_LIBS} -lldap"
2375 AC_MSG_RESULT([not found, using -lldap])
2377 AC_MSG_RESULT([$LDAP_LIBS])
2379 dnl check if we need to link with -llber for ber_set_option
2381 AC_SEARCH_LIBS([ber_set_option], [lber], [found=yes], [found=no])
2382 if test X"$found" = X"yes" -a X"$LIBS" != X"$OLIBS"; then
2383 LDAP_LIBS="$LDAP_LIBS -llber"
2385 dnl check if ldap.h includes lber.h for us
2386 AC_MSG_CHECKING([whether lber.h is needed])
2387 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
2388 #include <ldap.h>]], [[(void)ldap_init(0, 0)]])], [AC_MSG_RESULT([no])], [
2389 AC_MSG_RESULT([yes])
2390 AC_DEFINE(HAVE_LBER_H)])
2392 AC_CHECK_FUNCS(ldap_initialize ldap_start_tls_s ldap_sasl_interactive_bind_s ldapssl_init ldapssl_set_strength ldap_search_ext_s ldap_unbind_ext_s ldap_str2dn ldap_create ldap_sasl_bind_s)
2393 AC_CHECK_HEADERS([sasl/sasl.h])
2394 AC_CHECK_HEADERS([ldap_ssl.h] [mps/ldap_ssl.h], [break], [], [#include <ldap.h>])
2396 if test X"$check_gss_krb5_ccache_name" = X"yes"; then
2397 AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,
2398 AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME)
2399 [LDAP_LIBS="${LDAP_LIBS} -lgssapi"],
2400 AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,
2401 AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME)
2402 [LDAP_LIBS="${LDAP_LIBS} -lgssapi_krb5"])
2405 # gssapi headers may be separate or part of Kerberos V
2407 O_CPPFLAGS="$CPPFLAGS"
2408 for dir in "" "kerberosV" "krb5" "kerberos5" "kerberosv5"; do
2409 test X"$dir" != X"" && CPPFLAGS="$O_CPPFLAGS -I/usr/include/${dir}"
2410 AC_PREPROC_IFELSE([#include <gssapi/gssapi.h>], [found="gssapi/gssapi.h"; break], [AC_PREPROC_IFELSE([#include <gssapi.h>], [found="gssapi.h"; break])])
2412 if test X"$found" != X"no"; then
2413 AC_CHECK_HEADERS([$found])
2414 if test X"$found" = X"gssapi/gssapi.h"; then
2415 AC_CHECK_HEADERS([gssapi/gssapi_krb5.h])
2418 CPPFLAGS="$O_CPPFLAGS"
2419 AC_MSG_WARN([Unable to locate gssapi.h, you will have to edit the Makefile and add -I/path/to/gssapi/includes to CPPFLAGS])
2423 SUDO_LIBS="${SUDO_LIBS} ${LDAP_LIBS}"
2429 dnl Add $blibpath to SUDO_LDFLAGS if specified by the user or if we
2430 dnl added -L dirpaths to SUDO_LDFLAGS.
2432 if test -n "$blibpath"; then
2433 if test -n "$blibpath_add"; then
2434 SUDO_LDFLAGS="$SUDO_LDFLAGS -Wl,-blibpath:${blibpath}${blibpath_add}"
2435 elif test -n "$with_blibpath" -a "$with_blibpath" != "yes"; then
2436 SUDO_LDFLAGS="$SUDO_LDFLAGS -Wl,-blibpath:${blibpath}"
2441 dnl Check for log file and timestamp locations
2447 dnl Use passwd (and secureware) auth modules?
2449 case "$with_passwd" in
2451 AUTH_OBJS="$AUTH_OBJS passwd.o"
2454 AC_DEFINE(WITHOUT_PASSWD)
2455 if test -z "$AUTH_OBJS"; then
2456 AC_MSG_ERROR([no authentication methods defined.])
2460 AUTH_OBJS=${AUTH_OBJS# }
2461 _AUTH=`echo "$AUTH_OBJS" | sed 's/\.o//g'`
2462 AC_MSG_NOTICE([using the following authentication methods: $_AUTH])
2465 dnl LIBS may contain duplicates from SUDO_LIBS or NET_LIBS so prune it.
2467 if test -n "$LIBS"; then
2472 for sl in ${SUDO_LIBS} ${NET_LIBS}; do
2473 test $l = $sl && dupe=1
2475 test $dupe = 0 && LIBS="${LIBS} $l"
2482 test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
2485 dnl Defer setting _PATH_SUDO_NOEXEC until after exec_prefix is set
2486 dnl XXX - this is gross!
2488 if test X"$with_noexec" != X"no" -o X"$with_selinux" != X"no"; then
2489 oexec_prefix="$exec_prefix"
2490 if test "$exec_prefix" = '$(prefix)'; then
2491 if test "$prefix" = "NONE"; then
2492 exec_prefix="$ac_default_prefix"
2494 exec_prefix="$prefix"
2497 if test X"$with_noexec" != X"no"; then
2498 PROGS="${PROGS} sudo_noexec.la"
2499 INSTALL_NOEXEC="install-noexec"
2501 eval noexec_file="$with_noexec"
2502 AC_DEFINE_UNQUOTED(_PATH_SUDO_NOEXEC, "$noexec_file", [The fully qualified pathname of sudo_noexec.so])
2504 if test X"$with_selinux" != X"no"; then
2505 eval sesh_file="$libexecdir/sesh"
2506 AC_DEFINE_UNQUOTED(_PATH_SUDO_SESH, "$sesh_file", [The fully qualified pathname of sesh])
2508 exec_prefix="$oexec_prefix"
2512 dnl Substitute into the Makefile and man pages
2514 AC_CONFIG_FILES([Makefile sudo.man visudo.man sudoers.man sudoers.ldap.man sudo_usage.h])
2518 dnl Spew any text the user needs to know about
2520 if test "$with_pam" = "yes"; then
2523 AC_MSG_NOTICE([You will need to customize sample.pam and install it as /etc/pam.d/sudo])
2529 dnl Autoheader templates
2531 AH_TEMPLATE(BROKEN_SYSLOG, [Define to 1 if the `syslog' function returns a non-zero int to denote failure.])
2532 AH_TEMPLATE(CLASSIC_INSULTS, [Define to 1 if you want the insults from the "classic" version sudo.])
2533 AH_TEMPLATE(CSOPS_INSULTS, [Define to 1 if you want insults culled from the twisted minds of CSOps.])
2534 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.])
2535 AH_TEMPLATE(ENV_EDITOR, [Define to 1 if you want visudo to honor the EDITOR and VISUAL env variables.])
2536 AH_TEMPLATE(FQDN, [Define to 1 if you want to require fully qualified hosts in sudoers.])
2537 AH_TEMPLATE(GOONS_INSULTS, [Define to 1 if you want insults from the "Goon Show".])
2538 AH_TEMPLATE(HAL_INSULTS, [Define to 1 if you want 2001-like insults.])
2539 AH_TEMPLATE(HAVE_AFS, [Define to 1 if you use AFS.])
2540 AH_TEMPLATE(HAVE_AIXAUTH, [Define to 1 if you use AIX general authentication.])
2541 AH_TEMPLATE(HAVE_BSD_AUTH_H, [Define to 1 if you use BSD authentication.])
2542 AH_TEMPLATE(HAVE_DCE, [Define to 1 if you use OSF DCE.])
2543 AH_TEMPLATE(HAVE_DD_FD, [Define to 1 if your `DIR' contains dd_fd.])
2544 AH_TEMPLATE(HAVE_DIRFD, [Define to 1 if you have the `dirfd' function or macro.])
2545 AH_TEMPLATE(HAVE_DGETTEXT, [Define to 1 if you have the `dgettext' function.])
2546 AH_TEMPLATE(HAVE_DISPCRYPT, [Define to 1 if you have the `dispcrypt' function.])
2547 AH_TEMPLATE(HAVE_EXTENDED_GLOB, [Define to 1 if your glob.h defines the GLOB_BRACE and GLOB_TILDE flags.])
2548 AH_TEMPLATE(HAVE_FCNTL_CLOSEM, [Define to 1 if your system has the F_CLOSEM fcntl.])
2549 AH_TEMPLATE(HAVE_FNMATCH, [Define to 1 if you have the `fnmatch' function.])
2550 AH_TEMPLATE(HAVE_FWTK, [Define to 1 if you use the FWTK authsrv daemon.])
2551 AH_TEMPLATE(HAVE_GETAUTHUID, [Define to 1 if you have the `getauthuid' function. (ULTRIX 4.x shadow passwords)])
2552 AH_TEMPLATE(HAVE_GETPRPWNAM, [Define to 1 if you have the `getprpwnam' function. (SecureWare-style shadow passwords)])
2553 AH_TEMPLATE(HAVE_GETPWANAM, [Define to 1 if you have the `getpwanam' function. (SunOS 4.x shadow passwords)])
2554 AH_TEMPLATE(HAVE_GETSPNAM, [Define to 1 if you have the `getspnam' function (SVR4-style shadow passwords)])
2555 AH_TEMPLATE(HAVE_GETSPWUID, [Define to 1 if you have the `getspwuid' function. (HP-UX <= 9.X shadow passwords)])
2556 AH_TEMPLATE(HAVE_GSS_KRB5_CCACHE_NAME, [Define to 1 if you have the `gss_krb5_ccache_name' function.])
2557 AH_TEMPLATE(HAVE_HEIMDAL, [Define to 1 if your Kerberos is Heimdal.])
2558 AH_TEMPLATE(HAVE_IN6_ADDR, [Define to 1 if <netinet/in.h> contains struct in6_addr.])
2559 AH_TEMPLATE(HAVE_ISCOMSEC, [Define to 1 if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled)])
2560 AH_TEMPLATE(HAVE_ISSECURE, [Define to 1 if you have the `issecure' function. (SunOS 4.x check for shadow enabled)])
2561 AH_TEMPLATE(HAVE_KERB4, [Define to 1 if you use Kerberos IV.])
2562 AH_TEMPLATE(HAVE_KERB5, [Define to 1 if you use Kerberos V.])
2563 AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC, [Define to 1 if you have the `krb5_get_init_creds_opt_alloc' function.])
2564 AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS, [Define to 1 if your `krb5_get_init_creds_opt_alloc' function takes two arguments.])
2565 AH_TEMPLATE(HAVE_KRB5_INIT_SECURE_CONTEXT, [Define to 1 if you have the `krb5_init_secure_context' function.])
2566 AH_TEMPLATE(HAVE_KRB5_VERIFY_USER, [Define to 1 if you have the `krb5_verify_user' function.])
2567 AH_TEMPLATE(HAVE_LBER_H, [Define to 1 if your LDAP needs <lber.h>. (OpenLDAP does not)])
2568 AH_TEMPLATE(HAVE_LDAP, [Define to 1 if you use LDAP for sudoers.])
2569 AH_TEMPLATE(HAVE_OPIE, [Define to 1 if you use NRL OPIE.])
2570 AH_TEMPLATE(HAVE_PAM, [Define to 1 if you use PAM authentication.])
2571 AH_TEMPLATE(HAVE_PROJECT_H, [Define to 1 if you have the <project.h> header file.])
2572 AH_TEMPLATE(HAVE_SECURID, [Define to 1 if you use SecurID for authentication.])
2573 AH_TEMPLATE(HAVE_SELINUX, [Define to 1 to enable SELinux RBAC support.])
2574 AH_TEMPLATE(HAVE_SIGACTION_T, [Define to 1 if <signal.h> has the sigaction_t typedef.])
2575 AH_TEMPLATE(HAVE_SKEY, [Define to 1 if you use S/Key.])
2576 AH_TEMPLATE(HAVE_SKEYACCESS, [Define to 1 if your S/Key library has skeyaccess().])
2577 AH_TEMPLATE(HAVE_ST__TIM, [Define to 1 if your struct stat uses an st__tim union])
2578 AH_TEMPLATE(HAVE_ST_MTIM, [Define to 1 if your struct stat has an st_mtim member])
2579 AH_TEMPLATE(HAVE_ST_MTIMESPEC, [Define to 1 if your struct stat has an st_mtimespec member])
2580 AH_TEMPLATE(HAVE_TERMIOS_H, [Define to 1 if you have the <termios.h> header file and the `tcgetattr' function.])
2581 AH_TEMPLATE(HAVE_TIMESPEC, [Define to 1 if you have struct timespec in sys/time.h])
2582 AH_TEMPLATE(HAVE_TIMESPECSUB2, [Define to 1 if you have a timespecsub macro or function that takes two arguments (not three)])
2583 AH_TEMPLATE(HAVE___PROGNAME, [Define to 1 if your crt0.o defines the __progname symbol for you.])
2584 AH_TEMPLATE(HOST_IN_LOG, [Define to 1 if you want the hostname to be entered into the log file.])
2585 AH_TEMPLATE(IGNORE_DOT_PATH, [Define to 1 if you want to ignore '.' and empty PATH elements])
2586 AH_TEMPLATE(LOGGING, [Define to SLOG_SYSLOG, SLOG_FILE, or SLOG_BOTH.])
2587 AH_TEMPLATE(LONG_OTP_PROMPT, [Define to 1 if you want a two line OTP (S/Key or OPIE) prompt.])
2588 AH_TEMPLATE(NO_AUTHENTICATION, [Define to 1 if you don't want sudo to prompt for a password by default.])
2589 AH_TEMPLATE(NO_LECTURE, [Define to 1 if you don't want users to get the lecture the first they user sudo.])
2590 AH_TEMPLATE(NO_ROOT_MAILER, [Define to avoid runing the mailer as root.])
2591 AH_TEMPLATE(NO_ROOT_SUDO, [Define to 1 if root should not be allowed to use sudo.])
2592 AH_TEMPLATE(PC_INSULTS, [Define to 1 to replace politically incorrect insults with less offensive ones.])
2593 AH_TEMPLATE(SECURE_PATH, [Define to 1 to override the user's path with a built-in one.])
2594 AH_TEMPLATE(SEND_MAIL_WHEN_NOT_OK, [Define to 1 to send mail when the user is not allowed to run a command.])
2595 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.])
2596 AH_TEMPLATE(SEND_MAIL_WHEN_NO_USER, [Define to 1 to send mail when the user is not in the sudoers file.])
2597 AH_TEMPLATE(SHELL_IF_NO_ARGS, [Define to 1 if you want sudo to start a shell if given no arguments.])
2598 AH_TEMPLATE(SHELL_SETS_HOME, [Define to 1 if you want sudo to set $HOME in shell mode.])
2599 AH_TEMPLATE(STUB_LOAD_INTERFACES, [Define to 1 if the code in interfaces.c does not compile for you.])
2600 AH_TEMPLATE(USE_INSULTS, [Define to 1 if you want to insult the user for entering an incorrect password.])
2601 AH_TEMPLATE(USE_STOW, [Define to 1 if you use GNU stow packaging.])
2602 AH_TEMPLATE(USE_TTY_TICKETS, [Define to 1 if you want a different ticket file for each tty.])
2603 AH_TEMPLATE(WITHOUT_PASSWD, [Define to avoid using the passwd/shadow file for authentication.])
2604 AH_TEMPLATE(sig_atomic_t, [Define to `int' if <signal.h> does not define.])
2605 AH_TEMPLATE(__signed, [Define to `signed' or nothing if compiler does not support a signed type qualifier.])
2608 dnl Bits to copy verbatim into config.h.in
2610 AH_TOP([#ifndef _SUDO_CONFIG_H
2611 #define _SUDO_CONFIG_H])
2614 * Macros to pull sec and nsec parts of mtime from struct stat.
2615 * We need to be able to convert between timeval and timespec
2616 * so the last 3 digits of tv_nsec are not significant.
2619 # ifdef HAVE_ST__TIM
2620 # define mtim_getsec(_x) ((_x).st_mtim.st__tim.tv_sec)
2621 # define mtim_getnsec(_x) (((_x).st_mtim.st__tim.tv_nsec / 1000) * 1000)
2623 # define mtim_getsec(_x) ((_x).st_mtim.tv_sec)
2624 # define mtim_getnsec(_x) (((_x).st_mtim.tv_nsec / 1000) * 1000)
2627 # ifdef HAVE_ST_MTIMESPEC
2628 # define mtim_getsec(_x) ((_x).st_mtimespec.tv_sec)
2629 # define mtim_getnsec(_x) (((_x).st_mtimespec.tv_nsec / 1000) * 1000)
2631 # define mtim_getsec(_x) ((_x).st_mtime)
2632 # define mtim_getnsec(_x) (0)
2633 # endif /* HAVE_ST_MTIMESPEC */
2634 #endif /* HAVE_ST_MTIM */
2637 * Emulate a subset of waitpid() if we don't have it.
2640 # define sudo_waitpid(p, s, o) waitpid(p, s, o)
2643 # define sudo_waitpid(p, s, o) wait3(s, o, NULL)
2647 /* GNU stow needs /etc/sudoers to be a symlink. */
2649 # define stat_sudoers stat
2651 # define stat_sudoers lstat
2654 /* Macros to set/clear/test flags. */
2656 #define SET(t, f) ((t) |= (f))
2658 #define CLR(t, f) ((t) &= ~(f))
2660 #define ISSET(t, f) ((t) & (f))
2662 /* New ANSI-style OS defs for HP-UX and ConvexOS. */
2663 #if defined(hpux) && !defined(__hpux)
2667 #if defined(convex) && !defined(__convex__)
2668 # define __convex__ 1
2671 /* BSD compatibility on some SVR4 systems. */
2674 #endif /* __svr4__ */
2676 #endif /* _SUDO_CONFIG_H */])