run: do not pass the pty slave fd to transient service in a machine
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 Jun 2024 11:30:09 +0000 (13:30 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 6 Jun 2024 19:37:39 +0000 (20:37 +0100)
commitddef3ec87c1f63fed868f769d246b0b3d6877f88
tree530246c9805c45399c56c93796a37c46854bdee5
parent7632b8abc4c07034188a946adc4001a0115813cf
run: do not pass the pty slave fd to transient service in a machine

Follow-up for 28459ba1f4df824d5ef7f7d1a9acb6953ea24045

The pty path returned by OpenMachinePTY() cannot be opened from outside
the machine, hence let's use the plain Standard{Input,Output,Error}=tty
in such a case. This means if --machine= is specified, #32916 would occur.
A comprehensive fix requires a new dbus method in machined, which shall
be material for v257.

See also: https://github.com/systemd/systemd/pull/33216#discussion_r1628020429

Replaces #33216

Co-authored-by: Mike Yuan <me@yhndnzj.com>
src/run/run.c