}
}
-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;
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);
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);
}
#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);
}
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;
/* 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)) {
}
static struct dd_iohandle * open_cifs_handle(const char * host,
+ const char **ports,
const char * share,
const char * path,
uint64_t io_size,
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);
}
/* ------------------------------------------------------------------------- */
struct dd_iohandle * dd_open_path(const char * path,
+ const char **ports,
uint64_t io_size,
int options)
{
/* 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));
}
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;
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)) {
/****************************************************************************
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;
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;
}
}
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)
*/
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 *);
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)
{
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 */
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);
if (!srv_ip.s_addr) {
return NT_STATUS_BAD_NETWORK_NAME;
}
+
+ SMB_ASSERT(srv_address->port != 0);
ZERO_STRUCT(srv_addr);
#ifdef HAVE_SOCK_SIN_LEN
} else {
struct sockaddr_in srv_addr;
struct in_addr addr;
+
+ SMB_ASSERT(dest_addr->port != 0);
ZERO_STRUCT(srv_addr);
#ifdef HAVE_SOCK_SIN_LEN
wrapper around smbcli_sock_connect()
*/
bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
- struct resolve_context *resolve_ctx,
+ const char **ports, struct resolve_context *resolve_ctx,
int max_xmit, int max_mux)
{
struct smbcli_socket *sock;
- sock = smbcli_sock_connect_byname(server, 0, NULL, resolve_ctx,
+ sock = smbcli_sock_connect_byname(server, ports, NULL, resolve_ctx,
NULL);
if (sock == NULL) return false;
NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
struct smbcli_state **ret_cli,
const char *host,
+ const char **ports,
const char *sharename,
const char *devtype,
struct cli_credentials *credentials,
*ret_cli = NULL;
status = smbcli_tree_full_connection(parent_ctx,
- &tree, host, 0, sharename, devtype,
+ &tree, host, ports,
+ sharename, devtype,
credentials, ev);
if (!NT_STATUS_IS_OK(status)) {
goto done;
state->io = talloc(state, struct nbt_name_register);
if (state->io == NULL) goto failed;
- state->wins_port = lp_nbt_port(global_loadparm);
+ state->wins_port = io->in.wins_port;
state->wins_servers = str_list_copy(state, io->in.wins_servers);
if (state->wins_servers == NULL ||
state->wins_servers[0] == NULL) goto failed;
struct composite_context *smbcli_sock_connect_send(TALLOC_CTX *mem_ctx,
const char *host_addr,
- int port,
+ const char **ports,
const char *host_name,
struct event_context *event_ctx)
{
struct composite_context *result, *ctx;
struct sock_connect_state *state;
+ int i;
result = talloc_zero(mem_ctx, struct composite_context);
if (result == NULL) goto failed;
state->host_name = talloc_strdup(state, host_name);
if (state->host_name == NULL) goto failed;
- if (port == 0) {
- const char **ports = lp_smb_ports(global_loadparm);
- int i;
-
- for (i=0;ports[i];i++) /* noop */ ;
- if (i == 0) {
- DEBUG(3, ("no smb ports defined\n"));
- goto failed;
- }
- state->num_ports = i;
- state->ports = talloc_array(state, uint16_t, i);
- if (state->ports == NULL) goto failed;
- for (i=0;ports[i];i++) {
- state->ports[i] = atoi(ports[i]);
- }
- } else {
- state->ports = talloc_array(state, uint16_t, 1);
- if (state->ports == NULL) goto failed;
- state->num_ports = 1;
- state->ports[0] = port;
+ state->num_ports = str_list_length(ports);
+ state->ports = talloc_array(state, uint16_t, state->num_ports);
+ if (state->ports == NULL) goto failed;
+ for (i=0;ports[i];i++) {
+ state->ports[i] = atoi(ports[i]);
}
ctx = socket_connect_multi_send(state, host_addr,
sync version of the function
*/
NTSTATUS smbcli_sock_connect(TALLOC_CTX *mem_ctx,
- const char *host_addr, int port,
+ const char *host_addr, const char **ports,
const char *host_name,
struct event_context *event_ctx,
struct smbcli_socket **result)
{
struct composite_context *c =
- smbcli_sock_connect_send(mem_ctx, host_addr, port, host_name,
+ smbcli_sock_connect_send(mem_ctx, host_addr, ports, host_name,
event_ctx);
return smbcli_sock_connect_recv(c, mem_ctx, result);
}
/****************************************************************************
resolve a hostname and connect
****************************************************************************/
-struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,
+struct smbcli_socket *smbcli_sock_connect_byname(const char *host, const char **ports,
TALLOC_CTX *mem_ctx,
struct resolve_context *resolve_ctx,
struct event_context *event_ctx)
return NULL;
}
- status = smbcli_sock_connect(mem_ctx, address, port, name, event_ctx,
+ status = smbcli_sock_connect(mem_ctx, address, ports, name, event_ctx,
&result);
if (!NT_STATUS_IS_OK(status)) {
*/
NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
struct smbcli_tree **ret_tree,
- const char *dest_host, int port,
+ const char *dest_host, const char **dest_ports,
const char *service, const char *service_type,
struct cli_credentials *credentials,
struct event_context *ev)
}
io.in.dest_host = dest_host;
- io.in.port = port;
+ io.in.dest_ports = dest_ports;
io.in.called_name = strupper_talloc(tmp_ctx, dest_host);
io.in.service = service;
io.in.service_type = service_type;
struct smb2_connect_state *state = talloc_get_type(c->private_data,
struct smb2_connect_state);
const char *addr;
-
+ const char *ports[2] = { "445", NULL };
+
c->status = resolve_name_recv(creq, state, &addr);
if (!composite_is_ok(c)) return;
- creq = smbcli_sock_connect_send(state, addr, 445, state->host, c->event_ctx);
+ creq = smbcli_sock_connect_send(state, addr, ports, state->host, c->event_ctx);
composite_continue(c, creq, continue_socket, c);
}
status = resolve_name_recv(state->creq, state, &address);
NT_STATUS_NOT_OK_RETURN(status);
- state->creq = smbcli_sock_connect_send(state, address, io->in.port,
+ state->creq = smbcli_sock_connect_send(state, address,
+ io->in.dest_ports,
io->in.dest_host, c->event_ctx);
NT_STATUS_HAVE_NO_MEMORY(state->creq);
state->io = io;
state->connect->in.dest_host = io->in.dest_host;
- state->connect->in.port = io->in.port;
+ state->connect->in.dest_ports = io->in.ports;
state->connect->in.called_name = io->in.called_name;
state->connect->in.service = io->in.service;
state->connect->in.service_type = io->in.service_type;
if (state->connect == NULL) goto failed;
state->connect->in.dest_host = io->in.dest_host;
- state->connect->in.port = io->in.port;
+ state->connect->in.dest_ports = io->in.dest_ports;
state->connect->in.called_name = io->in.called_name;
state->connect->in.service = io->in.service;
state->connect->in.service_type = io->in.service_type;
struct smb_composite_fetchfile {
struct {
const char *dest_host;
- int port;
+ const char **ports;
const char *called_name;
const char *service;
const char *service_type;
struct smb_composite_connect {
struct {
const char *dest_host;
- int port;
+ const char **dest_ports;
const char *called_name;
const char *service;
const char *service_type;
struct smb_composite_fsinfo {
struct {
const char *dest_host;
- int port;
+ const char **dest_ports;
const char *called_name;
const char *service;
const char *service_type;
r->out.account_guid = samdb_result_guid(res->msgs[0], "objectGUID");
if (r->in.acct_type == ACB_SVRTRUST) {
- status = libnet_JoinSite(remote_ldb, r);
+ status = libnet_JoinSite(ctx, remote_ldb, r);
}
talloc_free(tmp_ctx);
* 2. Add entry CN=<netbios name>,CN=Servers,CN=<site name>,CN=Sites,CN=Configuration,<domain dn>.
* TODO: 3.) use DsAddEntry() to create CN=NTDS Settings,CN=<netbios name>,CN=Servers,CN=<site name>,...
*/
-NTSTATUS libnet_JoinSite(struct ldb_context *remote_ldb,
+NTSTATUS libnet_JoinSite(struct libnet_context *ctx,
+ struct ldb_context *remote_ldb,
struct libnet_JoinDomain *libnet_r)
{
NTSTATUS status;
}
make_nbt_name_client(&name, libnet_r->out.samr_binding->host);
- status = resolve_name(lp_resolve_context(global_loadparm), &name, r, &dest_addr, NULL);
+ status = resolve_name(lp_resolve_context(ctx->lp_ctx), &name, r, &dest_addr, NULL);
if (!NT_STATUS_IS_OK(status)) {
libnet_r->out.error_string = NULL;
talloc_free(tmp_ctx);
/* prepare smb connection parameters: we're connecting to IPC$ share on
remote rpc server */
conn->in.dest_host = s->io.binding->host;
- conn->in.port = 0;
+ conn->in.dest_ports = lp_smb_ports(global_loadparm);
if (s->io.binding->target_hostname == NULL)
conn->in.called_name = "*SMBSERVER"; /* FIXME: This is invalid */
else
/* setup a wins name register request */
io.in.name = iname->name;
+ io.in.wins_port = lp_nbt_port(iname->iface->nbtsrv->task->lp_ctx);
io.in.wins_servers = lp_wins_server_list(iname->iface->nbtsrv->task->lp_ctx);
io.in.addresses = nbtd_address_list(iface, iname);
io.in.nb_flags = iname->nb_flags;
if (talloc_reference(s, src) == NULL) goto failed;
s->io.in.nbtd_server = iface->nbtsrv;
- s->io.in.nbtd_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
+ s->io.in.nbt_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
s->io.in.event_ctx = iface->nbtsrv->task->event_ctx;
s->io.in.name = rec->name;
s->io.in.num_addresses = winsdb_addr_list_length(rec->addresses);
#include "system/time.h"
#include "libcli/composite/composite.h"
#include "param/param.h"
+#include "smbd/service_task.h"
struct wins_challenge_state {
struct wins_challenge_io *io;
if (state->current_address < state->io->in.num_addresses) {
struct nbtd_interface *iface;
- state->release.in.dest_port = lp_nbt_port(global_loadparm);
+ state->release.in.dest_port = lp_nbt_port(state->io->in.nbtd_server->task->lp_ctx);
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
state->release.in.address = state->release.in.dest_addr;
state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1);
/* connect to the server, using the smbd event context */
io.in.dest_host = host;
- io.in.port = 0;
+ io.in.dest_ports = lp_smb_ports(ntvfs->ctx->lp_ctx);
io.in.called_name = host;
io.in.credentials = credentials;
io.in.fallback_to_anonymous = false;
/* Do connect */
io.in.dest_host = hostname;
- io.in.port = 0;
+ io.in.dest_ports = lp_smb_ports(global_loadparm);
io.in.called_name = strupper_talloc(mem_ctx, hostname);
io.in.service = sharename;
io.in.service_type = "?????";
struct socket_context *socket;
struct messaging_context *msg_ctx;
+ struct loadparm_context *lp_ctx;
bool processing;
const char *terminate;
goto failed;
}
- if (!smbcli_socket_connect(cli, host, lp_resolve_context(tctx->lp_ctx), lp_max_xmit(tctx->lp_ctx), lp_maxmux(tctx->lp_ctx))) {
+ if (!smbcli_socket_connect(cli, host, lp_smb_ports(tctx->lp_ctx), lp_resolve_context(tctx->lp_ctx), lp_max_xmit(tctx->lp_ctx), lp_maxmux(tctx->lp_ctx))) {
torture_comment(tctx, "Failed to connect with %s\n", host);
goto failed;
}
torture_comment(tctx, "Open Connection to %s/%s\n",host,share);
smb->in.dest_host=talloc_strdup(mem_ctx,host);
smb->in.service=talloc_strdup(mem_ctx,share);
- smb->in.port=0;
+ smb->in.dest_ports=lp_smb_ports(tctx->lp_ctx);
smb->in.called_name = strupper_talloc(mem_ctx, host);
smb->in.service_type=NULL;
smb->in.credentials=cmdline_credentials;
/*****************************************************
connect to the servers
*******************************************************/
-static bool connect_servers(void)
+static bool connect_servers(struct loadparm_context *lp_ctx)
{
int i, j;
status = smbcli_full_connection(NULL, &servers[i].cli[j],
servers[i].server_name,
+ lp_smb_ports(lp_ctx),
servers[i].share_name, NULL,
servers[i].credentials, NULL);
if (!NT_STATUS_IS_OK(status)) {
run the test with the current set of op_parms parameters
return the number of operations that completed successfully
*/
-static int run_test(void)
+static int run_test(struct loadparm_context *lp_ctx)
{
int op, i;
- if (!connect_servers()) {
+ if (!connect_servers(lp_ctx)) {
printf("Failed to connect to servers\n");
exit(1);
}
perform a backtracking analysis of the minimal set of operations
to generate an error
*/
-static void backtrack_analyze(void)
+static void backtrack_analyze(struct loadparm_context *lp_ctx)
{
int chunk, ret;
}
printf("Testing %d ops with %d-%d disabled\n",
options.numops, base, max-1);
- ret = run_test();
+ ret = run_test(lp_ctx);
printf("Completed %d of %d ops\n", ret, options.numops);
for (i=base;i<max; i++) {
op_parms[i].disabled = false;
} while (chunk > 0);
printf("Reduced to %d ops\n", options.numops);
- ret = run_test();
+ ret = run_test(lp_ctx);
if (ret != options.numops - 1) {
printf("Inconsistent result? ret=%d numops=%d\n", ret, options.numops);
}
/*
start the main gentest process
*/
-static bool start_gentest(void)
+static bool start_gentest(struct loadparm_context *lp_ctx)
{
int op;
int ret;
}
}
- ret = run_test();
+ ret = run_test(lp_ctx);
if (ret != options.numops && options.analyze) {
options.numops = ret+1;
- backtrack_analyze();
+ backtrack_analyze(lp_ctx);
} else if (options.analyze_always) {
- backtrack_analyze();
+ backtrack_analyze(lp_ctx);
} else if (options.analyze_continuous) {
- while (run_test() == options.numops) ;
+ while (run_test(lp_ctx) == options.numops) ;
}
return ret == options.numops;
printf("seed=%u\n", options.seed);
- ret = start_gentest();
+ ret = start_gentest(lp_ctx);
if (ret) {
printf("gentest completed - no errors\n");
printf("\\\\%s\\%s\n", server, share);
status = smbcli_full_connection(NULL, &c,
server,
+ lp_smb_ports(lp_ctx),
share, NULL,
servers[snum], NULL);
if (!NT_STATUS_IS_OK(status)) {
/*****************************************************
return a connection to a server
*******************************************************/
-static struct smbcli_state *connect_one(char *share)
+static struct smbcli_state *connect_one(char *share, const char **ports)
{
struct smbcli_state *c;
char *server_n;
slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
nt_status = smbcli_full_connection(NULL,
- &c, myname, server_n, 0, share, NULL,
+ &c, myname, server_n, ports, share, NULL,
username, lp_workgroup(), password, NULL);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status)));
static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
char *nfs[NSERVERS],
int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES],
+ const char **ports,
char *share1, char *share2)
{
int server, conn, f, fstype;
smbcli_ulogoff(cli[server][conn]);
talloc_free(cli[server][conn]);
}
- cli[server][conn] = connect_one(share[server]);
+ cli[server][conn] = connect_one(share[server], ports);
if (!cli[server][conn]) {
DEBUG(0,("Failed to connect to %s\n", share[server]));
exit(1);
we then do random locking ops in tamdem on the 4 fnums from each
server and ensure that the results match
*/
-static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath2)
+static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath2, const char **ports)
{
struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
char *nfs[NSERVERS];
recorded[n].needed = true;
}
- reconnect(cli, nfs, fnum, share1, share2);
+ reconnect(cli, nfs, fnum, share1, share2, ports);
open_files(cli, nfs, fnum);
n = retest(cli, nfs, fnum, numops);
n1 = n;
close_files(cli, nfs, fnum);
- reconnect(cli, nfs, fnum, share1, share2);
+ reconnect(cli, nfs, fnum, share1, share2, ports);
open_files(cli, nfs, fnum);
for (i=0;i<n-1;i++) {
}
close_files(cli, nfs, fnum);
- reconnect(cli, nfs, fnum, share1, share2);
+ reconnect(cli, nfs, fnum, share1, share2, ports);
open_files(cli, nfs, fnum);
showall = true;
n1 = retest(cli, nfs, fnum, n);
srandom(seed);
locking_init(1);
- test_locks(share1, share2, nfspath1, nfspath2);
+ test_locks(share1, share2, nfspath1, nfspath2, lp_smb_ports(lp_ctx));
return(0);
}
/*****************************************************
return a connection to a server
*******************************************************/
-static struct smbcli_state *connect_one(char *share)
+static struct smbcli_state *connect_one(char *share, const char **ports)
{
struct smbcli_state *c;
fstring server;
status = smbcli_full_connection(NULL, &c,
server,
+ ports,
share, NULL,
credentials, NULL);
argc -= optind;
argv += optind;
- cli = connect_one(share);
+ cli = connect_one(share, lp_smb_ports(lp_ctx));
if (!cli) {
DEBUG(0,("Failed to connect to %s\n", share));
exit(1);
torture_comment(tctx, "register the name\n");
io.in.name = *name;
+ io.in.wins_port = lp_nbt_port(tctx->lp_ctx);
io.in.wins_servers = str_list_make(tctx, address, NULL);
io.in.addresses = str_list_make(tctx, myaddress, NULL);
io.in.nb_flags = nb_flags;
}
io2.in.dest_host = torture_setting_string(tctx, "host", NULL);
- io2.in.port = 0;
+ io2.in.ports = lp_smb_ports(tctx->lp_ctx);
io2.in.called_name = torture_setting_string(tctx, "host", NULL);
io2.in.service = torture_setting_string(tctx, "share", NULL);
io2.in.service_type = "A:";
bool ret = true;
io1.in.dest_host = torture_setting_string(tctx, "host", NULL);
- io1.in.port = 0;
+ io1.in.dest_ports = lp_smb_ports(tctx->lp_ctx);
io1.in.called_name = torture_setting_string(tctx, "host", NULL);
io1.in.service = torture_setting_string(tctx, "share", NULL);
io1.in.service_type = "A:";
}
io->in.dest_host = state->dest_host;
- io->in.port = state->dest_port;
+ io->in.dest_ports = state->dest_port;
io->in.called_name = state->called_name;
io->in.service = share;
io->in.service_type = state->service_type;
}
io->in.dest_host = state->dest_host;
- io->in.port = state->dest_port;
+ io->in.dest_ports = state->dest_port;
io->in.called_name = state->called_name;
io->in.service = share;
io->in.service_type = state->service_type;
#include "auth/credentials/credentials.h"
#include "torture/rpc/rpc.h"
+#include "param/param.h"
+
#define TORTURE_NETBIOS_NAME "smbtorturejoin"
}
status = smbcli_full_connection(tj, &cli, host,
+ lp_smb_ports(torture->lp_ctx),
"IPC$", NULL,
machine_account,
NULL);
}
status = smbcli_full_connection(tj, &cli, host,
+ lp_smb_ports(torture->lp_ctx),
"IPC$", NULL,
machine_account,
NULL);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
+ lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
NULL);
if (!NT_STATUS_IS_OK(status)) {
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
+ lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
NULL);
if (!NT_STATUS_IS_OK(status)) {
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
+ lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, anon_creds, NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
status = smbcli_full_connection(tctx, &cli,
torture_setting_string(tctx, "host", NULL),
+ lp_smb_ports(tctx->lp_ctx),
"IPC$", NULL, smb_creds, NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
status = smbcli_full_connection(
mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
+ lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials, NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) smbcli_full_connection failed: %s\n",
status = smbcli_full_connection(
mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
+ lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, anon_creds, NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) anon smbcli_full_connection failed: %s\n",
struct creds_CredentialState *creds;
struct cli_credentials *credentials;
- join_ctx = torture_join_domain(tctx, talloc_asprintf(tctx, "%s%d", TEST_MACHINE_NAME, i),
+ join_ctx = torture_join_domain(tctx,
+ talloc_asprintf(tctx, "%s%d", TEST_MACHINE_NAME, i),
acct_flags, &credentials);
torture_assert(tctx, join_ctx != NULL, "Failed to join domain");
#include "torture/basic/proto.h"
#include "lib/cmdline/popt_common.h"
#include "auth/credentials/credentials.h"
+#include "param/param.h"
struct unix_info2 {
uint64_t end_of_file;
const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", NULL);
- status = smbcli_full_connection(tctx, &cli,
- host, share, NULL,
+ status = smbcli_full_connection(tctx, &cli, host,
+ lp_smb_ports(tctx->lp_ctx),
+ share, NULL,
cmdline_credentials, NULL);
if (!NT_STATUS_IS_OK(status)) {
const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", NULL);
- status = smbcli_full_connection(tctx, &cli,
- host, share, NULL,
+ status = smbcli_full_connection(tctx, &cli, host,
+ lp_smb_ports(tctx->lp_ctx),
+ share, NULL,
creds, NULL);
if (!NT_STATUS_IS_OK(status)) {
NTSTATUS status;
status = smbcli_full_connection(mem_ctx, c, hostname,
+ lp_smb_ports(tctx->lp_ctx),
sharename, NULL,
cmdline_credentials, ev);
if (!NT_STATUS_IS_OK(status)) {