diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-12-07 16:47:06 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-12-07 16:47:06 +0100 |
commit | f7e21d7692e619e9a926f29f2d59906c0d7ef072 (patch) | |
tree | fa0b89c649dcd9e1bd37f953a5ab23c09b01453d | |
parent | f433f1426b10dc7bdd313ee72b842e27089f88f1 (diff) | |
download | plan9front-f7e21d7692e619e9a926f29f2d59906c0d7ef072.tar.xz |
libauthsrv: open internal file-descriptors with OCEXEC flag
-rw-r--r-- | sys/src/libauthsrv/readcons.c | 6 | ||||
-rw-r--r-- | sys/src/libauthsrv/readnvram.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/src/libauthsrv/readcons.c b/sys/src/libauthsrv/readcons.c index 8a7a3af27..d9a9ead94 100644 --- a/sys/src/libauthsrv/readcons.c +++ b/sys/src/libauthsrv/readcons.c @@ -13,13 +13,13 @@ readcons(char *prompt, char *def, int raw) s = p = nil; fdout = ctl = -1; - if((fdin = open("/dev/cons", OREAD)) < 0) + if((fdin = open("/dev/cons", OREAD|OCEXEC)) < 0) goto Out; - if((fdout = open("/dev/cons", OWRITE)) < 0) + if((fdout = open("/dev/cons", OWRITE|OCEXEC)) < 0) goto Out; if(raw){ - if((ctl = open("/dev/consctl", OWRITE)) < 0) + if((ctl = open("/dev/consctl", OWRITE|OCEXEC)) < 0) goto Out; write(ctl, "rawon", 5); } diff --git a/sys/src/libauthsrv/readnvram.c b/sys/src/libauthsrv/readnvram.c index 1a00835cf..e13641bd6 100644 --- a/sys/src/libauthsrv/readnvram.c +++ b/sys/src/libauthsrv/readnvram.c @@ -91,9 +91,9 @@ findnvram(Nvrwhere *locp) v[0] = ""; v[1] = nil; } - fd = open(v[0], ORDWR); + fd = open(v[0], ORDWR|OCEXEC); if (fd < 0) - fd = open(v[0], OREAD); + fd = open(v[0], OREAD|OCEXEC); safelen = sizeof(Nvrsafe); if(strstr(v[0], "/9fat") == nil) safeoff = 0; @@ -120,7 +120,7 @@ findnvram(Nvrwhere *locp) for(i=0; i<nelem(nvtab); i++){ if(strcmp(cputype, nvtab[i].cputype) != 0) continue; - if((fd = open(nvtab[i].file, ORDWR)) < 0) + if((fd = open(nvtab[i].file, ORDWR|OCEXEC)) < 0) continue; safeoff = nvtab[i].off; safelen = nvtab[i].len; |