From 2e8efc1bc72ed20aac5182b442d3103c554497e0 Mon Sep 17 00:00:00 2001 From: Lifubang Date: Sat, 16 Mar 2019 13:08:24 +0800 Subject: [PATCH] add prompt when rootless users have no read access to runc bin Signed-off-by: Lifubang --- libcontainer/nsenter/cloned_binary.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcontainer/nsenter/cloned_binary.c b/libcontainer/nsenter/cloned_binary.c index b410e295..babd9993 100644 --- a/libcontainer/nsenter/cloned_binary.c +++ b/libcontainer/nsenter/cloned_binary.c @@ -95,8 +95,10 @@ static int is_self_cloned(void) struct statfs fsbuf = {}; fd = open("/proc/self/exe", O_RDONLY|O_CLOEXEC); - if (fd < 0) + if (fd < 0) { + fprintf(stderr, "you have no read access to runc binary file\n"); return -ENOTRECOVERABLE; + } /* * Is the binary a fully-sealed memfd? We don't need CLONED_BINARY_ENV for