case 1: /* OS/2 understands this */
/* these dates are converted to GMT by
make_unix_date */
- finfo->ctime = make_unix_date2(p+4);
- finfo->atime = make_unix_date2(p+8);
- finfo->mtime = make_unix_date2(p+12);
+ finfo->ctime = cli_make_unix_date2(cli, p+4);
+ finfo->atime = cli_make_unix_date2(cli, p+8);
+ finfo->mtime = cli_make_unix_date2(cli, p+12);
finfo->size = IVAL(p,16);
finfo->mode = CVAL(p,24);
len = CVAL(p, 26);
case 2: /* this is what OS/2 uses mostly */
/* these dates are converted to GMT by
make_unix_date */
- finfo->ctime = make_unix_date2(p+4);
- finfo->atime = make_unix_date2(p+8);
- finfo->mtime = make_unix_date2(p+12);
+ finfo->ctime = cli_make_unix_date2(cli, p+4);
+ finfo->atime = cli_make_unix_date2(cli, p+8);
+ finfo->mtime = cli_make_unix_date2(cli, p+12);
finfo->size = IVAL(p,16);
finfo->mode = CVAL(p,24);
len = CVAL(p, 30);
int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
void (*fn)(const char *, file_info *, const char *, void *), void *state)
{
-#if 1
- int max_matches = 1366; /* Match W2k - was 512. */
-#else
- int max_matches = 512;
-#endif
+ int max_matches = 1366;
int info_level;
char *p, *p2;
pstring mask;
it gives ERRSRV/ERRerror temprarily */
uint8 eclass;
uint32 ecode;
+
+ SAFE_FREE(rdata);
+ SAFE_FREE(rparam);
+
cli_dos_error(cli, &eclass, &ecode);
if (eclass != ERRSRV || ecode != ERRerror)
break;
continue;
}
- if (cli_is_error(cli) || !rdata || !rparam)
+ if (cli_is_error(cli) || !rdata || !rparam) {
+ SAFE_FREE(rdata);
+ SAFE_FREE(rparam);
break;
+ }
if (total_received == -1)
total_received = 0;
ff_lastname = SVAL(p,6);
}
- if (ff_searchcount == 0)
+ if (ff_searchcount == 0) {
+ SAFE_FREE(rdata);
+ SAFE_FREE(rparam);
break;
+ }
/* point to the data bytes */
p = rdata;
if (!tdl) {
DEBUG(0,("cli_list_new: Failed to expand dirlist\n"));
+ SAFE_FREE(rdata);
+ SAFE_FREE(rparam);
break;
} else {
dirlist = tdl;
finfo->mode = CVAL(p,21);
/* this date is converted to GMT by make_unix_date */
- finfo->ctime = make_unix_date(p+22);
+ finfo->ctime = cli_make_unix_date(cli, p+22);
finfo->mtime = finfo->atime = finfo->ctime;
finfo->size = IVAL(p,26);
clistr_pull(cli, finfo->name, p+30, sizeof(finfo->name), 12, STR_ASCII);