summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-12-09 01:04:03 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-12-09 01:04:03 +0100
commiteb3d055eb376cb930a15ea85f594185f754223e9 (patch)
tree58f64bb820da62180aa140956a1b52c98864127d
parent5149f204b78b7969c0cb865ff376fc21a2c50297 (diff)
downloadplan9front-eb3d055eb376cb930a15ea85f594185f754223e9.tar.xz
backout OCEXEC changes when potentially opening /srv files
Opening a /srv file sets the close-on-exec flag on the shared channel breaking the exportfs openmount() hack. The devsrv tries to prevent posting a channel with the close-on-exec or remove-on-close flags. but nothing currently prevents this poisoning on open. Until this gets fixed in eigther exportfs or devsrv, i'll back out the changes that could have potential side effects like this.
-rw-r--r--sys/src/libauth/auth_chuid.c2
-rw-r--r--sys/src/libauth/newns.c2
-rw-r--r--sys/src/libc/9sys/access.c2
-rw-r--r--sys/src/libdraw/newwindow.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/libauth/auth_chuid.c b/sys/src/libauth/auth_chuid.c
index 6b3819e86..4703ea000 100644
--- a/sys/src/libauth/auth_chuid.c
+++ b/sys/src/libauth/auth_chuid.c
@@ -29,7 +29,7 @@ auth_chuid(AuthInfo *ai, char *ns)
}
/* get a link to factotum as new user */
- fd = open("/srv/factotum", ORDWR|OCEXEC);
+ fd = open("/srv/factotum", ORDWR);
if(fd >= 0){
if(mount(fd, -1, "/mnt", MREPL, "") == -1)
close(fd);
diff --git a/sys/src/libauth/newns.c b/sys/src/libauth/newns.c
index 91bf5f802..c0f866b9b 100644
--- a/sys/src/libauth/newns.c
+++ b/sys/src/libauth/newns.c
@@ -194,7 +194,7 @@ nsop(char *fn, int argc, char *argv[], AuthRpc *rpc)
else if(argc == 2)
unmount(argv[0], argv[1]);
}else if(strcmp(argv0, "mount") == 0){
- fd = open(argv[0], ORDWR|OCEXEC);
+ fd = open(argv[0], ORDWR);
if(fd < 0){
if(newnsdebug)
fprint(2, "%s: mount: %s: %r\n", fn, argv[0]);
diff --git a/sys/src/libc/9sys/access.c b/sys/src/libc/9sys/access.c
index 86e459955..c9fee3432 100644
--- a/sys/src/libc/9sys/access.c
+++ b/sys/src/libc/9sys/access.c
@@ -24,7 +24,7 @@ access(char *name, int mode)
return 0;
return -1;
}
- fd = open(name, omode[mode&7]|OCEXEC);
+ fd = open(name, omode[mode&7]);
if(fd >= 0){
close(fd);
return 0;
diff --git a/sys/src/libdraw/newwindow.c b/sys/src/libdraw/newwindow.c
index 73306be03..2fb708bef 100644
--- a/sys/src/libdraw/newwindow.c
+++ b/sys/src/libdraw/newwindow.c
@@ -13,7 +13,7 @@ newwindow(char *str)
wsys = getenv("wsys");
if(wsys == nil)
return -1;
- fd = open(wsys, ORDWR|OCEXEC);
+ fd = open(wsys, ORDWR);
if(fd < 0){
free(wsys);
return -1;