]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/shared/utmp-wtmp.c
Get rid of dangling setutxent()
authorMertsA <mertsa@fb.com>
Wed, 11 Aug 2021 03:54:50 +0000 (20:54 -0700)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2021 07:40:10 +0000 (09:40 +0200)
commitbbd239f67a683fe63ee3698896fa503ff25031ed
tree896ce196ac24d4da32c2fb3a291044e96837d151
parent5afcf89ca29b518eb2fa244b015afc2708f77e1d
Get rid of dangling setutxent()

utmp_wall() and utmp_put_dead_process() called setutxent() directly instead of the stub in utmp-wtmp.h and never called endutxent(). This would leave /run/utmp left open by PID 1 or journald. This can be reproduced by e.g. lsof /run/utmp and systemd-cat -p 0 echo test. For utmp_put_dead_process() it would only leave it open if it returned early before calling write_utmp_wtmp()
src/shared/utmp-wtmp.c