commit e39620502e6b32eee63d515326263d3566914cb0 from: Omar Polo date: Thu Dec 30 11:19:35 2021 UTC fix the stat on directories For directories, f-dir->fd is *the* file descriptor associated with that directory, so doing a fstatat(f->dir->fd, f->fpath) was trying to do a lookup for f->fpath (the directory name) *inside* the directory itself. bug spotted by cage, thanks! commit - a1aa276fa0d5c922c6ed4cd0d80021e5520473b0 commit + e39620502e6b32eee63d515326263d3566914cb0 blob - cd6f7bf693c06b795b6ea74c5abc59bd5ea5e667 blob + c56f6a0b744d2ebd8a7591100e72ccb44ecdf21a --- client.c +++ client.c @@ -1506,6 +1506,8 @@ tstat(struct np_msg_header *hdr, const uint8_t *data, if (f->fd != -1) r = fstat(f->fd, &sb); + else if (f->qid.type & QTDIR) + r = fstat(f->dir->fd, &sb); else r = fstatat(f->dir->fd, f->fpath, &sb, 0);