]> git.ipfire.org Git - thirdparty/systemd.git/commit
util-lib/systemd-run: implement race-free PTY peer opening (#34953)
authorLuca Boccassi <bluca@debian.org>
Fri, 1 Nov 2024 11:29:19 +0000 (11:29 +0000)
committerGitHub <noreply@github.com>
Fri, 1 Nov 2024 11:29:19 +0000 (11:29 +0000)
commitfdccba15be26aa7d62f437cb23df01e28459e50f
treed141bb0798c71a0cb2e76aca490acaaea05fc42d
parentd86e9b64e49314f633fe9114c5b84f82758c89ef
parent42c8f1c761bee937d4416bdc1fadcbdb5f0eb665
util-lib/systemd-run: implement race-free PTY peer opening (#34953)

This makes use of the new TIOCGPTPEER pty ioctl() for directly opening a
PTY peer, without going via path names. This is nice because it closes a
race around allocating and opening the peer. And also has the nice
benefit that if we acquired an fd originating from some other
namespace/container, we can directly derive the peer fd from it, without
having to reenter the namespace again.
src/basic/terminal-util.c
src/basic/terminal-util.h