summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-09-24 17:26:42 -0700
committerAndrew Tridgell <tridge@samba.org>2008-09-24 18:10:23 -0700
commitb1f17b23fe58acba924ce11bb8ec700cd2a1bd7e (patch)
treeab2c81ba64f358ca72de2d39ca55a8e6e678bc8b /source4
parent9cf3d82d6366e11d1ffee89d405083b7a577c6d6 (diff)
downloadsamba-b1f17b23fe58acba924ce11bb8ec700cd2a1bd7e.tar.gz
samba-b1f17b23fe58acba924ce11bb8ec700cd2a1bd7e.tar.bz2
samba-b1f17b23fe58acba924ce11bb8ec700cd2a1bd7e.zip
- use the current dialect first, for servers that only look at the
first dialect - allow override of SMB2 port in client code
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/smb2/connect.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c
index 43151943d3..e0b75a2542 100644
--- a/source4/libcli/smb2/connect.c
+++ b/source4/libcli/smb2/connect.c
@@ -27,6 +27,7 @@
#include "libcli/composite/composite.h"
#include "libcli/resolve/resolve.h"
#include "param/param.h"
+#include "lib/cmdline/popt_common.h"
struct smb2_connect_state {
struct cli_credentials *credentials;
@@ -184,8 +185,8 @@ static void continue_socket(struct composite_context *creq)
}
state->negprot.in.capabilities = 0;
unix_to_nt_time(&state->negprot.in.start_time, time(NULL));
- dialects[0] = 0;
- dialects[1] = SMB2_DIALECT_REVISION;
+ dialects[0] = SMB2_DIALECT_REVISION;
+ dialects[1] = 0;
state->negprot.in.dialects = dialects;
req = smb2_negprot_send(transport, &state->negprot);
@@ -206,7 +207,13 @@ static void continue_resolve(struct composite_context *creq)
struct smb2_connect_state *state = talloc_get_type(c->private_data,
struct smb2_connect_state);
const char *addr;
- const char *ports[2] = { "445", NULL };
+ const char **ports;
+ const char *default_ports[] = { "445", NULL };
+
+ ports = lp_parm_string_list(state, cmdline_lp_ctx, NULL, "smb2", "ports", NULL);
+ if (ports == NULL) {
+ ports = default_ports;
+ }
c->status = resolve_name_recv(creq, state, &addr);
if (!composite_is_ok(c)) return;