{
struct tevent_req *req = NULL;
struct cli_list_state *state;
+ enum protocol_types proto = smbXcli_conn_protocol(cli->conn);
req = tevent_req_create(mem_ctx, &state, struct cli_list_state);
if (req == NULL) {
}
state->ev = ev;
- if (smbXcli_conn_protocol(cli->conn) <= PROTOCOL_LANMAN1) {
- state->subreq = cli_list_old_send(
- state, ev, cli, mask, attribute);
- state->recv_fn = cli_list_old_recv;
- } else {
+ if (proto >= PROTOCOL_SMB2_02) {
+ state->subreq = cli_smb2_list_send(state, ev, cli, mask);
+ state->recv_fn = cli_smb2_list_recv;
+ } else if (proto >= PROTOCOL_LANMAN2) {
state->subreq = cli_list_trans_send(
state, ev, cli, mask, attribute, info_level);
state->recv_fn = cli_list_trans_recv;
+ } else {
+ state->subreq = cli_list_old_send(
+ state, ev, cli, mask, attribute);
+ state->recv_fn = cli_list_old_recv;
}
if (tevent_req_nomem(state->subreq, req)) {
return tevent_req_post(req, ev);
NTSTATUS status = NT_STATUS_NO_MEMORY;
uint16_t info_level;
- if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
- return cli_smb2_list(cli, mask, attribute, fn, private_data);
- }
-
frame = talloc_stackframe();
if (smbXcli_conn_has_async_calls(cli->conn)) {