[SCM] Samba Shared Repository - branch v3-0-test updated -
release-3-0-28-138-gb605b16
Jeremy Allison
jra at samba.org
Thu Feb 28 10:26:29 GMT 2008
The branch, v3-0-test has been updated
via b605b169e659ee0c84f7d807e8dfb25e9723a2bf (commit)
from 555c9c0702666e56f0cda61441f786d41c2ab6b4 (commit)
http://gitweb.samba.org/?samba.git;a=shortlog;h=v3-0-test
- Log -----------------------------------------------------------------
commit b605b169e659ee0c84f7d807e8dfb25e9723a2bf
Author: Jeremy Allison <jra at samba.org>
Date: Thu Feb 28 02:26:16 2008 -0800
Fix from Guenter Kukkukk <linux at kukkukk.com> to fix listing against
OS/2 servers. OS/2 returns eclass == ERRDOS && ecode == ERRnofiles
for a zero entry directory listing.
Jeremy.
-----------------------------------------------------------------------
Summary of changes:
source/libsmb/clierror.c | 12 ++++++++++++
source/libsmb/clilist.c | 16 +++++++++++++++-
2 files changed, 27 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/libsmb/clierror.c b/source/libsmb/clierror.c
index ff6fbf5..cacfe82 100644
--- a/source/libsmb/clierror.c
+++ b/source/libsmb/clierror.c
@@ -469,3 +469,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);
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);
+ }
+}
diff --git a/source/libsmb/clilist.c b/source/libsmb/clilist.c
index 3e76cd4..98c0436 100644
--- a/source/libsmb/clilist.c
+++ b/source/libsmb/clilist.c
@@ -247,7 +247,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
&rparam, ¶m_len,
&rdata, &data_len) &&
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 */
uint8 eclass;
uint32 ecode;
@@ -256,6 +256,20 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
SAFE_FREE(rparam);
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 at kukkukk.com>
+ */
+
+ if (eclass == ERRDOS && ecode == ERRnofiles) {
+ ff_searchcount = 0;
+ cli_reset_error(cli);
+ break;
+ }
+
if (eclass != ERRSRV || ecode != ERRerror)
break;
smb_msleep(100);
--
Samba Shared Repository
More information about the samba-cvs
mailing list