r7157: Ensure we abort a directory listing if we see the same
authorJeremy Allison <jra@samba.org>
Wed, 1 Jun 2005 00:00:07 +0000 (00:00 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:57:04 +0000 (10:57 -0500)
name twice between packets.
Jeremy.

source/libsmb/clilist.c

index a1434338c94d23ea072611d2a15618f25a465b10..d9a6f4709d55324699cc0565141d35841b5cb419 100644 (file)
@@ -313,6 +313,13 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
                        }
                        p2 += interpret_long_filename(cli,info_level,p2,&finfo,
                                                        &resume_key,&last_name_raw,&last_name_raw_len);
+
+                       if (!First && *mask && strcsequal(finfo.name, mask)) {
+                               DEBUG(0,("Error: Looping in FIND_NEXT as name %s has already been seen?\n",
+                                       finfo.name));
+                               ff_eos = 1;
+                               break;
+                       }
                }
 
                if (ff_lastname > 0) {