2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

sockets: fail if an unsupported socket is in a dumped netns

If netns is dumped, crtools fails if it collects unsupported sockets.

If netns isn't dumped, crtools will fail only
if an unsupported socket should be dumped.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2012-08-14 12:49:21 +04:00
committed by Pavel Emelyanov
parent acf73093df
commit d0476ea93b

View File

@@ -1505,17 +1505,19 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
if (collect_pstree(pid, opts))
goto err;
/*
* Ignore collection errors by now since we may not want
* to dump the missed sockets. But later, when we will start
* dumping containers, we'll better fail here, rather than
* in the dump stage
*/
if (mntns_collect_root(root_item->pid.real))
goto err;
collect_sockets(pid);
ret = collect_sockets(pid);
/*
* If netns isn't dumped, crtools will fail only
* if an unsupported socket will be really dumped.
*/
if ((opts->namespaces_flags & CLONE_NEWNET) && ret)
goto err;
ret = -1;
glob_fdset = cr_glob_fdset_open(O_DUMP);
if (!glob_fdset)