From cfa7fe890b09693ed503da7516977402cbbe13ed Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 29 Aug 2013 07:46:46 +0100 Subject: last, utmpdump, agetty, wall, write: avoid compatibility hacks In include/bits/utmp.h the ut_user and ut_time macros are marked with comment they are backwards compatibility hacks. It is probably best to avoid use of these macros where ever possible. Signed-off-by: Sami Kerola --- term-utils/write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'term-utils/write.c') diff --git a/term-utils/write.c b/term-utils/write.c index 173869465..f5ca34108 100644 --- a/term-utils/write.c +++ b/term-utils/write.c @@ -201,7 +201,7 @@ int utmp_chk(char *user, char *tty) while ((uptr = getutent())) { memcpy(&u, uptr, sizeof(u)); - if (strncmp(user, u.ut_name, sizeof(u.ut_name)) == 0 && + if (strncmp(user, u.ut_user, sizeof(u.ut_user)) == 0 && strncmp(tty, u.ut_line, sizeof(u.ut_line)) == 0) { res = 0; break; @@ -239,7 +239,7 @@ void search_utmp(char *user, char *tty, char *mytty, uid_t myuid) user_is_me = 0; while ((uptr = getutent())) { memcpy(&u, uptr, sizeof(u)); - if (strncmp(user, u.ut_name, sizeof(u.ut_name)) == 0) { + if (strncmp(user, u.ut_user, sizeof(u.ut_user)) == 0) { ++nloggedttys; strncpy(atty, u.ut_line, sizeof(u.ut_line)); atty[sizeof(u.ut_line)] = '\0'; -- cgit v1.2.3-55-g7522