AC_DEFUN(SUDO_IO_LOGDIR, [
AC_MSG_CHECKING(for I/O log dir location)
if test "${with_iologdir-yes}" != "yes"; then
- :
+ iolog_dir="$with_iologdir":
elif test -d "/var/log"; then
- with_iologdir="/var/log/sudo-io"
+ iolog_dir="/var/log/sudo-io"
elif test -d "/var/adm"; then
- with_iologdir="/var/adm/sudo-io"
+ iolog_dir="/var/adm/sudo-io"
else
- with_iologdir="/usr/adm/sudo-io"
+ iolog_dir="/usr/adm/sudo-io"
fi
- if test "${with_iologdir-yes}" != "no"; then
- SUDO_DEFINE_UNQUOTED(_PATH_SUDO_IO_LOGDIR, "$with_iologdir")
- fi
- AC_MSG_RESULT($with_iologdir)
+ SUDO_DEFINE_UNQUOTED(_PATH_SUDO_IO_LOGDIR, "$iolog_dir")
+ AC_MSG_RESULT($iolog_dir)
])dnl
dnl
password_timeout
timeout
timedir
+iolog_dir
CONFIGURE_ARGS
ZLIB_DEP
ZLIB
#
# Begin initial values for man page substitution
#
+iolog_dir=/var/log/sudo-io
timedir=/var/adm/sudo
timeout=5
password_timeout=5
# Check whether --with-linux-audit was given.
if test "${with_linux_audit+set}" = set; then :
withval=$with_linux_audit; case $with_linux_audit in
- yes)
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ yes) cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <libaudit.h>
int
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:6795: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:6796: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:6798: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:6799: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:6801: output\"" >&5)
+ (eval echo "\"\$as_me:6802: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 8006 "configure"' > conftest.$ac_ext
+ echo '#line 8007 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9399: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9400: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9403: \$? = $ac_status" >&5
+ echo "$as_me:9404: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9738: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9739: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:9742: \$? = $ac_status" >&5
+ echo "$as_me:9743: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9843: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9844: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:9847: \$? = $ac_status" >&5
+ echo "$as_me:9848: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:9898: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:9899: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:9902: \$? = $ac_status" >&5
+ echo "$as_me:9903: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12265 "configure"
+#line 12266 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12361 "configure"
+#line 12362 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for I/O log dir location" >&5
$as_echo_n "checking for I/O log dir location... " >&6; }
if test "${with_iologdir-yes}" != "yes"; then
- :
+ iolog_dir="$with_iologdir":
elif test -d "/var/log"; then
- with_iologdir="/var/log/sudo-io"
+ iolog_dir="/var/log/sudo-io"
elif test -d "/var/adm"; then
- with_iologdir="/var/adm/sudo-io"
+ iolog_dir="/var/adm/sudo-io"
else
- with_iologdir="/usr/adm/sudo-io"
+ iolog_dir="/usr/adm/sudo-io"
fi
- if test "${with_iologdir-yes}" != "no"; then
- cat >>confdefs.h <<EOF
-#define _PATH_SUDO_IO_LOGDIR "$with_iologdir"
+ cat >>confdefs.h <<EOF
+#define _PATH_SUDO_IO_LOGDIR "$iolog_dir"
EOF
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_iologdir" >&5
-$as_echo "$with_iologdir" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $iolog_dir" >&5
+$as_echo "$iolog_dir" >&6; }
if test "${with_iologdir-yes}" != "no"; then
AC_INIT([sudo], [1.7.5b2], [http://www.sudo.ws/bugs/], [sudo])
AC_CONFIG_HEADER(config.h pathnames.h zlib/zconf.h)
dnl
-dnl This won't work before AC_INIT
+dnl Note: this must come after AC_INIT
dnl
AC_MSG_NOTICE([Configuring Sudo version $PACKAGE_VERSION])
dnl
dnl
dnl Variables that get substituted in docs (not overridden by environment)
dnl
+AC_SUBST([iolog_dir])dnl real initial value from SUDO_IO_LOGDIR
AC_SUBST([timedir])dnl real initial value from SUDO_TIMEDIR
AC_SUBST([timeout])
AC_SUBST([password_timeout])
#
# Begin initial values for man page substitution
#
+iolog_dir=/var/log/sudo-io
timedir=/var/adm/sudo
timeout=5
password_timeout=5
dnl
AC_ARG_WITH(linux-audit, [AS_HELP_STRING([--with-linux-audit], [enable Linux audit support])],
[case $with_linux_audit in
- yes)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libaudit.h>]], [[int i = AUDIT_USER_CMD; (void)i;]])], [
+ yes) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libaudit.h>]], [[int i = AUDIT_USER_CMD; (void)i;]])], [
AC_DEFINE(HAVE_LINUX_AUDIT)
SUDO_LIBS="${SUDO_LIBS} -laudit"
SUDO_OBJS="${SUDO_OBJS} linux_audit.o"
"use_pty", T_FLAG,
"Always run commands in a pseudo-tty",
NULL,
+ }, {
+ "iolog_dir", T_STR|T_PATH,
+ "Directory in which to store input/output logs",
+ NULL,
}, {
NULL, 0, NULL
}
#define I_COMPRESS_IO 75
#define def_use_pty (sudo_defs_table[76].sd_un.flag)
#define I_USE_PTY 76
+#define def_iolog_dir (sudo_defs_table[77].sd_un.str)
+#define I_IOLOG_DIR 77
enum def_tupple {
never,
use_pty
T_FLAG
"Always run commands in a pseudo-tty"
+iolog_dir
+ T_STR|T_PATH
+ "Directory in which to store input/output logs"
#ifdef _PATH_SUDO_ASKPASS
def_askpass = estrdup(_PATH_SUDO_ASKPASS);
#endif
+ def_iolog_dir = _PATH_SUDO_IO_LOGDIR;
def_sudoers_locale = estrdup("C");
def_env_reset = TRUE;
def_set_logname = TRUE;
char pathbuf[PATH_MAX];
/*
- * Create _PATH_SUDO_IO_LOGDIR if it doesn't already exist.
+ * Create I/O log directory if it doesn't already exist.
*/
- if (stat(_PATH_SUDO_IO_LOGDIR, &sb) != 0) {
- if (mkdir(_PATH_SUDO_IO_LOGDIR, S_IRWXU) != 0)
- log_error(USE_ERRNO, "Can't mkdir %s", _PATH_SUDO_IO_LOGDIR);
+ if (stat(def_iolog_dir, &sb) != 0) {
+ if (mkdir(def_iolog_dir, S_IRWXU) != 0)
+ log_error(USE_ERRNO, "Can't mkdir %s", def_iolog_dir);
} else if (!S_ISDIR(sb.st_mode)) {
log_error(0, "%s exists but is not a directory (0%o)",
- _PATH_SUDO_IO_LOGDIR, (unsigned int) sb.st_mode);
+ def_iolog_dir, (unsigned int) sb.st_mode);
}
/*
* Open sequence file
*/
- len = snprintf(pathbuf, sizeof(pathbuf), "%s/seq", _PATH_SUDO_IO_LOGDIR);
+ len = snprintf(pathbuf, sizeof(pathbuf), "%s/seq", def_iolog_dir);
if (len <= 0 || len >= sizeof(pathbuf)) {
errno = ENAMETOOLONG;
log_error(USE_ERRNO, "%s/seq", pathbuf);
log_error(0, "tried to build a session id path without a session id");
/*
- * Path is of the form /var/log/sudo-session/00/00/01.
+ * Path is of the form /var/log/sudo-io/00/00/01.
*/
- len = snprintf(pathbuf, pathsize, "%s/%c%c/%c%c/%c%c", _PATH_SUDO_IO_LOGDIR,
+ len = snprintf(pathbuf, pathsize, "%s/%c%c/%c%c/%c%c", def_iolog_dir,
sudo_user.sessid[0], sudo_user.sessid[1], sudo_user.sessid[2],
sudo_user.sessid[3], sudo_user.sessid[4], sudo_user.sessid[5]);
if (len <= 0 && len >= pathsize) {
errno = ENAMETOOLONG;
- log_error(USE_ERRNO, "%s/%s", _PATH_SUDO_IO_LOGDIR, sudo_user.sessid);
+ log_error(USE_ERRNO, "%s/%s", def_iolog_dir, sudo_user.sessid);
}
/*
/*
* Build a path containing the session id split into two-digit subdirs,
- * so ID 000001 becomes /var/log/sudo-session/00/00/01.
+ * so ID 000001 becomes /var/log/sudo-io/00/00/01.
*/
len = build_idpath(pathbuf, sizeof(pathbuf));
if (len == -1)
EDITOR environment variable if possible, or the first editor in the
list that exists and is executable. The default is C<"@editor@">.
+=item iolog_dir
+
+The directory in which to store input/output logs when the I<log_input>
+or I<log_output> options are enabled or when the <LOG_INPUT> or
+C<LOG_OUTPUT> tags are present for a command.
+The default is C<"@iolog_dir@">.
+
=item mailsub
Subject of the mail sent to the I<mailto> user. The escape C<%h>
List of network groups
-=item F</var/log/sudo-io>
+=item F<@iolog_dir@>
I/O log files