summaryrefslogtreecommitdiff
path: root/loginrec.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-07-09 21:37:49 +1000
committerDamien Miller <djm@mindrot.org>2000-07-09 21:37:49 +1000
commitb38ea865261491e7ef42eb72eb1466bfa8aeefc3 (patch)
treedccaf86c0b0561b2028de225616538024f959f6a /loginrec.c
parent0100627fc8fda8b3be42789972a8d9f0e339134c (diff)
- (djm) Replace ut_name with ut_user. Patch from Jim Watt
<jimw@peisj.pebio.com>
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 438c06767..1bf5eeb46 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -170,7 +170,7 @@
170#include "xmalloc.h" 170#include "xmalloc.h"
171#include "loginrec.h" 171#include "loginrec.h"
172 172
173RCSID("$Id: loginrec.c,v 1.14 2000/07/01 22:43:18 djm Exp $"); 173RCSID("$Id: loginrec.c,v 1.15 2000/07/09 11:37:49 djm Exp $");
174 174
175/** 175/**
176 ** prototypes for helper functions in this file 176 ** prototypes for helper functions in this file
@@ -680,7 +680,7 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
680 */ 680 */
681 681
682 /* strncpy(): Don't necessarily want null termination */ 682 /* strncpy(): Don't necessarily want null termination */
683 strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username)); 683 strncpy(utx->ut_user, li->username, MIN_SIZEOF(utx->ut_user, li->username));
684# ifdef HAVE_HOST_IN_UTMPX 684# ifdef HAVE_HOST_IN_UTMPX
685 strncpy(utx->ut_host, li->hostname, MIN_SIZEOF(utx->ut_host, li->hostname)); 685 strncpy(utx->ut_host, li->hostname, MIN_SIZEOF(utx->ut_host, li->hostname));
686# endif 686# endif
@@ -740,12 +740,12 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
740 /* 740 /*
741 * Prevent luser from zero'ing out ut_host. 741 * Prevent luser from zero'ing out ut_host.
742 * If the new ut_line is empty but the old one is not 742 * If the new ut_line is empty but the old one is not
743 * and ut_line and ut_name match, preserve the old ut_line. 743 * and ut_line and ut_user match, preserve the old ut_line.
744 */ 744 */
745 if (atomicio(read, fd, &old_ut, sizeof(old_ut)) == sizeof(old_ut) && 745 if (atomicio(read, fd, &old_ut, sizeof(old_ut)) == sizeof(old_ut) &&
746 (ut->ut_host[0] == '\0') && (old_ut.ut_host[0] != '\0') && 746 (ut->ut_host[0] == '\0') && (old_ut.ut_host[0] != '\0') &&
747 (strncmp(old_ut.ut_line, ut->ut_line, sizeof(ut->ut_line)) == 0) && 747 (strncmp(old_ut.ut_line, ut->ut_line, sizeof(ut->ut_line)) == 0) &&
748 (strncmp(old_ut.ut_name, ut->ut_name, sizeof(ut->ut_name)) == 0)) { 748 (strncmp(old_ut.ut_user, ut->ut_user, sizeof(ut->ut_user)) == 0)) {
749 (void)memcpy(ut->ut_host, old_ut.ut_host, sizeof(ut->ut_host)); 749 (void)memcpy(ut->ut_host, old_ut.ut_host, sizeof(ut->ut_host));
750 } 750 }
751 751