ae3dde801253b1d5f7363bb9fb06bcb230f00eb8 |
|
07-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
machinectl: fix race when opening new shells with "machinectl shell"
Previously, we'd allocate the TTY, spawn a service on it, but
immediately start processing the TTY and forwarding it to whatever the
commnd was started on. This is however problematic, as the TTY might get
actually opened only much later by the service. We'll hence first get
EIOs on the master as the other side is still closed, and hence
considered it hung up and terminated the session.
With this change we add a flag to the pty forwarding logic:
PTY_FORWARD_IGNORE_INITIAL_VHANGUP. If set, we'll ignore all hangups
(i.e. EIOs) on the master PTY until the first byte is successfully read.
From that point on we consider a hangup/EIO a regular connection termination. This
way, we handle the race: when we get EIO initially we'll ignore it,
until the connection is properly set up, at which time we start
honouring it. |
d60473c7ba32f2325a13f0357b23fd8e25609650 |
|
21-Feb-2014 |
Lennart Poettering <lennart@poettering.net> |
ptyfwd: reset nonblocking mode
Apparently bash doesn't turn off non-blocking mode on stdin/stdout when
reading from it, so be nice to bash. Ideally bash would do this on its
own for robustness reasons, though.
https://bugs.freedesktop.org/show_bug.cgi?id=70622 |
90d14d2015dda79c7b465b74dd3aaf2dfc25d43c |
|
11-Dec-2013 |
Luke Shumaker <LukeShu@sbcglobal.net> |
ptyfwd: Don't set the output prop of stdin, nor the input props of stdout.
It was calling cfmakeraw(3) on the properties for STDIN_FILENO; cfmakeraw
sets both input and output properties. If (and only if) stdin and stdout
are the same device is this correct. Otherwise, we must change only the
input properties of stdin, and only the output properties of stdout. |