mirror of
https://github.com/samba-team/samba.git
synced 2025-08-09 17:49:29 +03:00
r2575: Return correct error codes on old SEARCH call (from Samba4 torture tester).
Jeremy.
(This used to be commit fc51c97ea8
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
729155a428
commit
8875124a61
@ -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 ! */
|
||||
|
Reference in New Issue
Block a user