summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cwfs/9p2.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-12-07 09:53:08 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2012-12-07 09:53:08 +0100
commit950706198644c4715efbc95ec79857fd4fa55353 (patch)
tree585bcd04140cbaf7e8b788b68ba737d6555be897 /sys/src/cmd/cwfs/9p2.c
parent52b500af6185068233ff021b2160463192f69ef0 (diff)
cwfs: allow previously authorized channels to attach as none
we allow allow previously authorized channels to attach as none even if anonymous logins are disabled with nonone.
Diffstat (limited to 'sys/src/cmd/cwfs/9p2.c')
-rw-r--r--sys/src/cmd/cwfs/9p2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/src/cmd/cwfs/9p2.c b/sys/src/cmd/cwfs/9p2.c
index 692dcdceb..8c34691f5 100644
--- a/sys/src/cmd/cwfs/9p2.c
+++ b/sys/src/cmd/cwfs/9p2.c
@@ -209,7 +209,7 @@ authorize(Chan* chan, Fcall* f)
return uid;
}
- if(f->afid == NOFID && !nonone){
+ if(f->afid == NOFID && (!nonone || chan->authok)){
uid = strtouid(f->uname);
if(db)
fprint(2, "permission granted to none: uid %s = %d\n",
@@ -230,6 +230,10 @@ authorize(Chan* chan, Fcall* f)
if(db)
fprint(2, "authorize: uid is %d\n", uid);
qunlock(af);
+
+ if(uid > 0)
+ chan->authok = 1;
+
return uid;
}