Merge pull request #634 from tonistiigi/clear-groups

Clear groups after entering userns
This commit is contained in:
Mrunal Patel 2016-03-11 09:45:39 -08:00
commit 2524befb52
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include <sys/types.h>
#include <sys/prctl.h>
#include <unistd.h>
#include <grp.h>
#include <bits/sockaddr.h>
#include <linux/types.h>
@ -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) {