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 via email to