commit 9029ac6f3c1fa3e42c6fa231f8a45ed05d68b61e from: Omar Polo date: Wed Jan 19 21:37:02 2022 UTC wstat: missing read for size 9p stat message have a leading 2 bytes long size field. It's meant to simplify the parsing, because while reading the contents of a directory it's necessary to know how much long an entry is, so the length field is present even in the Rstat reply and in the Twstat input. Previously we didn't consume that bit and thus mis-read all of the following fields. commit - 6d3d71a91bb82be60ffc572865e4329c40215dfe commit + 9029ac6f3c1fa3e42c6fa231f8a45ed05d68b61e blob - 8b16892bcf51349c7b45cd373f9b19a7c9350974 blob + 300c345fa99a16c95d35c0c6d1da5cf24bbcbd9e --- kamid/client.c +++ kamid/client.c @@ -863,7 +863,8 @@ np_readst(const char *t, const char *f, struct np_stat { memset(st, 0, sizeof(*st)); - if (!np_read16(t, "stat.type", &st->type, src, len) || + if (!np_read16(t, "stat.size", &st->size, src, len) || + !np_read16(t, "stat.type", &st->type, src, len) || !np_read32(t, "stat.dev", &st->dev, src, len) || !np_read64(t, "stat.qid.path", &st->qid.path, src, len) || !np_read32(t, "stat.qid.vers", &st->qid.vers, src, len) || blob - e0997ea9e3860b7766c49dfbb9e23451b62101cb blob + 3fb6ef84d6a0767820124adec82e8ff307458353 --- lib/kami.h +++ lib/kami.h @@ -36,6 +36,7 @@ struct qid { }; struct np_stat { + uint16_t size; uint16_t type; uint32_t dev; struct qid qid;