From cd85dac87ed20a12ba668d974da055f1c78a0246 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Wed, 4 Jun 2014 18:03:17 -0700 Subject: [PATCH] Exclude the user namespace for setns Docker-DCO-1.1-Signed-off-by: Michael Crosby (github: crosbymichael) --- libcontainer/namespaces/nsenter.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libcontainer/namespaces/nsenter.go b/libcontainer/namespaces/nsenter.go index c5dd2e7..d5c2e76 100644 --- a/libcontainer/namespaces/nsenter.go +++ b/libcontainer/namespaces/nsenter.go @@ -85,8 +85,9 @@ void nsenter() { fprintf(stderr, "nsenter: Failed to open directory \"%s\" with error: \"%s\"\n", ns_dir, strerror(errno)); exit(1); } + while((dent = readdir(dir)) != NULL) { - if(strcmp(dent->d_name, ".") == 0 || strcmp(dent->d_name, "..") == 0) { + if(strcmp(dent->d_name, ".") == 0 || strcmp(dent->d_name, "..") == 0 || strcmp(dent->d_name, "user") == 0) { continue; }