From 5ad5826db13626e5ee48aff2e58bbd0ce5ef0637 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 13 Apr 2021 00:14:09 +0000 Subject: Only onestepback() before pututxline() --- src/utmps/utmps-utmpd.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src') diff --git a/src/utmps/utmps-utmpd.c b/src/utmps/utmps-utmpd.c index af77a06..101e3ad 100644 --- a/src/utmps/utmps-utmpd.c +++ b/src/utmps/utmps-utmpd.c @@ -121,12 +121,6 @@ static void do_getent (void) answer(ESRCH) ; return ; } - if (!onestepback()) - { - unlockit() ; - answer(errno) ; - return ; - } unlockit() ; utmps_utmpx_unpack(buf+1, &b) ; utmps_utmpx_pack(buf+1, &b) ; @@ -156,18 +150,11 @@ static void do_getid (void) utmps_utmpx_unpack(sbuf+1, &b) ; if (idmatch(type, rbuf + USHORT_PACK, &b)) break ; } - if (!onestepback()) - { - unlockit() ; - answer(errno) ; - return ; - } unlockit() ; buffer_putnoflush(buffer_1small, sbuf, 1 + sizeof(struct utmpx)) ; flush1() ; } - static void do_getline (void) { char rbuf[UTMPS_UT_LINESIZE] ; @@ -189,12 +176,6 @@ static void do_getline (void) if ((b.ut_type == LOGIN_PROCESS || b.ut_type == USER_PROCESS) && !strncmp(rbuf, b.ut_line, UTMPS_UT_LINESIZE - 1)) break ; } - if (!onestepback()) - { - unlockit() ; - answer(errno) ; - return ; - } unlockit() ; buffer_putnoflush(buffer_1small, sbuf, 1 + sizeof(struct utmpx)) ; flush1() ; @@ -213,6 +194,7 @@ static void do_putline (uid_t uid, gid_t gid) utmps_utmpx_unpack(buf, &u) ; maybe_open() ; lockit(1) ; + onestepback() ; /* compatibility with glibc implementation */ for (;;) { struct utmpx b ; -- cgit 1.4.1