mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
smbd: call tevent_req_nterror() for directories when cleaning up pending aio
smbd_smb2_query_directory_recv() calls tevent_req_is_nterror() which requires a NTSTATUS error code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14301 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
acb0b01761
commit
f94cd10a21
@ -31,6 +31,7 @@
|
||||
#include "auth.h"
|
||||
#include "messages.h"
|
||||
#include "../librpc/gen_ndr/open_files.h"
|
||||
#include "lib/util/tevent_ntstatus.h"
|
||||
|
||||
/****************************************************************************
|
||||
Run a file if it is a magic script.
|
||||
@ -678,7 +679,7 @@ static void close_free_pending_aio(struct files_struct *fsp,
|
||||
* directly) and also leaves the SMB2 request
|
||||
* outstanding on the processing queue.
|
||||
*
|
||||
* Using tevent_req_error() instead
|
||||
* Using tevent_req_[nt]error() instead
|
||||
* causes the outstanding SMB1/2/3 request to
|
||||
* return with NT_STATUS_INVALID_HANDLE
|
||||
* and removes it from the processing queue.
|
||||
@ -687,7 +688,12 @@ static void close_free_pending_aio(struct files_struct *fsp,
|
||||
* calls talloc_free(req). The destructor will remove
|
||||
* itself from the fsp and the aio_requests array.
|
||||
*/
|
||||
tevent_req_error(fsp->aio_requests[0], EBADF);
|
||||
if (fsp->is_directory) {
|
||||
tevent_req_nterror(fsp->aio_requests[0],
|
||||
NT_STATUS_INVALID_HANDLE);
|
||||
} else {
|
||||
tevent_req_error(fsp->aio_requests[0], EBADF);
|
||||
}
|
||||
|
||||
/* Paranoia to ensure we don't spin. */
|
||||
num_requests--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user