dont leak the /proc/self/setgroups fd
commit8a344343ba39d20832fed8d0966012b8f4f226b0
authorMichael Bishop <cleverca22@gmail.com>
dateThu 5 Apr 2018, 15:24 (9 years ago)
parent5e49fbc
nix-user-chroot/main.cpp+1
@@ -202,6 +202,7 @@ int main(int argc, char *argv[]) {
202202 int fd_setgroups = open("/proc/self/setgroups", O_WRONLY);
203203 if (fd_setgroups > 0) {
204204 write(fd_setgroups, "deny", 4);
205+ close(fd_setgroups);
205206 }
206207
207208 // map the original uid/gid in the new ns