[CRIU] [PATCH] tty: open tty-s with O_NOCTTY

Andrey Wagin avagin at gmail.com
Thu Aug 14 11:28:59 PDT 2014


On Aug 14, 2014 10:00 PM, "Pavel Emelyanov" <xemul at parallels.com> wrote:
>
> On 08/14/2014 09:18 PM, Andrey Vagin wrote:
> > When we open tty, we don't want to set it as controlling terminal.
>
> What if it was controlling when we dumped it? Who would
> restore this "state"

Yes, we call ioctl (*TIOCSCTTY*). I can't show a place in code, because I'm
from the phone.

>
> > This bug was caught by pty04. Where we get unexpected SIGCONT,
> > which is sent after closing a controlling terminal.
> >
> > ./pty04 --pidfile=pty04.pid --outfile=pty04.out
> > Dump 9578
> > Restore
> > Test: zdtm/live/static/pty04, Result: FAIL
> > ==================================== ERROR
====================================
> > Test: zdtm/live/static/pty04, Namespace:
> > Dump log   :
/home/jenkins/workspace/Rpi-CRIU/test/dump/static/pty04/9578/1/dump.log
> > --------------------------------- grep Error
---------------------------------
> > ------------------------------------- END
-------------------------------------
> > Restore log:
/home/jenkins/workspace/Rpi-CRIU/test/dump/static/pty04/9578/1/restore.log
> > --------------------------------- grep Error
---------------------------------
> > (00.083420) Error (cr-restore.c:1092): 9578 killed by signal 0
> > (00.083708) Error (cr-restore.c:1713): Restoring FAILED.
> > ------------------------------------- END
-------------------------------------
> > ================================= ERROR OVER
=================================
> >
> > Reported-by: Mr Jenkins
> > Signed-off-by: Andrey Vagin <avagin at openvz.org>
> > ---
> >  tty.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tty.c b/tty.c
> > index 5fca74c..6d351cd 100644
> > --- a/tty.c
> > +++ b/tty.c
> > @@ -557,7 +557,7 @@ static int pty_open_unpaired_slave(struct file_desc
*d, struct tty_info *slave)
> >
> >               unlock_pty(master);
> >
> > -             fd = open(pts_name, slave->tfe->flags);
> > +             fd = open(pts_name, slave->tfe->flags | O_NOCTTY);
> >               if (fd < 0) {
> >                       pr_perror("Can't open slave %s", pts_name);
> >                       goto err;
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140814/deb16348/attachment.html>


More information about the CRIU mailing list