summaryrefslogtreecommitdiff
path: root/source3/libsmb/clilist.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-03-09 00:06:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:55 -0500
commit9d23e37a6f9887fed08ba495555d23fefab585ef (patch)
treec2435235933ca8a607771e47070a9d9eb7c455cd /source3/libsmb/clilist.c
parent6410e6519860641360ea6f75880d62a09a39c7c8 (diff)
downloadsamba-9d23e37a6f9887fed08ba495555d23fefab585ef.tar.gz
samba-9d23e37a6f9887fed08ba495555d23fefab585ef.tar.bz2
samba-9d23e37a6f9887fed08ba495555d23fefab585ef.zip
r5702: Fix bug #2271. Correctly pull out and use resume names in a
directory listing (we were incorrectly understanding what was returned in the "last name" entry). Jeremy. (This used to be commit 4f2da9ecf1e5cee4749839ea1b35a942d27de09e)
Diffstat (limited to 'source3/libsmb/clilist.c')
-rw-r--r--source3/libsmb/clilist.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 4e90a79719..d60739cf7c 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -268,24 +268,6 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
p = rdata;
/* we might need the lastname for continuations */
- if (ff_lastname > 0) {
- switch(info_level) {
- case 260:
- clistr_pull(cli, mask, p+ff_lastname,
- sizeof(mask),
- data_len-ff_lastname,
- STR_TERMINATE);
- break;
- case 1:
- clistr_pull(cli, mask, p+ff_lastname+1,
- sizeof(mask),
- -1,
- STR_TERMINATE);
- break;
- }
- } else {
- pstrcpy(mask,"");
- }
/* and add them to the dirlist pool */
tdl = SMB_REALLOC(dirlist,dirlist_len + data_len);
@@ -299,10 +281,18 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
/* put in a length for the last entry, to ensure we can chain entries
into the next packet */
- for (p2=p,i=0;i<(ff_searchcount-1);i++)
- p2 += interpret_long_filename(cli,info_level,p2,NULL);
+ for (p2=p,i=0;i<(ff_searchcount-1);i++) {
+ p2 += interpret_long_filename(cli,info_level,p2,&finfo);
+ }
SSVAL(p2,0,data_len - PTR_DIFF(p2,p));
+ /* we might need the lastname for continuations */
+ if (ff_lastname > 0) {
+ pstrcpy(mask, finfo.name);
+ } else {
+ pstrcpy(mask,"");
+ }
+
/* grab the data for later use */
memcpy(dirlist+dirlist_len,p,data_len);
dirlist_len += data_len;