mirror of
https://github.com/samba-team/samba.git
synced 2025-08-26 01:49:31 +03:00
libsmb: Fix directory listing against old servers
cli_list_trans_recv() can be called multiple times. When it's done, it return NT_STATUS_OK and set *finfo to NULL. cli_list_old_recv() did not do the NULL part, so smbclient would endlessly loop. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15382 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jun 1 21:54:42 UTC 2023 on atb-devel-224
This commit is contained in:
committed by
Jeremy Allison
parent
e86234f3d6
commit
f30f5793ad
@ -1 +0,0 @@
|
||||
^samba3.blackbox.smbclient_old_dir.*
|
@ -544,6 +544,11 @@ static NTSTATUS cli_list_old_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
|
||||
return status;
|
||||
}
|
||||
|
||||
if (state->dirlist == NULL) {
|
||||
*pfinfo = NULL;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
num_received = talloc_array_length(state->dirlist) / DIR_STRUCT_SIZE;
|
||||
|
||||
finfo = talloc_array(mem_ctx, struct file_info, num_received);
|
||||
@ -570,6 +575,7 @@ static NTSTATUS cli_list_old_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
|
||||
return status;
|
||||
}
|
||||
}
|
||||
TALLOC_FREE(state->dirlist);
|
||||
*pfinfo = finfo;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user