diff --git a/libcontainer/nsenter/nsexec.c b/libcontainer/nsenter/nsexec.c index a52b7dc3..ee51c475 100644 --- a/libcontainer/nsenter/nsexec.c +++ b/libcontainer/nsenter/nsexec.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -383,6 +384,11 @@ static void process_nl_attributes(int pipenum, char *data, int data_size) pr_perror("setgid failed"); exit(1); } + + if (setgroups(0, NULL) == -1) { + pr_perror("setgroups failed"); + exit(1); + } if (consolefd != -1) { if (ioctl(consolefd, TIOCSCTTY, 0) == -1) {