devtls, devssl: make sure channel has ORDWR mode and is not a mount chan on fdtochan()
This commit is contained in:
parent
8173223f43
commit
409babb990
2 changed files with 2 additions and 2 deletions
|
@ -1436,7 +1436,7 @@ buftochan(char *p)
|
|||
fd = strtoul(p, 0, 0);
|
||||
if(fd < 0)
|
||||
error(Ebadarg);
|
||||
c = fdtochan(fd, -1, 0, 1); /* error check and inc ref */
|
||||
c = fdtochan(fd, ORDWR, 1, 1); /* error check and inc ref */
|
||||
if(devtab[c->type] == &ssldevtab){
|
||||
cclose(c);
|
||||
error("cannot ssl encrypt devssl files");
|
||||
|
|
|
@ -1872,7 +1872,7 @@ buftochan(char *p)
|
|||
fd = strtoul(p, 0, 0);
|
||||
if(fd < 0)
|
||||
error(Ebadarg);
|
||||
c = fdtochan(fd, -1, 0, 1); /* error check and inc ref */
|
||||
c = fdtochan(fd, ORDWR, 1, 1); /* error check and inc ref */
|
||||
return c;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue