summaryrefslogtreecommitdiff
path: root/sys/src/libauth/auth_chuid.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-12-07 16:46:34 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-12-07 16:46:34 +0100
commitf433f1426b10dc7bdd313ee72b842e27089f88f1 (patch)
treee06562452c98faf2c4dfbb435d803781596e9d9a /sys/src/libauth/auth_chuid.c
parentf341ae8c777dda2876beb4d4a1c67c4e920595ca (diff)
libauth: open internal file-descriptors with OCEXEC flag
Diffstat (limited to 'sys/src/libauth/auth_chuid.c')
-rw-r--r--sys/src/libauth/auth_chuid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/libauth/auth_chuid.c b/sys/src/libauth/auth_chuid.c
index 300e93f67..6b3819e86 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;
@@ -29,10 +29,10 @@ auth_chuid(AuthInfo *ai, char *ns)
}
/* get a link to factotum as new user */
- fd = open("/srv/factotum", ORDWR);
+ fd = open("/srv/factotum", ORDWR|OCEXEC);
if(fd >= 0){
- mount(fd, -1, "/mnt", MREPL, "");
- close(fd);
+ if(mount(fd, -1, "/mnt", MREPL, "") == -1)
+ close(fd);
}
/* set up new namespace */