summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-08-19 01:02:41 +0000
committerJeremy Allison <jra@samba.org>2003-08-19 01:02:41 +0000
commite83a8a40c89491764d0658122800e05f3f75a7cd (patch)
treef6a2c009ea533c37db1308f32d4569364f3837c0 /source3
parentc236ac83c8ba6fc8d57542bad5bb4685838948e8 (diff)
downloadsamba-e83a8a40c89491764d0658122800e05f3f75a7cd.tar.gz
samba-e83a8a40c89491764d0658122800e05f3f75a7cd.tar.bz2
samba-e83a8a40c89491764d0658122800e05f3f75a7cd.zip
Don't return DOS error on SMBsearch return if using NT error codes (NT1
protocol level). Fix for Samba4 tester. Jeremy. (This used to be commit 74486ab9efbb555f830b0e5d1c88f7bf065ae039)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/reply.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 34200b0cab..32b9c39aed 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -768,21 +768,23 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
SearchEmpty:
- if (numentries == 0 || !ok) {
- SCVAL(outbuf,smb_rcls,ERRDOS);
- SSVAL(outbuf,smb_err,ERRnofiles);
- dptr_close(&dptr_num);
- }
-
/* If we were called as SMBffirst with smb_search_id == NULL
and no entries were found then return error and close dirptr
(X/Open spec) */
if(ok && expect_close && numentries == 0 && status_len == 0) {
- SCVAL(outbuf,smb_rcls,ERRDOS);
- SSVAL(outbuf,smb_err,ERRnofiles);
+ if (Protocol < PROTOCOL_NT1) {
+ SCVAL(outbuf,smb_rcls,ERRDOS);
+ SSVAL(outbuf,smb_err,ERRnofiles);
+ }
/* Also close the dptr - we know it's gone */
dptr_close(&dptr_num);
+ } else if (numentries == 0 || !ok) {
+ if (Protocol < PROTOCOL_NT1) {
+ SCVAL(outbuf,smb_rcls,ERRDOS);
+ SSVAL(outbuf,smb_err,ERRnofiles);
+ }
+ dptr_close(&dptr_num);
}
/* If we were called as SMBfunique, then we can close the dirptr now ! */