1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

Fix from Guenter Kukkukk <linux@kukkukk.com> to fix listing against

OS/2 servers. OS/2 returns eclass == ERRDOS && ecode == ERRnofiles
for a zero entry directory listing.
Jeremy.
This commit is contained in:
Jeremy Allison 2008-02-28 02:22:13 -08:00
parent 1d9d39525a
commit b34da62705
2 changed files with 27 additions and 1 deletions

View File

@ -483,3 +483,15 @@ void cli_set_nt_error(struct cli_state *cli, NTSTATUS status)
SSVAL(cli->inbuf,smb_flg2, SVAL(cli->inbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES); SSVAL(cli->inbuf,smb_flg2, SVAL(cli->inbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES);
SIVAL(cli->inbuf, smb_rcls, NT_STATUS_V(status)); SIVAL(cli->inbuf, smb_rcls, NT_STATUS_V(status));
} }
/* Reset an error. */
void cli_reset_error(struct cli_state *cli)
{
if (SVAL(cli->inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES) {
SIVAL(cli->inbuf, smb_rcls, NT_STATUS_V(NT_STATUS_OK));
} else {
SCVAL(cli->inbuf,smb_rcls,0);
SSVAL(cli->inbuf,smb_err,0);
}
}

View File

@ -328,7 +328,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
&rparam, &param_len, &rparam, &param_len,
&rdata, &data_len) && &rdata, &data_len) &&
cli_is_dos_error(cli)) { cli_is_dos_error(cli)) {
/* we need to work around a Win95 bug - sometimes /* We need to work around a Win95 bug - sometimes
it gives ERRSRV/ERRerror temprarily */ it gives ERRSRV/ERRerror temprarily */
uint8 eclass; uint8 eclass;
uint32 ecode; uint32 ecode;
@ -337,6 +337,20 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
SAFE_FREE(rparam); SAFE_FREE(rparam);
cli_dos_error(cli, &eclass, &ecode); cli_dos_error(cli, &eclass, &ecode);
/*
* OS/2 might return "no more files",
* which just tells us, that searchcount is zero
* in this search.
* Guenter Kukkukk <linux@kukkukk.com>
*/
if (eclass == ERRDOS && ecode == ERRnofiles) {
ff_searchcount = 0;
cli_reset_error(cli);
break;
}
if (eclass != ERRSRV || ecode != ERRerror) if (eclass != ERRSRV || ecode != ERRerror)
break; break;
smb_msleep(100); smb_msleep(100);