diff options
-rw-r--r-- | source3/libsmb/cliconnect.c | 15 | ||||
-rw-r--r-- | source3/libsmb/proto.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 39710525dd..58fb2e8e03 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -2520,6 +2520,21 @@ NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share, return status; } +NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share, + const char *dev, const char *pass, int passlen) +{ + cli->share = talloc_strdup(cli, share); + if (!cli->share) { + return NT_STATUS_NO_MEMORY; + } + + if (cli_state_protocol(cli) >= PROTOCOL_SMB2_02) { + return smb2cli_tcon(cli, share); + } + + return cli_tcon_andx(cli, share, dev, pass, passlen); +} + /**************************************************************************** Send a tree disconnect. ****************************************************************************/ diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index 991deadfa5..e03d721ef2 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -64,6 +64,8 @@ struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx, NTSTATUS cli_tcon_andx_recv(struct tevent_req *req); NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share, const char *dev, const char *pass, int passlen); +NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share, + const char *dev, const char *pass, int passlen); struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli); |