diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-08-04 11:48:19 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-08-04 11:48:19 +0200 |
commit | b540a22eb0c287398e21358d6b66c8e544001f77 (patch) | |
tree | 29eb41e445cf1e37426eb856cca7538de219ea56 /sys/src/libauth | |
parent | 2a6fd6ec25c66e87dd0127651549a2f8585c751f (diff) |
libauth: fix mount file-descriptor leak in auth_chuid()
Diffstat (limited to 'sys/src/libauth')
-rw-r--r-- | sys/src/libauth/auth_chuid.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/src/libauth/auth_chuid.c b/sys/src/libauth/auth_chuid.c index 7ba0cfc6d..300e93f67 100644 --- a/sys/src/libauth/auth_chuid.c +++ b/sys/src/libauth/auth_chuid.c @@ -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); |