2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

kerndat: redirect iptables output to /dev/null

fix for commit 68a938ea84 ("net/iptables: check iptables command has
wait option")

else each criu log contains iptables output:

(00.020184) Found task size of 7ffffffff000
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
(00.029481) irmap: Searching irmap cache in work dir

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Pavel Tikhomirov
2016-09-02 15:45:00 +03:00
committed by Pavel Emelyanov
parent 2dc2d8c56f
commit 0daef3d12f

View File

@@ -440,12 +440,20 @@ int kerndat_loginuid(bool only_dump)
static int kerndat_iptables_has_xtlocks(void)
{
int fd;
char *argv[4] = { "sh", "-c", "iptables -w -L", NULL };
fd = open("/dev/null", O_RDWR);
if (fd < 0) {
fd = -1;
pr_perror("failed to open /dev/null, using log fd for xtlocks check");
}
kdat.has_xtlocks = 1;
if (cr_system(-1, -1, -1, "sh", argv, CRS_CAN_FAIL) == -1)
if (cr_system(fd, fd, fd, "sh", argv, CRS_CAN_FAIL) == -1)
kdat.has_xtlocks = 0;
close_safe(&fd);
return 0;
}