summaryrefslogtreecommitdiff
path: root/sys/src/libauth/auth_chuid.c
diff options
context:
space:
mode:
authorAlex Musolino <alex@musolino.id.au>2020-12-15 20:55:41 +1030
committerAlex Musolino <alex@musolino.id.au>2020-12-15 20:55:41 +1030
commit3749e92cdb88a157f99c0709a264bd508603be9b (patch)
tree49ce703965ba4114490729c5aeabd9ba120d9b78 /sys/src/libauth/auth_chuid.c
parent404c901f299c4d93cb159a3c44c2977a25408319 (diff)
parent32291b52bcbd6976051acff1692b571e321ac859 (diff)
merge
Diffstat (limited to 'sys/src/libauth/auth_chuid.c')
-rw-r--r--sys/src/libauth/auth_chuid.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/libauth/auth_chuid.c b/sys/src/libauth/auth_chuid.c
index 300e93f67..4703ea000 100644
--- a/sys/src/libauth/auth_chuid.c
+++ b/sys/src/libauth/auth_chuid.c
@@ -16,7 +16,7 @@ auth_chuid(AuthInfo *ai, char *ns)
}
/* change uid */
- fd = open("#¤/capuse", OWRITE);
+ fd = open("#¤/capuse", OWRITE|OCEXEC);
if(fd < 0){
werrstr("opening #¤/capuse: %r");
return -1;
@@ -31,8 +31,8 @@ auth_chuid(AuthInfo *ai, char *ns)
/* get a link to factotum as new user */
fd = open("/srv/factotum", ORDWR);
if(fd >= 0){
- mount(fd, -1, "/mnt", MREPL, "");
- close(fd);
+ if(mount(fd, -1, "/mnt", MREPL, "") == -1)
+ close(fd);
}
/* set up new namespace */