summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-05-30 10:07:21 +0200
committerStefan Metzmacher <metze@samba.org>2012-05-30 10:24:57 +0200
commitbce43d75da8e73a00a6aeca7c4064f17e4f2804e (patch)
treeb74a374cdaee29cd4f1b09c41d9addab59f36ee3 /source3
parent27fb14bfbe9d49bacd80fc033132c254267aeb34 (diff)
downloadsamba-bce43d75da8e73a00a6aeca7c4064f17e4f2804e.tar.gz
samba-bce43d75da8e73a00a6aeca7c4064f17e4f2804e.tar.bz2
samba-bce43d75da8e73a00a6aeca7c4064f17e4f2804e.zip
s3:libsmb: fallback to SMBtcon for old servers
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/cliconnect.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index fe8c3a1631..e45bf25702 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2514,6 +2514,10 @@ NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share,
NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share,
const char *dev, const char *pass, int passlen)
{
+ NTSTATUS status;
+ uint16_t max_xmit = 0;
+ uint16_t tid = 0;
+
cli->share = talloc_strdup(cli, share);
if (!cli->share) {
return NT_STATUS_NO_MEMORY;
@@ -2523,7 +2527,17 @@ NTSTATUS cli_tree_connect(struct cli_state *cli, const char *share,
return smb2cli_tcon(cli, share);
}
- return cli_tcon_andx(cli, share, dev, pass, passlen);
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_LANMAN1) {
+ return cli_tcon_andx(cli, share, dev, pass, passlen);
+ }
+
+ status = cli_raw_tcon(cli, share, pass, dev, &max_xmit, &tid);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ cli->smb1.tid = tid;
+
+ return NT_STATUS_OK;
}
/****************************************************************************