summaryrefslogtreecommitdiff
path: root/loginrec.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-09 18:18:04 +1100
committerDarren Tucker <dtucker@zip.com.au>2010-01-09 18:18:04 +1100
commit0b8a2262ac9ee2b2395cf85e3dfa065385c25b5a (patch)
treeba8382d0b0e85f801fd828c1fa466b91b0d25a52 /loginrec.c
parent11b5c07941f206d955184ff1e4c1ff6fba37d157 (diff)
- (dtucker) [loginrec.c] Use the SUSv3 specified name for the user name
when using utmpx. Patch from Ed Schouten.
Diffstat (limited to 'loginrec.c')
-rw-r--r--loginrec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/loginrec.c b/loginrec.c
index f4af06736..bca959707 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -758,8 +758,8 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
758 utx->ut_pid = li->pid; 758 utx->ut_pid = li->pid;
759 759
760 /* strncpy(): Don't necessarily want null termination */ 760 /* strncpy(): Don't necessarily want null termination */
761 strncpy(utx->ut_name, li->username, 761 strncpy(utx->ut_user, li->username,
762 MIN_SIZEOF(utx->ut_name, li->username)); 762 MIN_SIZEOF(utx->ut_user, li->username));
763 763
764 if (li->type == LTYPE_LOGOUT) 764 if (li->type == LTYPE_LOGOUT)
765 return; 765 return;
@@ -1316,8 +1316,8 @@ wtmpx_write_entry(struct logininfo *li)
1316static int 1316static int
1317wtmpx_islogin(struct logininfo *li, struct utmpx *utx) 1317wtmpx_islogin(struct logininfo *li, struct utmpx *utx)
1318{ 1318{
1319 if (strncmp(li->username, utx->ut_name, 1319 if (strncmp(li->username, utx->ut_user,
1320 MIN_SIZEOF(li->username, utx->ut_name)) == 0 ) { 1320 MIN_SIZEOF(li->username, utx->ut_user)) == 0 ) {
1321# ifdef HAVE_TYPE_IN_UTMPX 1321# ifdef HAVE_TYPE_IN_UTMPX
1322 if (utx->ut_type == USER_PROCESS) 1322 if (utx->ut_type == USER_PROCESS)
1323 return (1); 1323 return (1);