]> git.ipfire.org Git - thirdparty/util-linux.git/commit
login: Restore tty size after calling vhangup()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 30 Oct 2021 14:56:14 +0000 (15:56 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 2 Nov 2021 11:08:07 +0000 (11:08 +0000)
commit7e58b71dfa9bf27f574fd79424f56206f44fa806
tree3a198028271ba7422b5059a4b4ff8a743087797b
parent168b2ad8ec41e5bf856f39b765960466d23cf2da
login: Restore tty size after calling vhangup()

If login receives the tty to work on via stdin, stdout and stderr,
login might end up closing the remaining open file descriptors to
the tty just before it calls vhangup(). When the last open file
descriptors to a tty are closed, it's configured size is reset to
0x0. To avoid this from happening, save the size before closing
the stdin, stdout and stderr file descriptors and reapply the size
after the tty is re-opened.

Fixes #1484
login-utils/login.c