diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-20 06:57:37 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-11-24 19:02:32 +0100 |
commit | 665593d6acd8bc9b0c78515050cb7dd107c3867d (patch) | |
tree | a36db07caa8530d6b7fad2a94480a75fbaebd4b8 /source3/libsmb | |
parent | 8428db0a17c2a70eab52a73a6c883cf1d708b564 (diff) | |
download | samba-665593d6acd8bc9b0c78515050cb7dd107c3867d.tar.gz samba-665593d6acd8bc9b0c78515050cb7dd107c3867d.tar.bz2 samba-665593d6acd8bc9b0c78515050cb7dd107c3867d.zip |
s3:libsmb: add cli_tree_connect() for a generic tree connect
metze
Diffstat (limited to 'source3/libsmb')
-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); |