Commit 0daef3d1 authored by Pavel Tikhomirov's avatar Pavel Tikhomirov Committed by Pavel Emelyanov

kerndat: redirect iptables output to /dev/null

fix for commit 68a938ea ("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: 's avatarPavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 2dc2d8c5
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment