From 5a961254452c977be271ee78076a3f73cd33b5f8 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 22 Jun 2002 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2002-06-22 --- pc/devtv.c | 3 ++- port/devcap.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pc/devtv.c b/pc/devtv.c index bda0d7083829a0149fb8ea168c877966916fcf9e..cb92ac2c7d21720956e725b7705ca61a4e239e41 100644 --- a/pc/devtv.c +++ b/pc/devtv.c @@ -782,7 +782,8 @@ tvstat(Chan *c, uchar *db, int n) static Chan* tvopen(Chan *c, int omode) { - if (omode != OREAD && TYPE(c->qid) != Qctl) + if (omode != OREAD && + TYPE(c->qid) != Qctl && TYPE(c->qid) != Qvdata) error(Eperm); switch (TYPE(c->qid)) { diff --git a/port/devcap.c b/port/devcap.c index 313e3c426a2ba359d157c6270a4f11195dfc3b8b..3094705e1aad474fee6c30170051e1e642d5681e 100644 --- a/port/devcap.c +++ b/port/devcap.c @@ -89,6 +89,8 @@ capopen(Chan *c, int omode) qlock(&capalloc); switch((ulong)c->qid.path){ case Qhash: + if(!iseve()) + error(Eperm); if(capalloc.opens > 0){ qunlock(&capalloc); error("exclusive use");