Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/external/bsd/tmux/usr.bin/tmux Pull up following revision...
details: https://anonhg.NetBSD.org/src/rev/e0a3eff9d899
branches: netbsd-8
changeset: 434008:e0a3eff9d899
user: snj <snj%NetBSD.org@localhost>
date: Thu Jun 15 05:35:07 2017 +0000
description:
Pull up following revision(s) (requested by christos in ticket #36):
external/bsd/tmux/usr.bin/tmux/utempter.c: revision 1.2
PR/52288: ben: Fix utmp cleanup did not work.
diffstat:
external/bsd/tmux/usr.bin/tmux/utempter.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diffs (65 lines):
diff -r 611a98ef1817 -r e0a3eff9d899 external/bsd/tmux/usr.bin/tmux/utempter.c
--- a/external/bsd/tmux/usr.bin/tmux/utempter.c Thu Jun 15 05:33:49 2017 +0000
+++ b/external/bsd/tmux/usr.bin/tmux/utempter.c Thu Jun 15 05:35:07 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: utempter.c,v 1.1 2017/04/23 02:02:00 christos Exp $ */
+/* $NetBSD: utempter.c,v 1.1.6.1 2017/06/15 05:35:07 snj Exp $ */
/*-
* Copyright (c) 2011, 2017 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: utempter.c,v 1.1 2017/04/23 02:02:00 christos Exp $");
+__RCSID("$NetBSD: utempter.c,v 1.1.6.1 2017/06/15 05:35:07 snj Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -86,9 +86,9 @@
}
static void
-logout_utmpx(const char *tty, const struct timeval *now)
+logout_utmpx(const char *username, const char *tty, const struct timeval *now)
{
- doutmpx("", "", tty, now, DEAD_PROCESS, 0);
+ doutmpx(username, "", tty, now, DEAD_PROCESS, 0);
}
#endif
@@ -108,7 +108,8 @@
}
static void
-logout_utmp(const char *tty, const struct timeval *now __unused)
+logout_utmp(const char *username __unused,
+ const char *tty, const struct timeval *now __unused)
{
logout(tty);
}
@@ -142,17 +143,22 @@
utmp_destroy(int fd)
{
struct timeval tv;
+ char username[LOGIN_NAME_MAX];
char tty[128], *ttyp;
+ if (getlogin_r(username, sizeof(username)) == -1)
+ return -1;
+
if ((errno = ttyname_r(fd, tty, sizeof(tty))) != 0)
return -1;
+
ttyp = tty + sizeof(_PATH_DEV) - 1;
(void)gettimeofday(&tv, NULL);
#ifdef SUPPORT_UTMPX
- logout_utmpx(ttyp, &tv);
+ logout_utmpx(username, ttyp, &tv);
#endif
#ifdef SUPPORT_UTMP
- logout_utmp(ttyp, &tv);
+ logout_utmp(username, ttyp, &tv);
#endif
return 0;
}
Home |
Main Index |
Thread Index |
Old Index