libauthsrv: open internal file-descriptors with OCEXEC flag

This commit is contained in:
cinap_lenrek 2020-12-07 16:47:06 +01:00
parent f433f1426b
commit f7e21d7692
2 changed files with 6 additions and 6 deletions

View file

@ -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);
}

View file

@ -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;