Commit d0476ea9 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

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: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent acf73093
......@@ -1505,17 +1505,19 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
if (collect_pstree(pid, opts))
goto err;
if (mntns_collect_root(root_item->pid.real))
goto err;
ret = collect_sockets(pid);
/*
* 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 netns isn't dumped, crtools will fail only
* if an unsupported socket will be really dumped.
*/
if (mntns_collect_root(root_item->pid.real))
if ((opts->namespaces_flags & CLONE_NEWNET) && ret)
goto err;
collect_sockets(pid);
ret = -1;
glob_fdset = cr_glob_fdset_open(O_DUMP);
if (!glob_fdset)
......
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