AC_DEFUN(SUDO_PROG_SENDMAIL, [AC_MSG_CHECKING(for sendmail)
if test -f "/usr/sbin/sendmail"; then
AC_MSG_RESULT(/usr/sbin/sendmail)
- AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/sbin/sendmail")
+ SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/sbin/sendmail")
elif test -f "/usr/lib/sendmail"; then
AC_MSG_RESULT(/usr/lib/sendmail)
- AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/lib/sendmail")
+ SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/lib/sendmail")
elif test -f "/usr/etc/sendmail"; then
AC_MSG_RESULT(/usr/etc/sendmail)
- AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/etc/sendmail")
+ SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/etc/sendmail")
elif test -f "/usr/ucblib/sendmail"; then
AC_MSG_RESULT(/usr/ucblib/sendmail)
- AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/ucblib/sendmail")
+ SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/ucblib/sendmail")
elif test -f "/usr/local/lib/sendmail"; then
AC_MSG_RESULT(/usr/local/lib/sendmail)
- AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/local/lib/sendmail")
+ SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/local/lib/sendmail")
elif test -f "/usr/local/bin/sendmail"; then
AC_MSG_RESULT(/usr/local/bin/sendmail)
- AC_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/local/bin/sendmail")
+ SUDO_DEFINE(_PATH_SUDO_SENDMAIL, "/usr/local/bin/sendmail")
else
AC_MSG_RESULT(not found)
fi
AC_DEFUN(SUDO_PROG_VI, [AC_MSG_CHECKING(for vi)
if test -f "/usr/bin/vi"; then
AC_MSG_RESULT(/usr/bin/vi)
- AC_DEFINE(_PATH_VI, "/usr/bin/vi")
+ SUDO_DEFINE(_PATH_VI, "/usr/bin/vi")
elif test -f "/usr/ucb/vi"; then
AC_MSG_RESULT(/usr/ucb/vi)
- AC_DEFINE(_PATH_VI, "/usr/ucb/vi")
+ SUDO_DEFINE(_PATH_VI, "/usr/ucb/vi")
elif test -f "/usr/bsd/vi"; then
AC_MSG_RESULT(/usr/bsd/vi)
- AC_DEFINE(_PATH_VI, "/usr/bsd/vi")
+ SUDO_DEFINE(_PATH_VI, "/usr/bsd/vi")
elif test -f "/bin/vi"; then
AC_MSG_RESULT(/bin/vi)
- AC_DEFINE(_PATH_VI, "/bin/vi")
+ SUDO_DEFINE(_PATH_VI, "/bin/vi")
elif test -f "/usr/local/bin/vi"; then
AC_MSG_RESULT(/usr/local/bin/vi)
- AC_DEFINE(_PATH_VI, "/usr/local/bin/vi")
+ SUDO_DEFINE(_PATH_VI, "/usr/local/bin/vi")
else
AC_MSG_RESULT(not found)
fi
AC_DEFUN(SUDO_PROG_MV, [AC_MSG_CHECKING(for mv)
if test -f "/usr/bin/mv"; then
AC_MSG_RESULT(/usr/bin/mv)
- AC_DEFINE(_PATH_MV, "/usr/bin/mv")
+ SUDO_DEFINE(_PATH_MV, "/usr/bin/mv")
elif test -f "/bin/mv"; then
AC_MSG_RESULT(/bin/mv)
- AC_DEFINE(_PATH_MV, "/bin/mv")
+ SUDO_DEFINE(_PATH_MV, "/bin/mv")
elif test -f "/usr/ucb/mv"; then
AC_MSG_RESULT(/usr/ucb/mv)
- AC_DEFINE(_PATH_MV, "/usr/ucb/mv")
+ SUDO_DEFINE(_PATH_MV, "/usr/ucb/mv")
elif test -f "/usr/sbin/mv"; then
AC_MSG_RESULT(/usr/sbin/mv)
- AC_DEFINE(_PATH_MV, "/usr/sbin/mv")
+ SUDO_DEFINE(_PATH_MV, "/usr/sbin/mv")
else
AC_MSG_RESULT(not found)
fi
AC_DEFUN(SUDO_PROG_BSHELL, [AC_MSG_CHECKING(for bourne shell)
if test -f "/bin/sh"; then
AC_MSG_RESULT(/bin/sh)
- AC_DEFINE(_PATH_BSHELL, "/bin/sh")
+ SUDO_DEFINE(_PATH_BSHELL, "/bin/sh")
elif test -f "/usr/bin/sh"; then
AC_MSG_RESULT(/usr/bin/sh)
- AC_DEFINE(_PATH_BSHELL, "/usr/bin/sh")
+ SUDO_DEFINE(_PATH_BSHELL, "/usr/bin/sh")
elif test -f "/sbin/sh"; then
AC_MSG_RESULT(/sbin/sh)
- AC_DEFINE(_PATH_BSHELL, "/sbin/sh")
+ SUDO_DEFINE(_PATH_BSHELL, "/sbin/sh")
elif test -f "/usr/sbin/sh"; then
AC_MSG_RESULT(/usr/sbin/sh)
- AC_DEFINE(_PATH_BSHELL, "/usr/sbin/sh")
+ SUDO_DEFINE(_PATH_BSHELL, "/usr/sbin/sh")
elif test -f "/bin/ksh"; then
AC_MSG_RESULT(/bin/ksh)
- AC_DEFINE(_PATH_BSHELL, "/bin/ksh")
+ SUDO_DEFINE(_PATH_BSHELL, "/bin/ksh")
elif test -f "/usr/bin/ksh"; then
AC_MSG_RESULT(/usr/bin/ksh)
- AC_DEFINE(_PATH_BSHELL, "/usr/bin/ksh")
+ SUDO_DEFINE(_PATH_BSHELL, "/usr/bin/ksh")
elif test -f "/bin/bash"; then
AC_MSG_RESULT(/bin/bash)
- AC_DEFINE(_PATH_BSHELL, "/bin/bash")
+ SUDO_DEFINE(_PATH_BSHELL, "/bin/bash")
elif test -f "/usr/bin/bash"; then
AC_MSG_RESULT(/usr/bin/bash)
- AC_DEFINE(_PATH_BSHELL, "/usr/bin/bash")
+ SUDO_DEFINE(_PATH_BSHELL, "/usr/bin/bash")
else
AC_MSG_RESULT(not found)
fi
AC_DEFUN(SUDO_LOGFILE, [AC_MSG_CHECKING(for log file location)
if test -n "$with_logpath"; then
AC_MSG_RESULT($with_logpath)
- AC_DEFINE_UNQUOTED(_PATH_SUDO_LOGFILE, "$with_logpath")
+ SUDO_DEFINE_UNQUOTED(_PATH_SUDO_LOGFILE, "$with_logpath")
elif test -d "/var/log"; then
AC_MSG_RESULT(/var/log/sudo.log)
- AC_DEFINE(_PATH_SUDO_LOGFILE, "/var/log/sudo.log")
+ SUDO_DEFINE(_PATH_SUDO_LOGFILE, "/var/log/sudo.log")
elif test -d "/var/adm"; then
AC_MSG_RESULT(/var/adm/sudo.log)
- AC_DEFINE(_PATH_SUDO_LOGFILE, "/var/adm/sudo.log")
+ SUDO_DEFINE(_PATH_SUDO_LOGFILE, "/var/adm/sudo.log")
elif test -d "/usr/adm"; then
AC_MSG_RESULT(/usr/adm/sudo.log)
- AC_DEFINE(_PATH_SUDO_LOGFILE, "/usr/adm/sudo.log")
+ SUDO_DEFINE(_PATH_SUDO_LOGFILE, "/usr/adm/sudo.log")
else
AC_MSG_RESULT(unknown, you will have to set _PATH_SUDO_LOGFILE by hand)
fi
AC_DEFUN(SUDO_TIMEDIR, [AC_MSG_CHECKING(for timestamp file location)
if test -n "$with_timedir"; then
AC_MSG_RESULT($with_timedir)
- AC_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir")
+ SUDO_DEFINE_UNQUOTED(_PATH_SUDO_TIMEDIR, "$with_timedir")
timedir="$with_timedir"
elif test -d "/var/run"; then
AC_MSG_RESULT(/var/run/sudo)
- AC_DEFINE(_PATH_SUDO_TIMEDIR, "/var/run/sudo")
+ SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/var/run/sudo")
timedir="/var/run/sudo"
else
AC_MSG_RESULT(/tmp/.odus)
- AC_DEFINE(_PATH_SUDO_TIMEDIR, "/tmp/.odus")
+ SUDO_DEFINE(_PATH_SUDO_TIMEDIR, "/tmp/.odus")
timedir="/tmp/.odus"
fi
])dnl
dnl
AC_DEFUN(SUDO_FULL_VOID, [AC_MSG_CHECKING(for full void implementation)
AC_TRY_COMPILE(, [void *foo;
-foo = (void *)0; (void *)"test";], AC_DEFINE(VOID, void)
+foo = (void *)0; (void *)"test";], AC_DEFINE(VOID, void, [Define to "void" if your compiler supports void pointers, else use "char"].)
AC_MSG_RESULT(yes), AC_DEFINE(VOID, char)
AC_MSG_RESULT(no))])
#endif], sudo_cv_type_$1=yes, sudo_cv_type_$1=no)])dnl
AC_MSG_RESULT($sudo_cv_type_$1)
if test $sudo_cv_type_$1 = no; then
- AC_DEFINE($1, $2)
+ AC_DEFINE($1, $2, [Define if your system lacks the $1 type.])
fi
])
rm -f core core.* *.core])dnl
AC_MSG_RESULT($sudo_cv_func_utime_posix)
if test $sudo_cv_func_utime_posix = yes; then
- AC_DEFINE(HAVE_UTIME_POSIX)
+ AC_DEFINE(HAVE_UTIME_POSIX, 1, [Define if you have a POSIX utime() (uses struct utimbuf).])
fi
])
sudo_cv_func_isblank=yes, sudo_cv_func_isblank=no)])
] [
if test "$sudo_cv_func_isblank" = "yes"; then
- AC_DEFINE(HAVE_ISBLANK)
+ AC_DEFINE(HAVE_ISBLANK, 1, [Define if you have isblank(3).])
fi
])
rm -f core core.* *.core])dnl
AC_MSG_RESULT($sudo_cv_sock_sa_len)
if test $sudo_cv_sock_sa_len = yes; then
- AC_DEFINE(HAVE_SA_LEN)
+ AC_DEFINE(HAVE_SA_LEN, 1, [Define if your struct sockadr has an sa_len field.])
fi
])
])
rm -f conftestdata
AC_MSG_RESULT($sudo_cv_uid_t_len)
-AC_DEFINE_UNQUOTED(MAX_UID_T_LEN, $sudo_cv_uid_t_len)
+AC_DEFINE_UNQUOTED(MAX_UID_T_LEN, $sudo_cv_uid_t_len, [Define to the max length of a uid_t in string context (excluding the NUL).])
])
dnl
dnl XXX hard to cache since it includes 2 tests
dnl
AC_DEFUN(SUDO_LONG_LONG, [AC_MSG_CHECKING(for long long support)
-AC_TRY_LINK(, [long long foo = 1000; foo /= 10;], AC_DEFINE(HAVE_LONG_LONG)
-[AC_TRY_RUN([main() {if (sizeof(long long) == sizeof(long)) exit(0); else exit(1);}], AC_DEFINE(LONG_IS_QUAD))]
+AC_TRY_LINK(, [long long foo = 1000; foo /= 10;], AC_DEFINE(HAVE_LONG_LONG, 1, [Define if your compiler supports the "long long" type.])
+[AC_TRY_RUN([main() {if (sizeof(long long) == sizeof(long)) exit(0); else exit(1);}], AC_DEFINE(LONG_IS_QUAD, 1, [Define if sizeof(long) == sizeof(long long).]))]
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))])
+
+dnl
+dnl private versions of AC_DEFINE and AC_DEFINE_UNQUOTED that don't support
+dnl tracing that we use to define paths for pathnames.h so autoheader doesn't
+dnl put them in config.h.in. An awful hack.
+dnl
+m4_define([SUDO_DEFINE],
+[cat >>confdefs.h <<\EOF
+[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1)
+EOF
+])
+
+m4_define([SUDO_DEFINE_UNQUOTED],
+[cat >>confdefs.h <<EOF
+[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1)
+EOF
+])
dnl Process this file with GNU autoconf to produce a configure script.
dnl $Sudo$
dnl
-dnl Copyright (c) 1994-1996,1998-2001 Todd C. Miller <Todd.Miller@courtesan.com>
+dnl Copyright (c) 1994-1996,1998-2002 Todd C. Miller <Todd.Miller@courtesan.com>
dnl
-AC_INIT(sudo.h)
+AC_INIT(sudo, 1.6.4)
AC_CONFIG_HEADER(config.h pathnames.h)
dnl
dnl This won't work before AC_INIT()
AC_ARG_WITH(otp-only, [ --with-otp-only deprecated],
[case $with_otp_only in
yes) with_passwd=no
- AC_DEFINE(WITHOUT_PASSWD)
+ AC_DEFINE(WITHOUT_PASSWD, 1, [Define to avoid using the passwd/shadow file for authentication.])
AC_MSG_WARN([--with-otp-only option deprecated, treating as --without-passwd])
;;
esac])
AC_ARG_WITH(alertmail, [ --with-alertmail deprecated],
[case $with_alertmail in
*) with_mailto="$with_alertmail"
- AC_DEFINE(WITHOUT_PASSWD)
AC_MSG_WARN([--with-alertmail option deprecated, treating as --mailto])
;;
esac])
yes) if test -n "$with_opie"; then
AC_MSG_ERROR(["cannot use both S/Key and OPIE"])
fi
- AC_DEFINE(HAVE_SKEY)
+ AC_DEFINE(HAVE_SKEY, 1, [Define if you use S/Key.])
AC_MSG_CHECKING(whether to try S/Key authentication)
AC_MSG_RESULT(yes)
AUTH_OBJS="${AUTH_OBJS} rfc1938.o"
yes) if test -n "$with_skey"; then
AC_MSG_ERROR(["cannot use both S/Key and OPIE"])
fi
- AC_DEFINE(HAVE_OPIE)
+ AC_DEFINE(HAVE_OPIE, 1, [Define if you use NRL OPIE.])
AC_MSG_CHECKING(whether to try NRL OPIE authentication)
AC_MSG_RESULT(yes)
AUTH_OBJS="${AUTH_OBJS} rfc1938.o"
AC_ARG_WITH(long-otp-prompt, [ --with-long-otp-prompt use a two line OTP (skey/opie) prompt],
[case $with_long_otp_prompt in
- yes) AC_DEFINE(LONG_OTP_PROMPT)
+ yes) AC_DEFINE(LONG_OTP_PROMPT, 1, [Define if you want a two line OTP (S/Key or OPIE) prompt.])
AC_MSG_CHECKING(whether to use a two line prompt for OTP authentication)
AC_MSG_RESULT(yes)
long_otp_prompt=on
AC_ARG_WITH(SecurID, [ --with-SecurID enable SecurID support],
[case $with_SecurID in
no) ;;
- *) AC_DEFINE(HAVE_SECURID)
+ *) AC_DEFINE(HAVE_SECURID, 1, [Define if you use SecurID.])
AC_MSG_CHECKING(whether to use SecurID for authentication)
AC_MSG_RESULT(yes)
with_passwd=no
AC_ARG_WITH(fwtk, [ --with-fwtk enable FWTK AuthSRV support],
[case $with_fwtk in
- yes) AC_DEFINE(HAVE_FWTK)
- AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication)
- AC_MSG_RESULT(yes)
- with_passwd=no
- AUTH_OBJS="fwtk.o"
- ;;
no) ;;
- *) AC_DEFINE(HAVE_FWTK)
+ *) AC_DEFINE(HAVE_FWTK, 1, [Define if you use the FWTK authsrv daemon.])
AC_MSG_CHECKING(whether to use FWTK AuthSRV for authentication)
AC_MSG_RESULT(yes)
- SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${with_fwtk}"
- CPPFLAGS="${CPPFLAGS} -I${with_fwtk}"
with_passwd=no
AUTH_OBJS="fwtk.o"
- with_fwtk=yes
+ if test "$with_fwtk" != "yes"; then
+ SUDO_LDFLAGS="${SUDO_LDFLAGS} -L${with_fwtk}"
+ CPPFLAGS="${CPPFLAGS} -I${with_fwtk}"
+ with_fwtk=yes
+ fi
;;
esac])
AC_ARG_WITH(authenticate, [ --with-authenticate enable AIX general authentication support],
[case $with_authenticate in
- yes) AC_DEFINE(HAVE_AUTHENTICATE)
+ yes) AC_DEFINE(HAVE_AUTHENTICATE, 1, [Define if you use AIX general authentication.])
AC_MSG_CHECKING(whether to use AIX general authentication)
AC_MSG_RESULT(yes)
with_passwd=no
AC_ARG_WITH(pam, [ --with-pam enable PAM support],
[case $with_pam in
- yes) AC_DEFINE(HAVE_PAM)
+ yes) AC_DEFINE(HAVE_PAM, 1, [Define if you use PAM.])
AC_MSG_CHECKING(whether to use PAM authentication)
AC_MSG_RESULT(yes)
with_passwd=no
AC_ARG_WITH(AFS, [ --with-AFS enable AFS support],
[case $with_AFS in
- yes) AC_DEFINE(HAVE_AFS)
+ yes) AC_DEFINE(HAVE_AFS, 1, [Define if you use AFS.])
AC_MSG_CHECKING(whether to try AFS (kerberos) authentication)
AC_MSG_RESULT(yes)
AUTH_OBJS="${AUTH_OBJS} afs.o"
AC_ARG_WITH(DCE, [ --with-DCE enable DCE support],
[case $with_DCE in
- yes) AC_DEFINE(HAVE_DCE)
+ yes) AC_DEFINE(HAVE_DCE, 1, [Define if you use OSF DCE.])
AC_MSG_CHECKING(whether to try DCE (kerberos) authentication)
AC_MSG_RESULT(yes)
AUTH_OBJS="${AUTH_OBJS} dce.o"
if test "$lecture" = "on"; then
AC_MSG_RESULT(yes)
else
- AC_DEFINE(NO_LECTURE)
+ AC_DEFINE(NO_LECTURE, 1, [Define if you don't want users to get the lecture the first they user sudo.])
AC_MSG_RESULT(no)
fi
;;
no) AC_MSG_ERROR(["--without-logging not supported."])
;;
- syslog) AC_DEFINE(LOGGING, SLOG_SYSLOG)
+ syslog) AC_DEFINE(LOGGING, SLOG_SYSLOG, [Define to SLOG_SYSLOG, SLOG_FILE, or SLOG_BOTH.])
AC_MSG_RESULT(syslog)
;;
file) AC_DEFINE(LOGGING, SLOG_FILE)
*) AC_MSG_ERROR(["$with_logfac is not a supported syslog facility."])
;;
esac])
-AC_DEFINE_UNQUOTED(LOGFAC, "$logfac")
+AC_DEFINE_UNQUOTED(LOGFAC, "$logfac", [The syslog facility sudo will use.])
AC_MSG_RESULT($logfac)
AC_MSG_CHECKING(at which syslog priority to log commands)
*) AC_MSG_ERROR(["$with_goodpri is not a supported syslog priority."])
;;
esac])
-AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri")
+AC_DEFINE_UNQUOTED(PRI_SUCCESS, "$goodpri", [The syslog priority sudo will use for successful attempts.])
AC_MSG_RESULT($goodpri)
AC_MSG_CHECKING(at which syslog priority to log failures)
*) AC_MSG_ERROR([$with_badpri is not a supported syslog priority.])
;;
esac])
-AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri")
+AC_DEFINE_UNQUOTED(PRI_FAILURE, "$badpri", [The syslog priority sudo will use for unsuccessful attempts/errors.])
AC_MSG_RESULT(badpri)
AC_ARG_WITH(logpath, [ --with-logpath path to the sudo log file],
*) AC_MSG_ERROR(["you must enter a number, not $with_loglen"])
;;
esac])
-AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen)
+AC_DEFINE_UNQUOTED(MAXLOGFILELEN, $loglen, [The max number of chars per log file line (for line wrapping).])
AC_MSG_RESULT($loglen)
AC_MSG_CHECKING(whether sudo should ignore '.' or '' in \$PATH)
;;
esac])
if test "$ignore_dot" = "on"; then
- AC_DEFINE(IGNORE_DOT_PATH)
+ AC_DEFINE(IGNORE_DOT_PATH, 1, [Define if you want to ignore '.' and empty \$PATH elements])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
;;
esac])
if test "$mail_no_user" = "on"; then
- AC_DEFINE(SEND_MAIL_WHEN_NO_USER)
+ AC_DEFINE(SEND_MAIL_WHEN_NO_USER, 1, [Define to send mail when the user is not in the sudoers file.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
;;
esac])
if test "$mail_no_host" = "on"; then
- AC_DEFINE(SEND_MAIL_WHEN_NO_HOST)
+ AC_DEFINE(SEND_MAIL_WHEN_NO_HOST, 1, [Define to send mail when the user is not not allowed to run sudo on this host.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
;;
esac])
if test "$mail_noperms" = "on"; then
- AC_DEFINE(SEND_MAIL_WHEN_NOT_OK)
+ AC_DEFINE(SEND_MAIL_WHEN_NOT_OK, 1, [Define to send mail when the user is not not allowed to run a command.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
*) mailto=$with_mailto
;;
esac])
-AC_DEFINE_UNQUOTED(MAILTO, "$mailto")
+AC_DEFINE_UNQUOTED(MAILTO, "$mailto", [The user or email address that sudo mail is sent to.])
AC_MSG_RESULT([$mailto])
AC_ARG_WITH(mailsubject, [ --with-mailsubject subject of sudo mail],
AC_MSG_RESULT([Using alert mail subject: $mailsub])
;;
esac])
-AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub")
+AC_DEFINE_UNQUOTED(MAILSUBJECT, "$mailsub", [The subject of the mail sent by sudo to the MAILTO user/address.])
AC_MSG_CHECKING(for bad password prompt)
AC_ARG_WITH(passprompt, [ --with-passprompt default password prompt],
*) passprompt="$with_passprompt"
esac])
AC_MSG_RESULT($passprompt)
-AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt")
+AC_DEFINE_UNQUOTED(PASSPROMPT, "$passprompt", [The default password prompt.])
AC_MSG_CHECKING(for bad password message)
AC_ARG_WITH(badpass-message, [ --with-badpass-message message the user sees when the password is wrong],
*) badpass_message="$with_badpass_message"
;;
esac])
-AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message")
+AC_DEFINE_UNQUOTED(INCORRECT_PASSWORD, "$badpass_message", [The message given when a bad password is entered.])
AC_MSG_RESULT([$badpass_message])
AC_MSG_CHECKING(whether to expect fully qualified hosts in sudoers)
;;
esac])
if test "$fqdn" = "on"; then
- AC_DEFINE(FQDN)
+ AC_DEFINE(FQDN, 1, [Define if you want to require fully qualified hosts in sudoers.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
yes) with_sendmail=""
;;
no) ;;
- *) AC_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail")
+ *) SUDO_DEFINE_UNQUOTED(_PATH_SUDO_SENDMAIL, "$with_sendmail")
;;
esac])
[case $with_umask in
yes) AC_MSG_ERROR(["must give --with-umask an argument."])
;;
- no) AC_MSG_RESULT(user)
- sudo_umask=0777
+ no) sudo_umask=0777
;;
- [[0-9]]*) AC_DEFINE_UNQUOTED(SUDO_UMASK, $with_umask)
- AC_MSG_RESULT([$with_umask])
- sudo_umask=$with_umask
+ [[0-9]]*) sudo_umask=$with_umask
;;
*) AC_MSG_ERROR(["you must enter a numeric mask."])
;;
esac])
-AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask)
+AC_DEFINE_UNQUOTED(SUDO_UMASK, $sudo_umask, [The umask that the root-run prog should use.])
if test "$sudo_umask" = "0777"; then
AC_MSG_RESULT(user)
else
*) runas_default="$with_runas_default"
;;
esac])
-AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default")
+AC_DEFINE_UNQUOTED(RUNAS_DEFAULT, "$runas_default", [The user sudo should run commands as by default.])
AC_MSG_RESULT([$runas_default])
AC_ARG_WITH(exempt, [ --with-exempt=group no passwd needed for users in this group],
;;
no) AC_MSG_ERROR(["--without-exempt not supported."])
;;
- *) AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt")
+ *) AC_DEFINE_UNQUOTED(EXEMPTGROUP, "$with_exempt", [If defined, users in this group need not enter a passwd (ie "sudo").])
AC_MSG_CHECKING(for group to be exempt from password)
AC_MSG_RESULT([$with_exempt])
;;
;;
no) AC_MSG_ERROR(["--without-editor not supported."])
;;
- *) AC_DEFINE_UNQUOTED(EDITOR, "$with_editor")
+ *) AC_DEFINE_UNQUOTED(EDITOR, "$with_editor", [A colon-separated list of pathnames to be used as the editor for visudo.])
AC_MSG_RESULT([$with_editor])
;;
esac], [AC_DEFINE(EDITOR, _PATH_VI) AC_MSG_RESULT(vi)])
;;
esac])
if test "$env_editor" = "on"; then
- AC_DEFINE(ENV_EDITOR)
+ AC_DEFINE(ENV_EDITOR, 1, [Define if you want visudo to honor the EDITOR and VISUAL env variables.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
*) AC_MSG_ERROR(["you must enter the numer of tries, > 0"])
;;
esac])
-AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries)
+AC_DEFINE_UNQUOTED(TRIES_FOR_PASSWORD, $passwd_tries, [The number of tries a user gets to enter their password.])
AC_MSG_RESULT($passwd_tries)
AC_MSG_CHECKING(time in minutes after which sudo will ask for a password again)
*) AC_MSG_ERROR(["you must enter the numer of minutes."])
;;
esac])
-AC_DEFINE_UNQUOTED(TIMEOUT, $timeout)
+AC_DEFINE_UNQUOTED(TIMEOUT, $timeout, [The number of minutes before sudo asks for a password again.])
AC_MSG_RESULT($timeout)
AC_MSG_CHECKING(time in minutes after the password prompt will time out)
*) AC_MSG_ERROR(["you must enter the numer of minutes."])
;;
esac])
-AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout)
+AC_DEFINE_UNQUOTED(PASSWORD_TIMEOUT, $password_timeout, [The passwd prompt timeout (in minutes).])
AC_MSG_RESULT($password_timeout)
AC_ARG_WITH(execv, [ --with-execv use execv() instead of execvp()],
[case $with_execv in
yes) AC_MSG_CHECKING(whether to use execvp or execv)
AC_MSG_RESULT(execv)
- AC_DEFINE(USE_EXECV)
+ AC_DEFINE(USE_EXECV, 1, [Define if you wish to use execv() instead of execvp() when running programs.])
;;
no) ;;
*) AC_MSG_ERROR(["--with-execv does not take an argument."])
;;
esac])
if test "$tty_tickets" = "on"; then
- AC_DEFINE(USE_TTY_TICKETS)
+ AC_DEFINE(USE_TTY_TICKETS, 1, [Define if you want a different ticket file for each tty.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
;;
esac])
if test "$insults" = "on"; then
- AC_DEFINE(USE_INSULTS)
+ AC_DEFINE(USE_INSULTS, 1, [Define if you want to insult the user for entering an incorrect password.])
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_ARG_WITH(classic-insults, [ --with-classic-insults include the insults from the "classic" sudo],
[case $with_classic_insults in
- yes) AC_DEFINE(CLASSIC_INSULTS)
+ yes) AC_DEFINE(CLASSIC_INSULTS, 1, [Define if you want the insults from the "classic" version sudo.])
;;
no) ;;
*) AC_MSG_ERROR(["--with-classic-insults does not take an argument."])
AC_ARG_WITH(csops-insults, [ --with-csops-insults include CSOps insults],
[case $with_csops_insults in
- yes) AC_DEFINE(CSOPS_INSULTS)
+ yes) AC_DEFINE(CSOPS_INSULTS, 1, [Define if you want insults culled from the twisted minds of CSOps.])
;;
no) ;;
*) AC_MSG_ERROR(["--with-csops-insults does not take an argument."])
AC_ARG_WITH(hal-insults, [ --with-hal-insults include 2001-like insults],
[case $with_hal_insults in
- yes) AC_DEFINE(HAL_INSULTS)
+ yes) AC_DEFINE(HAL_INSULTS, 1, [Define if you want 2001-like insults.])
;;
no) ;;
*) AC_MSG_ERROR(["--with-hal-insults does not take an argument."])
AC_ARG_WITH(goons-insults, [ --with-goons-insults include the insults from the "Goon Show"],
[case $with_goons_insults in
- yes) AC_DEFINE(GOONS_INSULTS)
+ yes) AC_DEFINE(GOONS_INSULTS, 1, [Define if you want insults from the "Goon Show".])
;;
no) ;;
*) AC_MSG_ERROR(["--with-goons-insults does not take an argument."])
AC_MSG_CHECKING(whether to override the user's path)
AC_ARG_WITH(secure-path, [ --with-secure-path override the user's path with a builtin one],
[case $with_secure_path in
- yes) AC_DEFINE_UNQUOTED(SECURE_PATH, "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc")
+ yes) AC_DEFINE_UNQUOTED(SECURE_PATH, "/bin:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc", [Define to override the user's path with a builtin one.])
AC_MSG_RESULT([:/usr/ucb:/usr/bin:/usr/sbin:/sbin:/usr/etc:/etc])
;;
no) AC_MSG_RESULT(no)
[case $with_interfaces in
yes) AC_MSG_RESULT(yes)
;;
- no) AC_DEFINE(STUB_LOAD_INTERFACES)
+ no) AC_DEFINE(STUB_LOAD_INTERFACES, 1, [Define if the code in interfaces.c does not compile for you.])
AC_MSG_RESULT(no)
;;
*) AC_MSG_ERROR(["--with-interfaces does not take an argument."])
yes) AC_MSG_RESULT(yes)
;;
no) AC_MSG_RESULT(no)
- AC_DEFINE(NO_AUTHENTICATION)
+ AC_DEFINE(NO_AUTHENTICATION, 1, [Define if you don't want sudo to prompt for a password by default.])
;;
*) AC_MSG_RESULT(no)
echo "Ignoring unknown argument to --enable-authentication: $enableval"
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
;;
- no) AC_DEFINE(NO_ROOT_SUDO)
+ no) AC_DEFINE(NO_ROOT_SUDO, 1, [Define if root should not be allowed to use sudo.])
AC_MSG_RESULT(no)
;;
*) AC_MSG_ERROR(["--enable-root-sudo does not take an argument."])
[ --enable-log-host Log the hostname in the log file],
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
- AC_DEFINE(HOST_IN_LOG)
+ AC_DEFINE(HOST_IN_LOG, 1, [Define if you want the hostname to be entered into the log file.])
;;
no) AC_MSG_RESULT(no)
;;
[ --enable-noargs-shell If sudo is given no arguments run a shell],
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
- AC_DEFINE(SHELL_IF_NO_ARGS)
+ AC_DEFINE(SHELL_IF_NO_ARGS, 1, [Define if you want sudo to start a shell if given no arguments.])
;;
no) AC_MSG_RESULT(no)
;;
set $HOME to target user in shell mode],
[ case "$enableval" in
yes) AC_MSG_RESULT(yes)
- AC_DEFINE(SHELL_SETS_HOME)
+ AC_DEFINE(SHELL_SETS_HOME, 1, [Define if you want sudo to set $HOME in shell mode.])
;;
no) AC_MSG_RESULT(no)
;;
yes) AC_MSG_RESULT(no)
;;
no) AC_MSG_RESULT(yes)
- AC_DEFINE(DONT_LEAK_PATH_INFO)
+ AC_DEFINE(DONT_LEAK_PATH_INFO, 1, [Define if you want sudo to display "command not allowed" instead of "command not found" when a command cannot be found.])
;;
*) AC_MSG_RESULT(no)
echo "Ignoring unknown argument to --enable-path-info: $enableval"
# check for password adjunct functions (shadow passwords)
if test "$CHECKSHADOW" = "true"; then
AC_CHECK_FUNCS(getpwanam issecure, , [break])
+ AH_TEMPLATE([HAVE_GETPWANAM], [Define if you have the `getpwanam' function. (SunOS 4.x shadow passwords)])
+ AH_TEMPLATE([HAVE_ISSECURE], [Define if you have the `issecure' function. (SunOS 4.x check for shadow enabled)])
CHECKSHADOW="false"
fi
;;
*-*-aix*)
# To get all prototypes (so we pass -Wall)
CPPFLAGS="${CPPFLAGS} -D_XOPEN_EXTENDED_SOURCE"
- AC_DEFINE(_ALL_SOURCE)
+ SUDO_DEFINE(_ALL_SOURCE)
SUDO_LDFLAGS="${SUDO_LDFLAGS} -Wl,-bI:\$(srcdir)/aixcrypt.exp"
;;
*-*-hiuxmpp*)
;;
*-*-hpux1[[0-9]]*)
if test "$CHECKSHADOW" = "true"; then
- AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) AC_CHECK_LIB(sec, iscomsec, AC_DEFINE(HAVE_ISCOMSEC)) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"; SECUREWARE=1])
+ AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) AC_CHECK_LIB(sec, iscomsec, AC_DEFINE(HAVE_ISCOMSEC, 1, [Define if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled)])) [SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"; SECUREWARE=1])
CHECKSHADOW="false"
fi
test -n "$mansectform" || mansectform=4
;;
*-*-hpux9*)
- AC_DEFINE(BROKEN_SYSLOG)
+ AC_DEFINE(BROKEN_SYSLOG, 1, [Define if the `syslog' function returns a non-zero int to denote failure.])
if test "$CHECKSHADOW" = "true"; then
AC_CHECK_FUNCS(getspwuid)
+ AH_TEMPLATE([HAVE_GETSPWUID], [Define if you have the `getspwuid' function. (HP-UX <= 9.X shadow passwords)])
CHECKSHADOW="false"
fi
# use SIA by default, if we have it, else SecureWare
# unless overridden on the command line
if test "$CHECKSIA" = "true"; then
- AC_CHECK_FUNC(sia_ses_init, AC_DEFINE(HAVE_SIA) [
+ AC_CHECK_FUNC(sia_ses_init, AC_DEFINE(HAVE_SIA, 1, [Define if you use SIA.]) [
if test -n "$with_skey" -o -n "$with_opie" -o -n "$with_otp_only" -o -n "$with_long_otp_prompt" -o -n "$with_SecurID" -o -n "$with_fwtk" -o -n "$with_kerb4" -o -n "$with_kerb5" -o -n "$with_pam" -o -n "$with_AFS" -o -n "$with_DCE"; then
AC_MSG_ERROR(["you cannot mix SIA and other authentication schemes. You can turn off SIA support via the --disable-sia option"])
fi]; CHECKSHADOW=false)
fi
if test -n "$SECUREWARE"; then
- AC_DEFINE(HAVE_GETPRPWNAM)
+ AC_DEFINE(HAVE_GETPRPWNAM, 1, [Define if you have the `getprpwnam' function. (SecureWare-style shadow passwords)])
# -ldb includes bogus versions of snprintf/vsnprintf
AC_CHECK_FUNCS(snprintf, , [NEED_SNPRINTF=1])
AC_CHECK_FUNCS(vsnprintf, , [NEED_SNPRINTF=1])
test -n "$mansectform" || mansectform=4
;;
*-*-linux*)
- # To get crypt(3) and vasprintf() prototypes (so we pass -Wall)
- AC_DEFINE(_GNU_SOURCE)
-
# Some Linux versions need to link with -lshadow
if test "$CHECKSHADOW" = "true"; then
AC_CHECK_FUNCS(getspnam, , [AC_CHECK_LIB(shadow, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lshadow"; LIBS="${LIBS} -lshadow"])])
fi
;;
*-convex-bsd*)
- AC_DEFINE(_CONVEX_SOURCE)
+ SUDO_DEFINE(_CONVEX_SOURCE)
if test -z "$GCC"; then
CFLAGS="${CFLAGS} -D__STDC__"
fi
*-*-ultrix*)
OS="ultrix"
if test "$CHECKSHADOW" = "true"; then
- AC_CHECK_LIB(auth, getauthuid, AC_DEFINE(HAVE_GETAUTHUID) [SUDO_LIBS="${SUDO_LIBS} -lauth"; LIBS="${LIBS} -lauth"])
+ AC_CHECK_LIB(auth, getauthuid, AC_DEFINE(HAVE_GETAUTHUID, 1, [Define if you have the `getauthuid' function. (ULTRIX 4.x shadow passwords)]) [SUDO_LIBS="${SUDO_LIBS} -lauth"; LIBS="${LIBS} -lauth"])
CHECKSHADOW="false"
fi
;;
dnl We check for SVR4-style first and then SecureWare-style.
dnl
if test "$CHECKSHADOW" = "true"; then
- AC_CHECK_FUNCS(getspnam, [CHECKSHADOW="false"], [AC_CHECK_LIB(gen, getspnam, AC_DEFINE(HAVE_GETSPNAM) [SUDO_LIBS="${SUDO_LIBS} -lgen"; LIBS="${LIBS} -lgen"])])
+ AC_CHECK_FUNCS(getspnam, [CHECKSHADOW="false"], [AC_CHECK_LIB(gen, getspnam, AC_DEFINE(HAVE_GETSPNAM, 1, [Define if you have the `getspnam' function (SVR4-style shadow passwords)]) [SUDO_LIBS="${SUDO_LIBS} -lgen"; LIBS="${LIBS} -lgen"])])
fi
if test "$CHECKSHADOW" = "true"; then
AC_CHECK_FUNC(getprpwnam, [AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1], AC_CHECK_LIB(sec, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lsec"; LIBS="${LIBS} -lsec"], AC_CHECK_LIB(security, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lsecurity"; LIBS="${LIBS} -lsecurity"], AC_CHECK_LIB(prot, getprpwnam, AC_DEFINE(HAVE_GETPRPWNAM) [CHECKSHADOW="false"; SECUREWARE=1; SUDO_LIBS="${SUDO_LIBS} -lprot"; LIBS="${LIBS} -lprot"])))])
if test "$OS" != "ultrix"; then
AC_SYS_POSIX_TERMIOS
if test "$ac_cv_sys_posix_termios" = "yes"; then
- AC_DEFINE(HAVE_TERMIOS_H)
+ AC_DEFINE(HAVE_TERMIOS_H, 1, [Define if you have the <termios.h> header file and the `tcgetattr' function.])
else
AC_CHECK_HEADERS(termio.h)
fi
AC_CHECK_HEADERS(login_cap.h)
fi
if test "$with_bsdauth" = "yes"; then
- AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H) [with_passwd=no; AUTH_OBJS=bsdauth.o])
+ AC_CHECK_HEADER(bsd_auth.h, AC_DEFINE(HAVE_BSD_AUTH_H, 1, [Define if you use BSD authentication.]) [with_passwd=no; AUTH_OBJS=bsdauth.o])
fi
dnl
dnl typedef checks
dnl
AC_TYPE_MODE_T
AC_TYPE_UID_T
-AC_CHECK_TYPES([sig_atomic_t], , [AC_DEFINE(sig_atomic_t, int)], [#include <sys/types.h>
+AC_CHECK_TYPES([sig_atomic_t], , [AC_DEFINE(sig_atomic_t, int, [Define to `int' if <signal.h> does not define.])], [#include <sys/types.h>
#include <signal.h>])
-AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T)], ,[#include <sys/types.h>
+AC_CHECK_TYPES([sigaction_t], [AC_DEFINE(HAVE_SIGACTION_T, 1, [Define if <signal.h> has the sigaction_t typedef.])], ,[#include <sys/types.h>
#include <signal.h>])
SUDO_TYPE_SIZE_T
SUDO_TYPE_SSIZE_T
AC_CHECK_FUNCS(innetgr _innetgr, AC_CHECK_FUNCS(getdomainname) [break])
AC_CHECK_FUNCS(lsearch, , [AC_CHECK_LIB(compat, lsearch, AC_CHECK_HEADER(search.h, AC_DEFINE(HAVE_LSEARCH) [LIBS="${LIBS} -lcompat"], AC_LIBOBJ(lsearch)), AC_LIBOBJ(lsearch))])
AC_CHECK_FUNCS(utime, SUDO_FUNC_UTIME_POSIX, AC_LIBOBJ(utime))
-SUDO_FUNC_FNMATCH(AC_DEFINE(HAVE_FNMATCH), AC_LIBOBJ(fnmatch))
+SUDO_FUNC_FNMATCH(AC_DEFINE(HAVE_FNMATCH, 1, [Define if you have the `fnmatch' function.]), AC_LIBOBJ(fnmatch))
SUDO_FUNC_ISBLANK
AC_REPLACE_FUNCS(strerror strcasecmp sigaction)
AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf, , [NEED_SNPRINTF=1])
dnl Kerberos 5
dnl
if test "$with_kerb5" = "yes"; then
- AC_DEFINE(HAVE_KERB5)
+ AC_DEFINE(HAVE_KERB5, 1, [Define if you use Kerberos V.])
if test -f "/usr/local/include/krb5.h"; then
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
elif test -f "/usr/local/kerberos/include/krb5.h"; then
dnl Find kerberos 4 includes and libs or complain
dnl
if test "$with_kerb4" = "yes"; then
- AC_DEFINE(HAVE_KERB4)
+ AC_DEFINE(HAVE_KERB4, 1, [Define if you use Kerberos IV.])
if test -f "/usr/include/kerberosIV/krb.h"; then
CPPFLAGS="${CPPFLAGS} -I/usr/include/kerberosIV"
elif test -f "/usr/local/include/kerberosIV/krb.h"; then
else
echo 'Unable to locate libskey.a and/or skey.h, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDO_LDFLAGS and/or -I/path/to/skey.h to CPPFLAGS'
fi
- AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS))
+ AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS, 1, [Define if your S/Key library has skeyaccess().]))
fi
dnl
dnl Use passwd (and secureware) auth modules?
dnl
if test "$with_passwd" = "no"; then
- AC_DEFINE(WITHOUT_PASSWD)
+ AC_DEFINE(WITHOUT_PASSWD, 1. [Define to avoid using the passwd/shadow file for authentication.])
if test -z "$AUTH_OBJS"; then
AC_MSG_ERROR([no authentication methods defined.])
fi
esac
echo ""
fi
+
+dnl
+dnl Special bits for autoheader
+dnl
+AH_VERBATIM([_GNU_SOURCE],
+[/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif])
+
+AH_VERBATIM([_ALL_SOURCE],
+[/* Enable non-POSIX extensions on AIX. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif])
+
+AH_VERBATIM([_CONVEX_SOURCE],
+[/* Enable non-POSIX extensions on ConvexOS. */
+#ifndef _CONVEX_SOURCE
+# undef _CONVEX_SOURCE
+#endif])
+
+AH_TOP([#ifndef _SUDO_CONFIG_H
+#define _SUDO_CONFIG_H])
+
+AH_BOTTOM([/*
+ * Emulate a subset of waitpid() if we don't have it.
+ */
+#ifdef HAVE_WAITPID
+# define sudo_waitpid(p, s, o) waitpid(p, s, o)
+#else
+# ifdef HAVE_WAIT3
+# define sudo_waitpid(p, s, o) wait3(s, o, NULL)
+# endif
+#endif
+
+/* Solaris doesn't use const qualifiers in PAM. */
+#ifdef sun
+# define PAM_CONST
+#else
+# define PAM_CONST const
+#endif
+
+#ifdef USE_EXECV
+# define EXEC execv
+#else
+# define EXEC execvp
+#endif /* USE_EXECV */
+
+/* New ANSI-style OS defs for HP-UX and ConvexOS. */
+#if defined(hpux) && !defined(__hpux)
+# define __hpux 1
+#endif /* hpux */
+
+#if defined(convex) && !defined(__convex__)
+# define __convex__ 1
+#endif /* convex */
+
+/* BSD compatibility on some SVR4 systems. */
+#ifdef __svr4__
+# define BSD_COMP
+#endif /* __svr4__ */
+
+#endif /* _SUDO_CONFIG_H */])