summaryrefslogtreecommitdiff
path: root/sys/src/cmd/cwfs/9p2.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-12-07 06:30:26 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2012-12-07 06:30:26 +0100
commit52b500af6185068233ff021b2160463192f69ef0 (patch)
tree9b814505c911590988910f4af3273362b3e4d154 /sys/src/cmd/cwfs/9p2.c
parent3bf1e0798b9d002801d5af114052474f08aa1c64 (diff)
cwfs: make none attach work
allow attach as none. (this was supposed to work but it doesnt for 9p2000 because we have to check for afid being NOFID instead of checking the uname string). and add "nonone" flag to disable this.
Diffstat (limited to 'sys/src/cmd/cwfs/9p2.c')
-rw-r--r--sys/src/cmd/cwfs/9p2.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/src/cmd/cwfs/9p2.c b/sys/src/cmd/cwfs/9p2.c
index 87736ab6e..692dcdceb 100644
--- a/sys/src/cmd/cwfs/9p2.c
+++ b/sys/src/cmd/cwfs/9p2.c
@@ -201,20 +201,20 @@ authorize(Chan* chan, Fcall* f)
db = cons.flags & authdebugflag;
- if(strcmp(f->uname, "none") == 0){
+ if(noauth || wstatallow){
uid = strtouid(f->uname);
if(db)
- fprint(2, "permission granted to none: uid %s = %d\n",
+ fprint(2, "permission granted by noauth uid %s = %d\n",
f->uname, uid);
return uid;
}
- if(noauth || wstatallow){
+ if(f->afid == NOFID && !nonone){
uid = strtouid(f->uname);
if(db)
- fprint(2, "permission granted by noauth uid %s = %d\n",
+ fprint(2, "permission granted to none: uid %s = %d\n",
f->uname, uid);
- return uid;
+ return 0; /* none */
}
af = filep(chan, f->afid, 0);