Commit bf94ff3a authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

check: Don't forget to init mountns

Otherwise fstatat fails as

> > $ ./crtools check
> > Error (sk-unix.c: 283): Can't stat socket 12547 (./var/run/sdp): Bad file descriptor
Reported-by: 's avatar"Muralidhar, Rajeev D" <rajeev.d.muralidhar@intel.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent d8af1d72
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "files.h" #include "files.h"
#include "sk-inet.h" #include "sk-inet.h"
#include "proc_parse.h" #include "proc_parse.h"
#include "mount.h"
static int check_map_files(void) static int check_map_files(void)
{ {
...@@ -334,6 +335,11 @@ int cr_check(void) ...@@ -334,6 +335,11 @@ int cr_check(void)
{ {
int ret = 0; int ret = 0;
if (mntns_collect_root(getpid())) {
pr_err("Can't collect root mount point\n");
return -1;
}
ret |= check_map_files(); ret |= check_map_files();
ret |= check_sock_diag(); ret |= check_sock_diag();
ret |= check_ns_last_pid(); ret |= check_ns_last_pid();
......
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