From c28b88a3144f39a9cf244fbf7bb32d8532846fa1 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 10 Feb 2004 16:49:35 +1100 Subject: - (dtucker) [configure.ac loginrec.c] Bug #464: Use updwtmpx on platforms that support it. from & ok mouring@ --- ChangeLog | 4 +++- configure.ac | 4 ++-- loginrec.c | 7 ++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ac0ce1ac..62090549d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ - (dtucker) [openbsd-compat/port-aix.c openbsd-compat/port-aix.h] Move include from port-aix.h to port-aix.c and remove unnecessary function definition. Fixes build errors on AIX. + - (dtucker) [configure.ac loginrec.c] Bug #464: Use updwtmpx on platforms + that support it. from & ok mouring@ 20040207 - (dtucker) OpenBSD CVS Sync @@ -1836,4 +1838,4 @@ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. Report from murple@murple.net, diagnosis from dtucker@zip.com.au -$Id: ChangeLog,v 1.3222 2004/02/10 04:27:34 dtucker Exp $ +$Id: ChangeLog,v 1.3223 2004/02/10 05:49:35 dtucker Exp $ diff --git a/configure.ac b/configure.ac index bdff63db3..5ecbf56db 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.194 2004/02/06 10:29:42 dtucker Exp $ +# $Id: configure.ac,v 1.195 2004/02/10 05:49:35 dtucker Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -801,7 +801,7 @@ AC_CHECK_FUNCS(\ setproctitle setregid setreuid setrlimit \ setsid setvbuf sigaction sigvec snprintf socketpair strerror \ strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \ - truncate utimes vhangup vsnprintf waitpid \ + truncate updwtmpx utimes vhangup vsnprintf waitpid \ ) # IRIX has a const char return value for gai_strerror() diff --git a/loginrec.c b/loginrec.c index ce9e26fc5..71dbaea15 100644 --- a/loginrec.c +++ b/loginrec.c @@ -158,7 +158,7 @@ #include "log.h" #include "atomicio.h" -RCSID("$Id: loginrec.c,v 1.53 2003/11/21 12:48:55 djm Exp $"); +RCSID("$Id: loginrec.c,v 1.54 2004/02/10 05:49:35 dtucker Exp $"); #ifdef HAVE_UTIL_H # include @@ -1183,6 +1183,7 @@ wtmp_get_entry(struct logininfo *li) static int wtmpx_write(struct logininfo *li, struct utmpx *utx) { +#ifndef HAVE_UPDWTMPX struct stat buf; int fd, ret = 1; @@ -1202,6 +1203,10 @@ wtmpx_write(struct logininfo *li, struct utmpx *utx) (void)close(fd); return ret; +#else + updwtmpx(WTMPX_FILE, utx); + return 1; +#endif } -- cgit v1.2.3