summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-09-24 00:55:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:47 -0500
commit8875124a61c63d2def8ec193a98732f6fcfaa6a1 (patch)
tree39d4f185b7f50274855acec1bfac6d3652efb61b /source3/smbd
parent729155a42826660dcc0bfa31b03ebd13f2506470 (diff)
downloadsamba-8875124a61c63d2def8ec193a98732f6fcfaa6a1.tar.gz
samba-8875124a61c63d2def8ec193a98732f6fcfaa6a1.tar.bz2
samba-8875124a61c63d2def8ec193a98732f6fcfaa6a1.zip
r2575: Return correct error codes on old SEARCH call (from Samba4 torture tester).
Jeremy. (This used to be commit fc51c97ea86bd1a86830d4ab2c6c7c4ec9fccc88)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 565046061c..cdf607e273 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -934,8 +934,8 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
make_dir_struct(p,mask,fname,size,mode,date,conn->case_sensitive);
dptr_fill(p+12,dptr_num);
numentries++;
+ p += DIR_STRUCT_SIZE;
}
- p += DIR_STRUCT_SIZE;
}
}
} /* if (ok ) */
@@ -949,18 +949,12 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
(X/Open spec) */
if(ok && expect_close && numentries == 0 && status_len == 0) {
- if (Protocol < PROTOCOL_NT1) {
- SCVAL(outbuf,smb_rcls,ERRDOS);
- SSVAL(outbuf,smb_err,ERRnofiles);
- }
- /* Also close the dptr - we know it's gone */
+ /* 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) {
- if (Protocol < PROTOCOL_NT1) {
- SCVAL(outbuf,smb_rcls,ERRDOS);
- SSVAL(outbuf,smb_err,ERRnofiles);
- }
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 ! */