summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-11-04 21:44:05 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-11-04 21:44:05 -0800
commitcdc7b575452a621fb467004d607288af6dd4c802 (patch)
tree594d4901ecdebebb60872b5df86223c4f2c40d32 /configure.ac
parenta69c64584f614eeaeac92a068715ced5777b0ec9 (diff)
Only pass -u & -w args to sessreg if --with-{u,w}tmp-file=path specified
If not specified, let sessreg use its builtin defaults instead of replicating the logic here (and possibly getting it wrong), especially since in sessreg-1.0.8 and earlier, using the -u & -w flags forces the use of the utmp/wtmp code and not the newer utmpx/wtmpx code. If --without-{u,w}tmp-file or --with-{u,w}tmp-file=none is specified, pass "none" as arguments to sessreg to disable writing to that file. v2: better handling of --with & --without arguments when not passing path, add documentation of the 3 choices to README Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac44
1 files changed, 22 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index 38b2a28..12ef51c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,44 +279,44 @@ AC_ARG_WITH(config-type,
[SERVERSTYPE="$withval"], [SERVERSTYPE="ws"])
AC_SUBST(SERVERSTYPE)
-# Ideally we'd just pull out UTMP_FILE & WTMP_FILE from <utmp.h>
-# but that's not easy to do in autoconf
AC_ARG_WITH(utmp_file,
AS_HELP_STRING([--with-utmp-file=<pathname>],
- [specify file to pass to sessreg -u for current logins]),
+ [specify file to pass to sessreg -u for current logins])
+AS_HELP_STRING([--without-utmp-file],
+ [specify passing "none" to sessreg -u to not record logins in utmp]),
[UTMP_FILE="$withval"])
if test "x$UTMP_FILE" = "xyes" ; then
- AC_MSG_ERROR([path was not specified to --with-utmp-file])
+ UTMP_FILE=""
+elif test "x$UTMP_FILE" = "xno" ; then
+ UTMP_FILE="none"
fi
+AC_MSG_CHECKING([for path to file listing current logins for sessreg])
if test "x$UTMP_FILE" = "x" ; then
- for UTMP_FILE in /var/adm/utmpx /var/run/utmp /var/log/utmp /var/adm/utmp /usr/adm/utmp /etc/utmp ; do
- AC_CHECK_FILE([$UTMP_FILE], [break], [UTMP_FILE=""])
- done
- if test "x$UTMP_FILE" = "x" ; then
- UTMP_FILE="/var/run/utmp"
- fi
+ AC_MSG_RESULT([use sessreg default])
+else
+ AC_MSG_RESULT([$UTMP_FILE])
fi
-AC_MSG_CHECKING([for path to file listing current logins for sessreg])
-AC_MSG_RESULT([$UTMP_FILE])
+AM_CONDITIONAL(SET_UTMP_FILE, test x$UTMP_FILE != x)
AC_SUBST(UTMP_FILE)
AC_ARG_WITH(wtmp_file,
AS_HELP_STRING([--with-wtmp-file=<pathname>],
- [specify file to pass to sessreg -w for login history]),
+ [specify file to pass to sessreg -w for login history])
+AS_HELP_STRING([--without-wtmp-file],
+ [specify passing "none" to sessreg -w to not record logins in wtmp]),
[WTMP_FILE="$withval"])
if test "x$WTMP_FILE" = "xyes" ; then
- AC_MSG_ERROR([path was not specified to --with-wtmp-file])
+ WTMP_FILE=""
+elif test "x$WTMP_FILE" = "xno" ; then
+ WTMP_FILE="none"
fi
+AC_MSG_CHECKING([for path to file listing login history for sessreg])
if test "x$WTMP_FILE" = "x" ; then
- for WTMP_FILE in /var/adm/wtmpx /var/log/wtmp /var/adm/wtmp /usr/adm/wtmp /etc/wtmp ; do
- AC_CHECK_FILE([$WTMP_FILE], [break], [WTMP_FILE=""])
- done
- if test "x$WTMP_FILE" = "x" ; then
- WTMP_FILE="/var/log/wtmp"
- fi
+ AC_MSG_RESULT([use sessreg default])
+else
+ AC_MSG_RESULT([$WTMP_FILE])
fi
-AC_MSG_CHECKING([for path to file listing login history for sessreg])
-AC_MSG_RESULT([$WTMP_FILE])
+AM_CONDITIONAL(SET_WTMP_FILE, test x$WTMP_FILE != x)
AC_SUBST(WTMP_FILE)
case $host_os in