]> git.ipfire.org Git - thirdparty/systemd.git/commit
ptyfwd: Imply PTY_FORWARD_READ_ONLY if stdin isn't readable
authorDaan De Meyer <daan@amutable.com>
Wed, 20 May 2026 12:14:52 +0000 (12:14 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 20 May 2026 16:04:13 +0000 (18:04 +0200)
commit12836f982a29215ee0fa1a608ec7935c7ee903c4
treee990d3c31b4612fe9c1224d2a56c1d28716935dd
parentf941dff917a81274a1b056e1845cd6930e8b02f0
ptyfwd: Imply PTY_FORWARD_READ_ONLY if stdin isn't readable

if stdin is connected to a closed pipe or similar, imply
PTY_FORWARD_READ_ONLY so we don't even try to read from it
in the first place. Otherwise we'll immediately get a hangup
which will cause the forwarder to call sd_event_exit() and
shut down the event loop.

Debugged-by: Christian Brauner <brauner@kernel.org>
src/shared/ptyfwd.c