From 0e8f4eba9855a27b1f0c7770a290cde03ea2511d Mon Sep 17 00:00:00 2001 From: djm Date: Tue, 23 Apr 2002 13:09:19 +0000 Subject: [PATCH] - (djm) Bug #214: Fix utmp for Irix (don't strip "tty"). Patch from Kevin Taylor (??) via Philipp Grau --- ChangeLog | 3 +++ acconfig.h | 3 +++ configure.ac | 2 ++ loginrec.c | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index dcd59716..570cd480 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ Antti Tapaninen - (djm) Define BROKEN_REALPATH for AIX, patch from Antti Tapaninen + - (djm) Bug #214: Fix utmp for Irix (don't strip "tty"). Patch from + Kevin Taylor (??) via Philipp Grau + - (djm) Bug #213: Simplify CMSG_ALIGN macros to avoid symbol clashes. Reported by Doug Manton - (djm) Bug #222: Fix tests for getaddrinfo on OSF/1. Spotted by diff --git a/acconfig.h b/acconfig.h index ebf50f4c..cc917308 100644 --- a/acconfig.h +++ b/acconfig.h @@ -346,6 +346,9 @@ /* Define if you want to use OpenSSL's internally seeded PRNG only */ #undef OPENSSL_PRNG_ONLY +/* Define if you shouldn't strip 'tty' from your ttyname in [uw]tmp */ +#undef WITH_ABBREV_NO_TTY + @BOTTOM@ /* ******************* Shouldn't need to edit below this line ************** */ diff --git a/configure.ac b/configure.ac index 0baa291a..f4f6ee94 100644 --- a/configure.ac +++ b/configure.ac @@ -107,6 +107,7 @@ case "$host" in LDFLAGS="$LDFLAGS" PATH="$PATH:/usr/etc" AC_DEFINE(BROKEN_INET_NTOA) + AC_DEFINE(WITH_ABBREV_NO_TTY) ;; *-*-irix6*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" @@ -117,6 +118,7 @@ case "$host" in AC_DEFINE(WITH_IRIX_AUDIT) AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) AC_DEFINE(BROKEN_INET_NTOA) + AC_DEFINE(WITH_ABBREV_NO_TTY) ;; *-*-linux*) no_dev_ptmx=1 diff --git a/loginrec.c b/loginrec.c index 1805f3ee..7aa10254 100644 --- a/loginrec.c +++ b/loginrec.c @@ -564,6 +564,11 @@ line_abbrevname(char *dst, const char *src, int dstsize) if (strncmp(src, "/dev/", 5) == 0) src += 5; +#ifdef WITH_ABBREV_NO_TTY + if (strncmp(src, "tty", 3) == 0) + src += 3; +#endif + len = strlen(src); if (len > 0) { -- 2.45.1