diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-12 02:15:29 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:49:42 +0100 |
commit | 4b0199a5493ea2b88558cc40871e63c1dc8dbb56 (patch) | |
tree | 684450d46a7787e2f3a2a1b20ac0488c1ca8e94f /source4/client | |
parent | 33582dffcc2d348dc042edfdcccee7500b21d928 (diff) | |
download | samba-4b0199a5493ea2b88558cc40871e63c1dc8dbb56.tar.gz samba-4b0199a5493ea2b88558cc40871e63c1dc8dbb56.tar.bz2 samba-4b0199a5493ea2b88558cc40871e63c1dc8dbb56.zip |
r26409: Pass smb ports along.
(This used to be commit 2833f320de1f1fd39c710ad0a61c3fa1bb1df31f)
Diffstat (limited to 'source4/client')
-rw-r--r-- | source4/client/cifsdd.c | 10 | ||||
-rw-r--r-- | source4/client/cifsdd.h | 1 | ||||
-rw-r--r-- | source4/client/cifsddio.c | 11 | ||||
-rw-r--r-- | source4/client/client.c | 12 | ||||
-rw-r--r-- | source4/client/smbspool.c | 7 |
5 files changed, 23 insertions, 18 deletions
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c index 2ce01a2227..08c152c3a5 100644 --- a/source4/client/cifsdd.c +++ b/source4/client/cifsdd.c @@ -351,7 +351,7 @@ static void print_transfer_stats(void) } } -static struct dd_iohandle * open_file(const char * which) +static struct dd_iohandle * open_file(const char * which, const char **ports) { int options = 0; const char * path = NULL; @@ -371,12 +371,12 @@ static struct dd_iohandle * open_file(const char * which) if (strcmp(which, "if") == 0) { path = check_arg_pathname("if"); - handle = dd_open_path(path, check_arg_numeric("ibs"), + handle = dd_open_path(path, ports, check_arg_numeric("ibs"), options); } else if (strcmp(which, "of") == 0) { options |= DD_WRITE; path = check_arg_pathname("of"); - handle = dd_open_path(path, check_arg_numeric("obs"), + handle = dd_open_path(path, ports, check_arg_numeric("obs"), options); } else { SMB_ASSERT(0); @@ -431,11 +431,11 @@ static int copy_files(struct loadparm_context *lp_ctx) DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n", (unsigned long long)iomax, lp_max_xmit(lp_ctx))); - if (!(ifile = open_file("if"))) { + if (!(ifile = open_file("if", lp_smb_ports(lp_ctx)))) { return(FILESYS_EXIT_CODE); } - if (!(ofile = open_file("of"))) { + if (!(ofile = open_file("of", lp_smb_ports(lp_ctx)))) { return(FILESYS_EXIT_CODE); } diff --git a/source4/client/cifsdd.h b/source4/client/cifsdd.h index 2fe8de6ea3..994c209103 100644 --- a/source4/client/cifsdd.h +++ b/source4/client/cifsdd.h @@ -89,6 +89,7 @@ struct dd_iohandle #define DD_OPLOCK 0x00000008 struct dd_iohandle * dd_open_path(const char * path, + const char **ports, uint64_t io_size, int options); bool dd_fill_block(struct dd_iohandle * h, uint8_t * buf, uint64_t * buf_size, uint64_t need_size, uint64_t block_size); diff --git a/source4/client/cifsddio.c b/source4/client/cifsddio.c index 5cea8cf305..c30bf53196 100644 --- a/source4/client/cifsddio.c +++ b/source4/client/cifsddio.c @@ -221,7 +221,8 @@ static bool smb_write_func(void * handle, uint8_t * buf, uint64_t wanted, } static struct smbcli_state * init_smb_session(const char * host, - const char * share) + const char **ports, + const char * share) { NTSTATUS ret; struct smbcli_state * cli = NULL; @@ -229,7 +230,7 @@ static struct smbcli_state * init_smb_session(const char * host, /* When we support SMB URLs, we can get different user credentials for * each connection, but for now, we just use the same one for both. */ - ret = smbcli_full_connection(NULL, &cli, host, share, + ret = smbcli_full_connection(NULL, &cli, host, ports, share, NULL /* devtype */, cmdline_credentials, NULL /* events */); if (!NT_STATUS_IS_OK(ret)) { @@ -289,6 +290,7 @@ static int open_smb_file(struct smbcli_state * cli, } static struct dd_iohandle * open_cifs_handle(const char * host, + const char **ports, const char * share, const char * path, uint64_t io_size, @@ -312,7 +314,7 @@ static struct dd_iohandle * open_cifs_handle(const char * host, smbh->h.io_write = smb_write_func; smbh->h.io_seek = smb_seek_func; - if ((smbh->cli = init_smb_session(host, share)) == NULL) { + if ((smbh->cli = init_smb_session(host, ports, share)) == NULL) { return(NULL); } @@ -328,6 +330,7 @@ static struct dd_iohandle * open_cifs_handle(const char * host, /* ------------------------------------------------------------------------- */ struct dd_iohandle * dd_open_path(const char * path, + const char **ports, uint64_t io_size, int options) { @@ -344,7 +347,7 @@ struct dd_iohandle * dd_open_path(const char * path, /* Skip over leading directory separators. */ while (*remain == '/' || *remain == '\\') { remain++; } - return(open_cifs_handle(host, share, remain, + return(open_cifs_handle(host, ports, share, remain, io_size, options)); } diff --git a/source4/client/client.c b/source4/client/client.c index 98b13aba4c..748ee2d7cb 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -3017,7 +3017,7 @@ static int process_stdin(struct smbclient_context *ctx) return a connection to a server *******************************************************/ static bool do_connect(struct smbclient_context *ctx, - const char *specified_server, const char *specified_share, struct cli_credentials *cred) + const char *specified_server, const char **ports, const char *specified_share, struct cli_credentials *cred) { NTSTATUS status; char *server, *share; @@ -3034,7 +3034,7 @@ static bool do_connect(struct smbclient_context *ctx, ctx->remote_cur_dir = talloc_strdup(ctx, "\\"); - status = smbcli_full_connection(ctx, &ctx->cli, server, + status = smbcli_full_connection(ctx, &ctx->cli, server, ports, share, NULL, cred, cli_credentials_get_event_context(cred)); if (!NT_STATUS_IS_OK(status)) { @@ -3061,7 +3061,7 @@ static int do_host_query(struct loadparm_context *lp_ctx, const char *query_host /**************************************************************************** handle a message operation ****************************************************************************/ -static int do_message_op(const char *netbios_name, const char *desthost, const char *destip, int name_type, struct resolve_context *resolve_ctx, int max_xmit, int max_mux) +static int do_message_op(const char *netbios_name, const char *desthost, const char **destports, const char *destip, int name_type, struct resolve_context *resolve_ctx, int max_xmit, int max_mux) { struct nbt_name called, calling; const char *server_name; @@ -3073,7 +3073,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c server_name = destip ? destip : desthost; - if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, resolve_ctx, max_xmit, max_mux)) { + if (!(cli=smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, destports, resolve_ctx, max_xmit, max_mux)) { d_printf("Connection to %s failed\n", server_name); return 1; } @@ -3221,10 +3221,10 @@ static int do_message_op(const char *netbios_name, const char *desthost, const c } if (message) { - return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, dest_ip, name_type, lp_resolve_context(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx)); + return do_message_op(lp_netbios_name(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), dest_ip, name_type, lp_resolve_context(cmdline_lp_ctx), lp_max_xmit(cmdline_lp_ctx), lp_maxmux(cmdline_lp_ctx)); } - if (!do_connect(ctx, desthost, service, cmdline_credentials)) + if (!do_connect(ctx, desthost, lp_smb_ports(cmdline_lp_ctx), service, cmdline_credentials)) return 1; if (base_directory) diff --git a/source4/client/smbspool.c b/source4/client/smbspool.c index 57050acab8..614e50bb0b 100644 --- a/source4/client/smbspool.c +++ b/source4/client/smbspool.c @@ -26,7 +26,7 @@ */ static void list_devices(void); -static struct smbcli_state *smb_connect(const char *, const char *, const char *, const char *, const char *); +static struct smbcli_state *smb_connect(const char *, const char *, const char **, const char *, const char *, const char *); static int smb_print(struct smbcli_state *, char *, FILE *); @@ -189,7 +189,7 @@ static int smb_print(struct smbcli_state *, char *, FILE *); do { - if ((cli = smb_connect(workgroup, server, printer, username, password)) == NULL) + if ((cli = smb_connect(workgroup, server, lp_smb_ports(lp_ctx), printer, username, password)) == NULL) { if (getenv("CLASS") == NULL) { @@ -255,6 +255,7 @@ list_devices(void) static struct smbcli_state * /* O - SMB connection */ smb_connect(const char *workgroup, /* I - Workgroup */ const char *server, /* I - Server */ + const char **ports, /* I - Ports */ const char *share, /* I - Printer */ const char *username, /* I - Username */ const char *password) /* I - Password */ @@ -269,7 +270,7 @@ smb_connect(const char *workgroup, /* I - Workgroup */ myname = get_myname(); - nt_status = smbcli_full_connection(NULL, &c, myname, server, 0, share, NULL, + nt_status = smbcli_full_connection(NULL, &c, myname, server, ports, share, NULL, username, workgroup, password, NULL); free(myname); |