9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] cifs buglet
@ 2019-02-05 11:56 Steve Simon
  0 siblings, 0 replies; only message in thread
From: Steve Simon @ 2019-02-05 11:56 UTC (permalink / raw)
  To: 9fans

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-05 11:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 11:56 [9fans] cifs buglet Steve Simon

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).