commit 12bfa80e246ba9d8f580cd2d8fca7e6230a38e86 from: Omar Polo date: Wed Dec 21 09:11:03 2022 UTC kamiftp: don't walk dot Since d3e1ab0 kamiftp started to issue Twalks over ".". walk(9p) (from plan9ports) says that The name ``.'' (dot), meaning the current directory, is not used in the protocol. hinting that it shouldn't be used, and thus kamid rejects it. It's also redundant since it's always possible to do a walk to duplicate the directory fid instead of walkig "." which is what kamiftp now does. commit - 58b141cfaab7898107a6c4bc674ddfacf46ce267 commit + 12bfa80e246ba9d8f580cd2d8fca7e6230a38e86 blob - 4d41a34c5e4e357eb7c5d451e6f5d845656da0d8 blob + 0175181602059aa3e308ec118b937ad8928f75c0 --- kamiftp/ftp.c +++ kamiftp/ftp.c @@ -1021,17 +1021,20 @@ int dir_listing(const char *path, int (*fn)(const struct np_stat *), int printerr) { - struct qid qid; + struct qid qid = {0, 0, QTDIR}; struct np_stat st; uint64_t off = 0; uint32_t len; - int nfid, miss, r; + int nfid, r, miss = 0; char *errstr; now = time(NULL); nfid = nextfid(); - errstr = walk_path(pwdfid, nfid, path, &miss, &qid); + if (!strcmp(path, ".")) + errstr = dup_fid(pwdfid, nfid); + else + errstr = walk_path(pwdfid, nfid, path, &miss, &qid); if (errstr != NULL) { if (printerr) printf("%s: %s\n", path, errstr);