svn commit: samba r5070 - in trunk/source/smbd: .
jra at samba.org
jra at samba.org
Fri Jan 28 23:17:18 GMT 2005
Author: jra
Date: 2005-01-28 23:17:18 +0000 (Fri, 28 Jan 2005)
New Revision: 5070
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5070
Log:
Ensure we return the correct errors for old-style search requests.
Jeremy.
Modified:
trunk/source/smbd/reply.c
Changeset:
Modified: trunk/source/smbd/reply.c
===================================================================
--- trunk/source/smbd/reply.c 2005-01-28 23:17:12 UTC (rev 5069)
+++ trunk/source/smbd/reply.c 2005-01-28 23:17:18 UTC (rev 5070)
@@ -947,19 +947,22 @@
and no entries were found then return error and close dirptr
(X/Open spec) */
- if(ok && expect_close && numentries == 0 && status_len == 0) {
+ if (numentries == 0 || !ok) {
+ dptr_close(&dptr_num);
+ } else if(ok && expect_close && status_len == 0) {
/* Close the dptr - we know it's gone */
dptr_close(&dptr_num);
- return ERROR_BOTH(STATUS_NO_MORE_FILES,ERRDOS,ERRnofiles);
- } else if (numentries == 0 || !ok) {
- dptr_close(&dptr_num);
- return ERROR_BOTH(STATUS_NO_MORE_FILES,ERRDOS,ERRnofiles);
}
/* If we were called as SMBfunique, then we can close the dirptr now ! */
- if(dptr_num >= 0 && CVAL(inbuf,smb_com) == SMBfunique)
+ if(dptr_num >= 0 && CVAL(inbuf,smb_com) == SMBfunique) {
dptr_close(&dptr_num);
+ }
+ if ((numentries == 0) && !ms_has_wild(mask)) {
+ return ERROR_BOTH(STATUS_NO_MORE_FILES,ERRDOS,ERRnofiles);
+ }
+
SSVAL(outbuf,smb_vwv0,numentries);
SSVAL(outbuf,smb_vwv1,3 + numentries * DIR_STRUCT_SIZE);
SCVAL(smb_buf(outbuf),0,5);
More information about the samba-cvs
mailing list