on master help sign in
Merge pull request #32 from input-output-hk/dont-leak-setgroups
107eec3Matthew Justin Bauer
nix-user-chroot/main.cpp+1
@@ -202,6 +202,7 @@ int main(int argc, char *argv[]) {
202 int fd_setgroups = open("/proc/self/setgroups", O_WRONLY);
202 int fd_setgroups = open("/proc/self/setgroups", O_WRONLY);
203 if (fd_setgroups > 0) {
203 if (fd_setgroups > 0) {
204 write(fd_setgroups, "deny", 4);
204 write(fd_setgroups, "deny", 4);
205+ close(fd_setgroups);
205 }
206 }
206
207
207 // map the original uid/gid in the new ns
208 // map the original uid/gid in the new ns