<p dir="ltr"><br>
On Aug 14, 2014 10:00 PM, "Pavel Emelyanov" <<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>> wrote:<br>
><br>
> On 08/14/2014 09:18 PM, Andrey Vagin wrote:<br>
> > When we open tty, we don't want to set it as controlling terminal.<br>
><br>
> What if it was controlling when we dumped it? Who would<br>
> restore this "state"</p>
<p dir="ltr">Yes, we call ioctl (<b>TIOCSCTTY</b>). I can't show a place in code, because I'm from the phone.</p>
<p dir="ltr">><br>
> > This bug was caught by pty04. Where we get unexpected SIGCONT,<br>
> > which is sent after closing a controlling terminal.<br>
> ><br>
> > ./pty04 --pidfile=pty04.pid --outfile=pty04.out<br>
> > Dump 9578<br>
> > Restore<br>
> > Test: zdtm/live/static/pty04, Result: FAIL<br>
> > ==================================== ERROR ====================================<br>
> > Test: zdtm/live/static/pty04, Namespace:<br>
> > Dump log : /home/jenkins/workspace/Rpi-CRIU/test/dump/static/pty04/9578/1/dump.log<br>
> > --------------------------------- grep Error ---------------------------------<br>
> > ------------------------------------- END -------------------------------------<br>
> > Restore log: /home/jenkins/workspace/Rpi-CRIU/test/dump/static/pty04/9578/1/restore.log<br>
> > --------------------------------- grep Error ---------------------------------<br>
> > (00.083420) Error (cr-restore.c:1092): 9578 killed by signal 0<br>
> > (00.083708) Error (cr-restore.c:1713): Restoring FAILED.<br>
> > ------------------------------------- END -------------------------------------<br>
> > ================================= ERROR OVER =================================<br>
> ><br>
> > Reported-by: Mr Jenkins<br>
> > Signed-off-by: Andrey Vagin <<a href="mailto:avagin@openvz.org">avagin@openvz.org</a>><br>
> > ---<br>
> > tty.c | 2 +-<br>
> > 1 file changed, 1 insertion(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/tty.c b/tty.c<br>
> > index 5fca74c..6d351cd 100644<br>
> > --- a/tty.c<br>
> > +++ b/tty.c<br>
> > @@ -557,7 +557,7 @@ static int pty_open_unpaired_slave(struct file_desc *d, struct tty_info *slave)<br>
> ><br>
> > unlock_pty(master);<br>
> ><br>
> > - fd = open(pts_name, slave->tfe->flags);<br>
> > + fd = open(pts_name, slave->tfe->flags | O_NOCTTY);<br>
> > if (fd < 0) {<br>
> > pr_perror("Can't open slave %s", pts_name);<br>
> > goto err;<br>
> ><br>
><br>
</p>