From 5dec79269b347018cf9c6feb4fa8881a9b65c328 Mon Sep 17 00:00:00 2001 From: dtucker Date: Sat, 9 Jan 2010 07:18:04 +0000 Subject: [PATCH] - (dtucker) [loginrec.c] Use the SUSv3 specified name for the user name when using utmpx. Patch from Ed Schouten. --- ChangeLog | 2 ++ loginrec.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e8b4101..31f205f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ have it. - (dtucker) [defines.h] define PRIu64 for platforms that don't have it. - (dtucker) [roaming_client.c] Wrap inttypes.h in an ifdef. + - (dtucker) [loginrec.c] Use the SUSv3 specified name for the user name + when using utmpx. Patch from Ed Schouten. 20091208 - (dtucker) OpenBSD CVS Sync diff --git a/loginrec.c b/loginrec.c index f4af0673..bca95970 100644 --- a/loginrec.c +++ b/loginrec.c @@ -758,8 +758,8 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx) utx->ut_pid = li->pid; /* strncpy(): Don't necessarily want null termination */ - strncpy(utx->ut_name, li->username, - MIN_SIZEOF(utx->ut_name, li->username)); + strncpy(utx->ut_user, li->username, + MIN_SIZEOF(utx->ut_user, li->username)); if (li->type == LTYPE_LOGOUT) return; @@ -1316,8 +1316,8 @@ wtmpx_write_entry(struct logininfo *li) static int wtmpx_islogin(struct logininfo *li, struct utmpx *utx) { - if (strncmp(li->username, utx->ut_name, - MIN_SIZEOF(li->username, utx->ut_name)) == 0 ) { + if (strncmp(li->username, utx->ut_user, + MIN_SIZEOF(li->username, utx->ut_user)) == 0 ) { # ifdef HAVE_TYPE_IN_UTMPX if (utx->ut_type == USER_PROCESS) return (1); -- 2.45.1