static void cli_rename_done1(struct tevent_req *subreq);
static void cli_rename_done_cifs(struct tevent_req *subreq);
+static void cli_rename_done2(struct tevent_req *subreq);
struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
return NULL;
}
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
+ subreq = cli_smb2_rename_send(
+ state, ev, cli, fname_src, fname_dst, replace);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, cli_rename_done2, req);
+ return req;
+ }
+
if (replace && smbXcli_conn_support_passthrough(cli->conn)) {
subreq = cli_smb1_rename_send(
state, ev, cli, fname_src, fname_dst, replace);
tevent_req_simple_finish_ntstatus(subreq, status);
}
+static void cli_rename_done2(struct tevent_req *subreq)
+{
+ NTSTATUS status = cli_smb2_rename_recv(subreq);
+ tevent_req_simple_finish_ntstatus(subreq, status);
+}
+
NTSTATUS cli_rename_recv(struct tevent_req *req)
{
return tevent_req_simple_recv_ntstatus(req);
struct tevent_req *req;
NTSTATUS status = NT_STATUS_OK;
- if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
- return cli_smb2_rename(cli, fname_src, fname_dst, replace);
- }
-
frame = talloc_stackframe();
if (smbXcli_conn_has_async_calls(cli->conn)) {