mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 10:16:41 +00:00
zdtm: check a case when a slave pty is mounted to somewhere
travis-ci: success for A few fixes to c/r a docker container with a console (rev3) Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
aa26237e51
commit
50864274db
4 changed files with 19 additions and 0 deletions
|
|
@ -114,6 +114,7 @@ TST_NOFILE := \
|
|||
rlimits00 \
|
||||
pty00 \
|
||||
pty01 \
|
||||
pty-console \
|
||||
pty02 \
|
||||
pty03 \
|
||||
pty04 \
|
||||
|
|
@ -452,6 +453,8 @@ socket-tcp6-last-ack: override CFLAGS += -D ZDTM_TCP_LAST_ACK -D ZDTM_IPV6
|
|||
socket-tcp6-closing: override CFLAGS += -D ZDTM_IPV6
|
||||
socket-tcp6-unconn: override CFLAGS += -D ZDTM_IPV6
|
||||
|
||||
pty-console: override CFLAGS += -D ZDTM_DEV_CONSOLE
|
||||
|
||||
$(LIB): force
|
||||
$(Q) $(MAKE) -C $(LIBDIR)
|
||||
|
||||
|
|
|
|||
1
test/zdtm/static/pty-console.c
Symbolic link
1
test/zdtm/static/pty-console.c
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
pty01.c
|
||||
1
test/zdtm/static/pty-console.desc
Normal file
1
test/zdtm/static/pty-console.desc
Normal file
|
|
@ -0,0 +1 @@
|
|||
{'flags': 'suid', 'flavor' : 'ns uns'}
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
#include <string.h>
|
||||
#include <termios.h>
|
||||
#include <signal.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
#include "zdtmtst.h"
|
||||
|
||||
|
|
@ -51,6 +52,19 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifdef ZDTM_DEV_CONSOLE
|
||||
{
|
||||
int fd;
|
||||
fd = open("/dev/console", O_CREAT | O_RDONLY, 0755);
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
close(fd);
|
||||
|
||||
if (mount(slavename, "/dev/console", NULL, MS_BIND, NULL))
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fchown(slave1, new_uid, new_gid)) {
|
||||
pr_perror("Can't set uid/gid on %s", slavename);
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue