diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-10-24 13:13:27 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-24 13:13:27 +0200 |
commit | 8b06312f7eeff5ea8625677478792888774bd2be (patch) | |
tree | cd1d662f3e7e43a0c5ed667d396592f6aa6c941a /source4/client | |
parent | 5d146d0178d7da8d8f14f340dacb5b01fd03fab8 (diff) | |
download | samba-8b06312f7eeff5ea8625677478792888774bd2be.tar.gz samba-8b06312f7eeff5ea8625677478792888774bd2be.tar.bz2 samba-8b06312f7eeff5ea8625677478792888774bd2be.zip |
Eliminate another instance of global_loadparm.
Diffstat (limited to 'source4/client')
-rw-r--r-- | source4/client/cifsdd.c | 14 | ||||
-rw-r--r-- | source4/client/cifsdd.h | 3 | ||||
-rw-r--r-- | source4/client/cifsddio.c | 18 | ||||
-rw-r--r-- | source4/client/client.c | 17 |
4 files changed, 34 insertions, 18 deletions
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c index 5f07826d06..6d35dc6b82 100644 --- a/source4/client/cifsdd.c +++ b/source4/client/cifsdd.c @@ -358,7 +358,8 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx, struct event_context *ev, const char * which, const char **ports, struct smbcli_options *smb_options, - struct smbcli_session_options *smb_session_options) + struct smbcli_session_options *smb_session_options, + struct smb_iconv_convenience *iconv_convenience) { int options = 0; const char * path = NULL; @@ -380,13 +381,15 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx, path = check_arg_pathname("if"); handle = dd_open_path(resolve_ctx, ev, path, ports, check_arg_numeric("ibs"), options, - smb_options, smb_session_options); + smb_options, smb_session_options, + iconv_convenience); } else if (strcmp(which, "of") == 0) { options |= DD_WRITE; path = check_arg_pathname("of"); handle = dd_open_path(resolve_ctx, ev, path, ports, check_arg_numeric("obs"), options, - smb_options, smb_session_options); + smb_options, smb_session_options, + iconv_convenience); } else { SMB_ASSERT(0); return(NULL); @@ -440,13 +443,14 @@ static int copy_files(struct event_context *ev, struct loadparm_context *lp_ctx) if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if", lp_smb_ports(lp_ctx), &options, - &session_options))) { + &session_options, lp_iconv_convenience(lp_ctx)))) { return(FILESYS_EXIT_CODE); } if (!(ofile = open_file(lp_resolve_context(lp_ctx), ev, "of", lp_smb_ports(lp_ctx), &options, - &session_options))) { + &session_options, + lp_iconv_convenience(lp_ctx)))) { return(FILESYS_EXIT_CODE); } diff --git a/source4/client/cifsdd.h b/source4/client/cifsdd.h index 3195e4334f..bb851fa248 100644 --- a/source4/client/cifsdd.h +++ b/source4/client/cifsdd.h @@ -98,7 +98,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx, const char **ports, uint64_t io_size, int options, struct smbcli_options *smb_options, - struct smbcli_session_options *smb_session_options); + struct smbcli_session_options *smb_session_options, + struct smb_iconv_convenience *iconv_convenience); bool dd_fill_block(struct dd_iohandle * h, uint8_t * buf, uint64_t * buf_size, uint64_t need_size, uint64_t block_size); bool dd_flush_block(struct dd_iohandle * h, uint8_t * buf, diff --git a/source4/client/cifsddio.c b/source4/client/cifsddio.c index 25194a621a..3c9e0c2202 100644 --- a/source4/client/cifsddio.c +++ b/source4/client/cifsddio.c @@ -226,7 +226,8 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct const char **ports, const char * share, struct smbcli_options *options, - struct smbcli_session_options *session_options) + struct smbcli_session_options *session_options, + struct smb_iconv_convenience *iconv_convenience) { NTSTATUS ret; struct smbcli_state * cli = NULL; @@ -238,7 +239,8 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct NULL /* devtype */, cmdline_credentials, resolve_ctx, ev, options, - session_options); + session_options, + iconv_convenience); if (!NT_STATUS_IS_OK(ret)) { fprintf(stderr, "%s: connecting to //%s/%s: %s\n", @@ -305,7 +307,8 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx uint64_t io_size, int options, struct smbcli_options *smb_options, - struct smbcli_session_options *smb_session_options) + struct smbcli_session_options *smb_session_options, + struct smb_iconv_convenience *iconv_convenience) { struct cifs_handle * smbh; @@ -326,7 +329,8 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx smbh->h.io_seek = smb_seek_func; if ((smbh->cli = init_smb_session(resolve_ctx, ev, host, ports, share, - smb_options, smb_session_options)) == NULL) { + smb_options, smb_session_options, + iconv_convenience)) == NULL) { return(NULL); } @@ -348,7 +352,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx, uint64_t io_size, int options, struct smbcli_options *smb_options, - struct smbcli_session_options *smb_session_options) + struct smbcli_session_options *smb_session_options, + struct smb_iconv_convenience *iconv_convenience) { if (file_exist(path)) { return(open_fd_handle(path, io_size, options)); @@ -366,7 +371,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx, return(open_cifs_handle(resolve_ctx, ev, host, ports, share, remain, io_size, options, smb_options, - smb_session_options)); + smb_session_options, + iconv_convenience)); } return(open_fd_handle(path, io_size, options)); diff --git a/source4/client/client.c b/source4/client/client.c index 1865d8db13..a61d1b4ca4 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -3033,7 +3033,8 @@ static bool do_connect(struct smbclient_context *ctx, const char *specified_share, struct cli_credentials *cred, struct smbcli_options *options, - struct smbcli_session_options *session_options) + struct smbcli_session_options *session_options, + struct smb_iconv_convenience *iconv_convenience) { NTSTATUS status; char *server, *share; @@ -3052,7 +3053,8 @@ static bool do_connect(struct smbclient_context *ctx, status = smbcli_full_connection(ctx, &ctx->cli, server, ports, share, NULL, cred, resolve_ctx, - ev_ctx, options, session_options); + ev_ctx, options, session_options, + iconv_convenience); if (!NT_STATUS_IS_OK(status)) { d_printf("Connection to \\\\%s\\%s failed - %s\n", server, share, nt_errstr(status)); @@ -3085,7 +3087,8 @@ static int do_message_op(const char *netbios_name, const char *desthost, int name_type, struct event_context *ev_ctx, struct resolve_context *resolve_ctx, - struct smbcli_options *options) + struct smbcli_options *options, + struct smb_iconv_convenience *iconv_convenience) { struct nbt_name called, calling; const char *server_name; @@ -3099,7 +3102,8 @@ static int do_message_op(const char *netbios_name, const char *desthost, if (!(cli = smbcli_state_init(NULL)) || !smbcli_socket_connect(cli, server_name, destports, - ev_ctx, resolve_ctx, options)) { + ev_ctx, resolve_ctx, options, + iconv_convenience)) { d_printf("Connection to %s failed\n", server_name); return 1; } @@ -3252,13 +3256,14 @@ static int do_message_op(const char *netbios_name, const char *desthost, lp_smb_ports(cmdline_lp_ctx), dest_ip, name_type, ev_ctx, lp_resolve_context(cmdline_lp_ctx), - &smb_options); + &smb_options, lp_iconv_convenience(cmdline_lp_ctx)); return rc; } if (!do_connect(ctx, ev_ctx, lp_resolve_context(cmdline_lp_ctx), desthost, lp_smb_ports(cmdline_lp_ctx), service, - cmdline_credentials, &smb_options, &smb_session_options)) + cmdline_credentials, &smb_options, &smb_session_options, + lp_iconv_convenience(cmdline_lp_ctx))) return 1; if (base_directory) |