ref: c680fb2b3a3a34519d6901cf3f7606f9cdaa874f
parent: f625f5ccc37f9b5a8155e3bdfff8899f9215dffd
author: Ori Bernstein <[email protected]>
date: Sun Feb 18 20:41:57 EST 2024
fs,user: correct qid type check (&DIR != 0, not == FILE) there are other type bits, so we need to check whether we have a dir, not whether there are any flags.
--- a/fs.c
+++ b/fs.c
@@ -1644,7 +1644,7 @@
Tree *t;
Scan s;
- if(f->dent->qid.type == QTFILE)
+ if(!(f->dent->qid.type & QTDIR))
return nil;
t = agetp(&f->mnt->root);
@@ -1693,7 +1693,7 @@
mb[0].nk = f->dent->nk;
mb[0].nv = 0;
- if(f->dent->qid.type &= QTDIR){
+ if(f->dent->qid.type & QTDIR){
packsuper(upbuf, sizeof(upbuf), f->qpath);
mb[1].op = Oclobber;
mb[1].k = upbuf;
--- a/user.c
+++ b/user.c
@@ -229,7 +229,7 @@
error(Efs);
if(walk1(t, q.path, "users", &q, &len) == -1)
error(Esrch);
- if(q.type != QTFILE)
+ if(q.type & QTDIR)
error(Etype);
if(len >= 1*MiB)
error(Efsize);