libauth: fix mount file-descriptor leak in auth_chuid()

This commit is contained in:
cinap_lenrek 2016-08-04 11:48:19 +02:00
parent 2a6fd6ec25
commit b540a22eb0

View file

@ -30,8 +30,10 @@ auth_chuid(AuthInfo *ai, char *ns)
/* get a link to factotum as new user */
fd = open("/srv/factotum", ORDWR);
if(fd >= 0)
if(fd >= 0){
mount(fd, -1, "/mnt", MREPL, "");
close(fd);
}
/* set up new namespace */
return newns(ai->cuid, ns);