From: "Steve Simon" <steve@quintile.net>
To: 9fans@9fans.net
Subject: [9fans] cifs buglet
Date: Tue, 5 Feb 2019 11:56:33 +0000 [thread overview]
Message-ID: <54919b958ba942aad353838906904f44@quintile.net> (raw)
Hi all (who remain true to the cause :-),
I cam across a bug in cifs.
An empty directory under windows 7 pro contains a single entry "." but it doesn't appear to contain "..".
As a result "." is not removed on dirscan and plan9 gets when trying to traverse the hierarchy.
diff /n/dump/2019/0205/sys/src/cmd/cifs/main.c /sys/src/cmd/cifs/main.c
261,265c261,263
< if(got >= 2 && strcmp(fi[0].name, ".") == 0 &&
< strcmp(fi[1].name, "..") == 0){
< a->end = (got - 2) * sizeof(FInfo);
< memmove(a->cache, a->cache + sizeof(FInfo)*2,
< a->end - a->off);
---
> while(strcmp(fi[0].name, ".") == 0 || strcmp(fi[0].name, "..") == 0){
> a->end = (got -1) * sizeof(FInfo);
> memmove(a->cache, a->cache + sizeof(FInfo), a->end - a->off);
-Steve
reply other threads:[~2019-02-05 11:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54919b958ba942aad353838906904f44@quintile.net \
--to=steve@quintile.net \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).