From 409babb990a4740e5274b22d65cb4df451a277fd Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 24 Jul 2016 03:24:42 +0200 Subject: devtls, devssl: make sure channel has ORDWR mode and is not a mount chan on fdtochan() --- sys/src/9/port/devssl.c | 2 +- sys/src/9/port/devtls.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/src/9/port') diff --git a/sys/src/9/port/devssl.c b/sys/src/9/port/devssl.c index 9c46a8fde..32b207618 100644 --- a/sys/src/9/port/devssl.c +++ b/sys/src/9/port/devssl.c @@ -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"); diff --git a/sys/src/9/port/devtls.c b/sys/src/9/port/devtls.c index f5d4fa493..81f50d3a6 100644 --- a/sys/src/9/port/devtls.c +++ b/sys/src/9/port/devtls.c @@ -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; } -- cgit v1.2.3