mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
Eliminate another instance of global_loadparm.
This commit is contained in:
parent
5d146d0178
commit
8b06312f7e
@ -80,6 +80,8 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX
|
||||
io.in.workgroup = ""; /* only used with SPNEGO, disabled above */
|
||||
|
||||
io.in.options = smb_options;
|
||||
|
||||
io.in.iconv_convenience = lp_iconv_convenience(ctx->auth_ctx->lp_ctx);
|
||||
lp_smbcli_session_options(ctx->auth_ctx->lp_ctx, &io.in.session_options);
|
||||
|
||||
status = smb_composite_connect(&io, mem_ctx, lp_resolve_context(ctx->auth_ctx->lp_ctx),
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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));
|
||||
|
@ -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)
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include <Python.h>
|
||||
#include "scripting/python/modules.h"
|
||||
#include "libcli/util/pyerrors.h"
|
||||
#include "librpc/rpc/pyrpc.h"
|
||||
#include "lib/messaging/irpc.h"
|
||||
@ -347,12 +348,12 @@ PyObject *py_irpc_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
|
||||
ret->msg_ctx = messaging_init(ret->mem_ctx,
|
||||
messaging_path,
|
||||
server_id,
|
||||
lp_iconv_convenience(global_loadparm),
|
||||
py_iconv_convenience(ret->mem_ctx),
|
||||
ev);
|
||||
} else {
|
||||
ret->msg_ctx = messaging_client_init(ret->mem_ctx,
|
||||
messaging_path,
|
||||
lp_iconv_convenience(global_loadparm),
|
||||
py_iconv_convenience(ret->mem_ctx),
|
||||
ev);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,8 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
|
||||
const char **ports,
|
||||
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 smbcli_socket *sock;
|
||||
|
||||
@ -44,7 +45,8 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
|
||||
|
||||
if (sock == NULL) return false;
|
||||
|
||||
cli->transport = smbcli_transport_init(sock, cli, true, options);
|
||||
cli->transport = smbcli_transport_init(sock, cli, true, options,
|
||||
iconv_convenience);
|
||||
if (!cli->transport) {
|
||||
return false;
|
||||
}
|
||||
@ -147,7 +149,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
|
||||
struct resolve_context *resolve_ctx,
|
||||
struct event_context *ev,
|
||||
struct smbcli_options *options,
|
||||
struct smbcli_session_options *session_options)
|
||||
struct smbcli_session_options *session_options,
|
||||
struct smb_iconv_convenience *iconv_convenience)
|
||||
{
|
||||
struct smbcli_tree *tree;
|
||||
NTSTATUS status;
|
||||
@ -159,7 +162,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
|
||||
sharename, devtype,
|
||||
credentials, resolve_ctx, ev,
|
||||
options,
|
||||
session_options);
|
||||
session_options,
|
||||
iconv_convenience);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
goto done;
|
||||
}
|
||||
|
@ -76,7 +76,8 @@ static NTSTATUS smbcli_transport_finish_recv(void *private, DATA_BLOB blob);
|
||||
struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
|
||||
TALLOC_CTX *parent_ctx,
|
||||
bool primary,
|
||||
struct smbcli_options *options)
|
||||
struct smbcli_options *options,
|
||||
struct smb_iconv_convenience *iconv_convenience)
|
||||
{
|
||||
struct smbcli_transport *transport;
|
||||
|
||||
@ -91,6 +92,7 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
|
||||
transport->negotiate.protocol = PROTOCOL_NT1;
|
||||
transport->options = *options;
|
||||
transport->negotiate.max_xmit = transport->options.max_xmit;
|
||||
transport->iconv_convenience = iconv_convenience;
|
||||
|
||||
/* setup the stream -> packet parser */
|
||||
transport->packet = packet_init(transport);
|
||||
|
@ -178,7 +178,8 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
|
||||
struct resolve_context *resolve_ctx,
|
||||
struct event_context *ev,
|
||||
struct smbcli_options *options,
|
||||
struct smbcli_session_options *session_options)
|
||||
struct smbcli_session_options *session_options,
|
||||
struct smb_iconv_convenience *iconv_convenience)
|
||||
{
|
||||
struct smb_composite_connect io;
|
||||
NTSTATUS status;
|
||||
@ -201,6 +202,7 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
|
||||
io.in.workgroup = "";
|
||||
io.in.options = *options;
|
||||
io.in.session_options = *session_options;
|
||||
io.in.iconv_convenience = iconv_convenience;
|
||||
|
||||
status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev);
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
|
@ -162,6 +162,9 @@ struct smbcli_transport {
|
||||
|
||||
/* context of the stream -> packet parser */
|
||||
struct packet_context *packet;
|
||||
|
||||
/* iconv convenience */
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
};
|
||||
|
||||
/* this is the context for the user */
|
||||
|
@ -322,7 +322,7 @@ static NTSTATUS connect_socket(struct composite_context *c,
|
||||
|
||||
/* the socket is up - we can initialise the smbcli transport layer */
|
||||
state->transport = smbcli_transport_init(state->sock, state, true,
|
||||
&io->in.options);
|
||||
&io->in.options, io->in.iconv_convenience);
|
||||
NT_STATUS_HAVE_NO_MEMORY(state->transport);
|
||||
|
||||
if (is_ipaddress(state->sock->hostname) &&
|
||||
|
@ -145,6 +145,7 @@ struct composite_context *smb_composite_fetchfile_send(struct smb_composite_fetc
|
||||
state->connect->in.credentials = io->in.credentials;
|
||||
state->connect->in.fallback_to_anonymous = false;
|
||||
state->connect->in.workgroup = io->in.workgroup;
|
||||
state->connect->in.iconv_convenience = io->in.iconv_convenience;
|
||||
|
||||
state->connect->in.options = io->in.options;
|
||||
state->connect->in.session_options = io->in.session_options;
|
||||
|
@ -153,6 +153,7 @@ struct composite_context *smb_composite_fsinfo_send(struct smbcli_tree *tree,
|
||||
state->connect->in.credentials = io->in.credentials;
|
||||
state->connect->in.fallback_to_anonymous = false;
|
||||
state->connect->in.workgroup = io->in.workgroup;
|
||||
state->connect->in.iconv_convenience = io->in.iconv_convenience;
|
||||
|
||||
state->connect->in.options = tree->session->transport->options;
|
||||
state->connect->in.session_options = tree->session->options;
|
||||
|
@ -59,6 +59,7 @@ struct smb_composite_fetchfile {
|
||||
struct smbcli_options options;
|
||||
struct smbcli_session_options session_options;
|
||||
struct resolve_context *resolve_ctx;
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
} in;
|
||||
struct {
|
||||
uint8_t *data;
|
||||
@ -100,6 +101,7 @@ struct smb_composite_connect {
|
||||
const char *workgroup;
|
||||
struct smbcli_options options;
|
||||
struct smbcli_session_options session_options;
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
} in;
|
||||
struct {
|
||||
struct smbcli_tree *tree;
|
||||
@ -137,6 +139,7 @@ struct smb_composite_fsinfo {
|
||||
struct cli_credentials *credentials;
|
||||
const char *workgroup;
|
||||
enum smb_fsinfo_level level;
|
||||
struct smb_iconv_convenience *iconv_convenience;
|
||||
} in;
|
||||
|
||||
struct {
|
||||
|
@ -120,6 +120,8 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb_send(TALLOC_CT
|
||||
conn->in.service_type = NULL;
|
||||
conn->in.workgroup = lp_workgroup(lp_ctx);
|
||||
|
||||
conn->in.iconv_convenience = lp_iconv_convenience(lp_ctx);
|
||||
|
||||
lp_smbcli_options(lp_ctx, &conn->in.options);
|
||||
lp_smbcli_session_options(lp_ctx, &conn->in.session_options);
|
||||
|
||||
|
@ -205,6 +205,7 @@ static NTSTATUS cvfs_connect(struct ntvfs_module_context *ntvfs,
|
||||
io.in.workgroup = lp_workgroup(ntvfs->ctx->lp_ctx);
|
||||
io.in.service = remote_share;
|
||||
io.in.service_type = "?????";
|
||||
io.in.iconv_convenience = lp_iconv_convenience(ntvfs->ctx->lp_ctx);
|
||||
lp_smbcli_options(ntvfs->ctx->lp_ctx, &io.in.options);
|
||||
lp_smbcli_session_options(ntvfs->ctx->lp_ctx, &io.in.session_options);
|
||||
|
||||
|
@ -23,4 +23,6 @@
|
||||
void py_load_samba_modules(void);
|
||||
void py_update_path(const char *bindir);
|
||||
|
||||
#define py_iconv_convenience(mem_ctx) smb_iconv_convenience_init(mem_ctx, "ASCII", PyUnicode_GetDefaultEncoding(), true)
|
||||
|
||||
#endif /* __SAMBA_PYTHON_MODULES_H__ */
|
||||
|
@ -56,7 +56,8 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx)
|
||||
lp_smbcli_options(tctx->lp_ctx, &options);
|
||||
|
||||
if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), tctx->ev,
|
||||
lp_resolve_context(tctx->lp_ctx), &options)) {
|
||||
lp_resolve_context(tctx->lp_ctx), &options,
|
||||
lp_iconv_convenience(tctx->lp_ctx))) {
|
||||
torture_comment(tctx, "Failed to connect with %s\n", host);
|
||||
goto failed;
|
||||
}
|
||||
|
@ -821,6 +821,7 @@ static struct composite_context *torture_connect_async(
|
||||
smb->in.service_type=NULL;
|
||||
smb->in.credentials=cmdline_credentials;
|
||||
smb->in.fallback_to_anonymous=false;
|
||||
smb->in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx);
|
||||
smb->in.workgroup=workgroup;
|
||||
lp_smbcli_options(tctx->lp_ctx, &smb->in.options);
|
||||
lp_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options);
|
||||
|
@ -241,7 +241,8 @@ static bool connect_servers(struct event_context *ev,
|
||||
servers[i].credentials,
|
||||
lp_resolve_context(lp_ctx), ev,
|
||||
&smb_options,
|
||||
&smb_session_options);
|
||||
&smb_session_options,
|
||||
lp_iconv_convenience(lp_ctx));
|
||||
}
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("Failed to connect to \\\\%s\\%s - %s\n",
|
||||
|
@ -166,7 +166,8 @@ static struct smbcli_state *connect_one(struct event_context *ev,
|
||||
share, NULL,
|
||||
servers[snum],
|
||||
lp_resolve_context(lp_ctx),
|
||||
ev, &options, &session_options);
|
||||
ev, &options, &session_options,
|
||||
lp_iconv_convenience(lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
sleep(2);
|
||||
}
|
||||
|
@ -77,7 +77,8 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
char *share, const char **ports,
|
||||
struct smbcli_options *options,
|
||||
struct smbcli_session_options *session_options)
|
||||
struct smbcli_session_options *session_options,
|
||||
struct smb_iconv_convenience *iconv_convenience)
|
||||
{
|
||||
struct smbcli_state *c;
|
||||
char *server;
|
||||
@ -96,7 +97,8 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
|
||||
ports,
|
||||
share, NULL,
|
||||
cmdline_credentials, resolve_ctx, ev,
|
||||
options, session_options);
|
||||
options, session_options,
|
||||
iconv_convenience);
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return NULL;
|
||||
@ -366,7 +368,8 @@ static void usage(poptContext pc)
|
||||
lp_smbcli_session_options(lp_ctx, &session_options);
|
||||
|
||||
cli = connect_one(lp_resolve_context(lp_ctx), ev, mem_ctx, share,
|
||||
lp_smb_ports(lp_ctx), &options, &session_options);
|
||||
lp_smb_ports(lp_ctx), &options, &session_options,
|
||||
lp_iconv_convenience(lp_ctx));
|
||||
if (!cli) {
|
||||
DEBUG(0,("Failed to connect to %s\n", share));
|
||||
exit(1);
|
||||
|
@ -163,6 +163,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct
|
||||
io2.in.workgroup = lp_workgroup(tctx->lp_ctx);
|
||||
io2.in.filename = fname;
|
||||
io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx);
|
||||
io2.in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx);
|
||||
lp_smbcli_options(tctx->lp_ctx, &io2.in.options);
|
||||
lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
|
||||
|
||||
@ -352,6 +353,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx)
|
||||
io1.in.credentials = cmdline_credentials;
|
||||
io1.in.workgroup = lp_workgroup(tctx->lp_ctx);
|
||||
io1.in.level = RAW_QFS_OBJECTID_INFORMATION;
|
||||
io1.in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx);
|
||||
|
||||
printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops);
|
||||
|
||||
|
@ -194,6 +194,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
|
||||
io->in.credentials = cmdline_credentials;
|
||||
io->in.fallback_to_anonymous = false;
|
||||
io->in.workgroup = lp_workgroup(state->tctx->lp_ctx);
|
||||
io->in.iconv_convenience = lp_iconv_convenience(state->tctx->lp_ctx);
|
||||
lp_smbcli_options(state->tctx->lp_ctx, &io->in.options);
|
||||
lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
|
||||
|
||||
|
@ -189,7 +189,8 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx,
|
||||
torture_setting_string(tctx, "share", NULL),
|
||||
NULL, cmdline_credentials,
|
||||
lp_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options);
|
||||
tctx->ev, &options, &session_options,
|
||||
lp_iconv_convenience(tctx->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("Failed to open connection - %s\n", nt_errstr(status));
|
||||
return false;
|
||||
|
@ -102,7 +102,8 @@ static int fork_tcon_client(struct torture_context *tctx,
|
||||
host, lp_smb_ports(tctx->lp_ctx), share,
|
||||
NULL, cmdline_credentials,
|
||||
lp_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options);
|
||||
tctx->ev, &options, &session_options,
|
||||
lp_iconv_convenience(tctx->lp_ctx));
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("failed to connect to //%s/%s: %s\n",
|
||||
|
@ -41,7 +41,8 @@ bool torture_rpc_join(struct torture_context *torture)
|
||||
"IPC$", NULL,
|
||||
machine_account,
|
||||
lp_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options);
|
||||
torture->ev, &options, &session_options,
|
||||
lp_iconv_convenience(torture->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
|
||||
TORTURE_NETBIOS_NAME));
|
||||
@ -67,7 +68,8 @@ bool torture_rpc_join(struct torture_context *torture)
|
||||
"IPC$", NULL,
|
||||
machine_account,
|
||||
lp_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options);
|
||||
torture->ev, &options, &session_options,
|
||||
lp_iconv_convenience(torture->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
|
||||
TORTURE_NETBIOS_NAME));
|
||||
|
@ -91,7 +91,8 @@ bool torture_bind_authcontext(struct torture_context *torture)
|
||||
lp_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL, cmdline_credentials,
|
||||
lp_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options);
|
||||
torture->ev, &options, &session_options,
|
||||
lp_iconv_convenience(torture->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf("smbcli_full_connection failed: %s\n",
|
||||
nt_errstr(status));
|
||||
@ -307,7 +308,8 @@ bool torture_bind_samba3(struct torture_context *torture)
|
||||
lp_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL, cmdline_credentials,
|
||||
lp_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options);
|
||||
torture->ev, &options, &session_options,
|
||||
lp_iconv_convenience(torture->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf("smbcli_full_connection failed: %s\n",
|
||||
nt_errstr(status));
|
||||
@ -1226,7 +1228,8 @@ bool torture_netlogon_samba3(struct torture_context *torture)
|
||||
lp_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL, anon_creds,
|
||||
lp_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options);
|
||||
torture->ev, &options, &session_options,
|
||||
lp_iconv_convenience(torture->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf("smbcli_full_connection failed: %s\n",
|
||||
nt_errstr(status));
|
||||
@ -1315,7 +1318,8 @@ static bool test_join3(struct torture_context *tctx,
|
||||
lp_smb_ports(tctx->lp_ctx),
|
||||
"IPC$", NULL, smb_creds,
|
||||
lp_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options);
|
||||
tctx->ev, &options, &session_options,
|
||||
lp_iconv_convenience(tctx->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf("smbcli_full_connection failed: %s\n",
|
||||
nt_errstr(status));
|
||||
@ -1692,7 +1696,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
|
||||
lp_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL, cmdline_credentials,
|
||||
lp_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options);
|
||||
torture->ev, &options, &session_options,
|
||||
lp_iconv_convenience(torture->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf("(%s) smbcli_full_connection failed: %s\n",
|
||||
__location__, nt_errstr(status));
|
||||
@ -1719,7 +1724,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
|
||||
lp_smb_ports(torture->lp_ctx),
|
||||
"IPC$", NULL, anon_creds,
|
||||
lp_resolve_context(torture->lp_ctx),
|
||||
torture->ev, &options, &session_options);
|
||||
torture->ev, &options, &session_options,
|
||||
lp_iconv_convenience(torture->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf("(%s) anon smbcli_full_connection failed: %s\n",
|
||||
__location__, nt_errstr(status));
|
||||
|
@ -66,7 +66,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx)
|
||||
share, NULL,
|
||||
cmdline_credentials,
|
||||
lp_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options);
|
||||
tctx->ev, &options, &session_options,
|
||||
lp_iconv_convenience(tctx->lp_ctx));
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("failed to connect to //%s/%s: %s\n",
|
||||
|
@ -86,7 +86,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx,
|
||||
lp_smb_ports(tctx->lp_ctx),
|
||||
share, NULL,
|
||||
creds, lp_resolve_context(tctx->lp_ctx),
|
||||
tctx->ev, &options, &session_options);
|
||||
tctx->ev, &options, &session_options,
|
||||
lp_iconv_convenience(tctx->lp_ctx));
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("failed to connect to //%s/%s: %s\n",
|
||||
|
@ -488,7 +488,8 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
|
||||
sharename, NULL,
|
||||
cmdline_credentials,
|
||||
lp_resolve_context(tctx->lp_ctx),
|
||||
ev, &options, &session_options);
|
||||
ev, &options, &session_options,
|
||||
lp_iconv_convenience(tctx->lp_ctx));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("Failed to open connection - %s\n", nt_errstr(status));
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user