summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-11-02 16:07:28 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-11-02 16:07:28 +0100
commitff36c52d8c7f146eca9c6c678456708a8e2efbab (patch)
tree8ae184942009eaef07148baf6ef7f33064555b40 /source4/torture
parent7a0e5de08d487108c604b4bab8a2c8e689808d9f (diff)
downloadsamba-ff36c52d8c7f146eca9c6c678456708a8e2efbab.tar.gz
samba-ff36c52d8c7f146eca9c6c678456708a8e2efbab.tar.bz2
samba-ff36c52d8c7f146eca9c6c678456708a8e2efbab.zip
Remove another use of global_loadparm.
Eventually, we should move some of these parameters into a separate struct (perhaps into smb_transport_options?), to avoid the long lists of parameters.
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/base.c18
-rw-r--r--source4/torture/basic/misc.c1
-rw-r--r--source4/torture/gentest.c3
-rw-r--r--source4/torture/locktest.c3
-rw-r--r--source4/torture/locktest2.c16
-rw-r--r--source4/torture/masktest.c9
-rw-r--r--source4/torture/raw/composite.c2
-rw-r--r--source4/torture/raw/lockbench.c1
-rw-r--r--source4/torture/raw/openbench.c1
-rw-r--r--source4/torture/raw/oplock.c3
-rw-r--r--source4/torture/raw/tconrate.c3
-rw-r--r--source4/torture/rpc/join.c6
-rw-r--r--source4/torture/rpc/samba3rpc.c18
-rw-r--r--source4/torture/unix/unix_info2.c3
-rw-r--r--source4/torture/unix/whoami.c3
-rw-r--r--source4/torture/util_smb.c3
16 files changed, 57 insertions, 36 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index 4725188e8f..ea7b6c08fd 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -1450,14 +1450,8 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
const char *os2_fname = ".+,;=[].";
const char *dname = "samba3_errordir";
union smb_open io;
- TALLOC_CTX *mem_ctx = talloc_init("samba3_errorpaths");
NTSTATUS status;
- if (mem_ctx == NULL) {
- torture_comment(tctx, "talloc_init failed\n");
- return false;
- }
-
nt_status_support = lp_nt_status_support(tctx->lp_ctx);
if (!lp_set_cmdline(tctx->lp_ctx, "nt status support", "yes")) {
@@ -1506,14 +1500,14 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
io.ntcreatex.in.security_flags = 0;
io.ntcreatex.in.fname = dname;
- status = smb_raw_open(cli_nt->tree, mem_ctx, &io);
+ status = smb_raw_open(cli_nt->tree, tctx, &io);
if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
torture_comment(tctx, "(%s) incorrect status %s should be %s\n",
__location__, nt_errstr(status),
nt_errstr(NT_STATUS_OBJECT_NAME_COLLISION));
goto fail;
}
- status = smb_raw_open(cli_dos->tree, mem_ctx, &io);
+ status = smb_raw_open(cli_dos->tree, tctx, &io);
if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS, ERRfilexists))) {
torture_comment(tctx, "(%s) incorrect status %s should be %s\n",
__location__, nt_errstr(status),
@@ -1563,7 +1557,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
}
io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
- status = smb_raw_open(cli_nt->tree, mem_ctx, &io);
+ status = smb_raw_open(cli_nt->tree, tctx, &io);
if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
torture_comment(tctx, "(%s) incorrect status %s should be %s\n",
__location__, nt_errstr(status),
@@ -1571,7 +1565,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
goto fail;
}
- status = smb_raw_open(cli_dos->tree, mem_ctx, &io);
+ status = smb_raw_open(cli_dos->tree, tctx, &io);
if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS, ERRfilexists))) {
torture_comment(tctx, "(%s) incorrect status %s should be %s\n",
__location__, nt_errstr(status),
@@ -1644,7 +1638,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
io.ntcreatex.in.fname = fname;
io.ntcreatex.in.flags = 0;
- status = smb_raw_open(cli_nt->tree, mem_ctx, &io);
+ status = smb_raw_open(cli_nt->tree, tctx, &io);
if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_A_DIRECTORY)) {
torture_comment(tctx, "ntcreate as dir gave %s, "
"expected NT_STATUS_NOT_A_DIRECTORY\n",
@@ -1656,7 +1650,7 @@ static bool torture_samba3_errorpaths(struct torture_context *tctx)
smbcli_close(cli_nt->tree, io.ntcreatex.out.file.fnum);
}
- status = smb_raw_open(cli_dos->tree, mem_ctx, &io);
+ status = smb_raw_open(cli_dos->tree, tctx, &io);
if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS,
ERRbaddirectory))) {
torture_comment(tctx, "ntcreate as dir gave %s, "
diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c
index c19b08e617..f11b90f448 100644
--- a/source4/torture/basic/misc.c
+++ b/source4/torture/basic/misc.c
@@ -823,6 +823,7 @@ static struct composite_context *torture_connect_async(
smb->in.credentials=cmdline_credentials;
smb->in.fallback_to_anonymous=false;
smb->in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx);
+ smb->in.gensec_settings = lp_gensec_settings(mem_ctx, 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);
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 9e2456d236..c9cb715a8b 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -246,7 +246,8 @@ static bool connect_servers(struct event_context *ev,
lp_resolve_context(lp_ctx), ev,
&smb_options,
&smb_session_options,
- lp_iconv_convenience(lp_ctx));
+ lp_iconv_convenience(lp_ctx),
+ lp_gensec_settings(lp_ctx, lp_ctx));
}
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to \\\\%s\\%s - %s\n",
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index 4beef98a8f..18c4156cc3 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -168,7 +168,8 @@ static struct smbcli_state *connect_one(struct event_context *ev,
servers[snum],
lp_resolve_context(lp_ctx),
ev, &options, &session_options,
- lp_iconv_convenience(lp_ctx));
+ lp_iconv_convenience(lp_ctx),
+ lp_gensec_settings(mem_ctx, lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
sleep(2);
}
diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c
index e7cbf13c74..cb435c7b55 100644
--- a/source4/torture/locktest2.c
+++ b/source4/torture/locktest2.c
@@ -144,6 +144,7 @@ static struct smbcli_state *connect_one(TALLOC_CTX *mem_ctx,
char *share, const char **ports,
struct smb_options *options,
struct smb_options *session_options,
+ struct gensec_settings *gensec_settings,
struct event_context *ev)
{
struct smbcli_state *c;
@@ -173,7 +174,7 @@ static struct smbcli_state *connect_one(TALLOC_CTX *mem_ctx,
nt_status = smbcli_full_connection(NULL,
&c, myname, server_n, ports, share, NULL,
username, lp_workgroup(), password, ev,
- options, session_options);
+ options, session_options, gensec_settings);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status)));
return NULL;
@@ -192,6 +193,7 @@ static void reconnect(TALLOC_CTX *mem_ctx,
const char **ports,
struct smbcli_options *options,
struct smbcli_session_options *session_options,
+ struct gensec_settings *gensec_settings,
struct event_context *ev,
char *share1, char *share2)
{
@@ -211,7 +213,7 @@ static void reconnect(TALLOC_CTX *mem_ctx,
smbcli_ulogoff(cli[server][conn]);
talloc_free(cli[server][conn]);
}
- cli[server][conn] = connect_one(mem_ctx, share[server], ports, options, session_options, ev);
+ cli[server][conn] = connect_one(mem_ctx, share[server], ports, options, session_options, gensec_settings, ev);
if (!cli[server][conn]) {
DEBUG(0,("Failed to connect to %s\n", share[server]));
exit(1);
@@ -362,6 +364,7 @@ static void test_locks(TALLOC_CTX *mem_ctx, char *share1, char *share2,
const char **ports,
struct smbcli_options *options,
struct smbcli_session_options *session_options,
+ struct gensec_settings *gensec_settings,
struct event_context *ev)
{
struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
@@ -391,7 +394,7 @@ static void test_locks(TALLOC_CTX *mem_ctx, char *share1, char *share2,
recorded[n].needed = true;
}
- reconnect(mem_ctx, cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
+ reconnect(mem_ctx, cli, nfs, fnum, ports, options, session_options, gensec_settings, ev, share1, share2);
open_files(cli, nfs, fnum);
n = retest(cli, nfs, fnum, numops);
@@ -429,7 +432,7 @@ static void test_locks(TALLOC_CTX *mem_ctx, char *share1, char *share2,
}
close_files(cli, nfs, fnum);
- reconnect(mem_ctx, cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
+ reconnect(mem_ctx, cli, nfs, fnum, ports, options, session_options, gensec_settings, ev, share1, share2);
open_files(cli, nfs, fnum);
showall = true;
n1 = retest(cli, nfs, fnum, n);
@@ -567,8 +570,9 @@ static void usage(void)
locking_init(1);
lp_smbcli_options(lp_ctx, &options);
lp_smbcli_session_options(lp_ctx, &session_options);
- test_locks(mem_ctx, share1, share2, nfspath1, nfspath2, lp_smb_ports(lp_ctx),
- &options, &session_options, ev);
+ test_locks(mem_ctx, share1, share2, nfspath1, nfspath2,
+ lp_smb_ports(lp_ctx),
+ &options, &session_options, lp_gensec_settings(lp_ctx), ev);
return(0);
}
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index fb1277a95a..9ff790c2b0 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -79,7 +79,8 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
const char *socket_options,
struct smbcli_options *options,
struct smbcli_session_options *session_options,
- struct smb_iconv_convenience *iconv_convenience)
+ struct smb_iconv_convenience *iconv_convenience,
+ struct gensec_settings *gensec_settings)
{
struct smbcli_state *c;
char *server;
@@ -100,7 +101,8 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
socket_options,
cmdline_credentials, resolve_ctx, ev,
options, session_options,
- iconv_convenience);
+ iconv_convenience,
+ gensec_settings);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
@@ -372,7 +374,8 @@ static void usage(poptContext pc)
cli = connect_one(lp_resolve_context(lp_ctx), ev, mem_ctx, share,
lp_smb_ports(lp_ctx), lp_socket_options(lp_ctx),
&options, &session_options,
- lp_iconv_convenience(lp_ctx));
+ lp_iconv_convenience(lp_ctx),
+ lp_gensec_settings(mem_ctx, lp_ctx));
if (!cli) {
DEBUG(0,("Failed to connect to %s\n", share));
exit(1);
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index 6eb4fe0e67..79ae41dafb 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -164,6 +164,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct
io2.in.filename = fname;
io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx);
io2.in.iconv_convenience = lp_iconv_convenience(tctx->lp_ctx);
+ io2.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
lp_smbcli_options(tctx->lp_ctx, &io2.in.options);
lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
@@ -355,6 +356,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx)
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);
+ io1.in.gensec_settings = lp_gensec_settings(tctx, tctx->lp_ctx);
printf("testing parallel queryfsinfo [Object ID] with %d ops\n", torture_numops);
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c
index 6b59b35b5d..dce21ebe71 100644
--- a/source4/torture/raw/lockbench.c
+++ b/source4/torture/raw/lockbench.c
@@ -188,6 +188,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
io->in.dest_host = state->dest_host;
io->in.dest_ports = state->dest_ports;
+ io->in.gensec_settings = lp_gensec_settings(state->mem_ctx, state->tctx->lp_ctx);
io->in.socket_options = lp_socket_options(state->tctx->lp_ctx);
io->in.called_name = state->called_name;
io->in.service = share;
diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c
index e2d52f6c02..2440649e7f 100644
--- a/source4/torture/raw/openbench.c
+++ b/source4/torture/raw/openbench.c
@@ -137,6 +137,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.gensec_settings = lp_gensec_settings(state->mem_ctx, 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);
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index 86dae6bc1f..4ffb24eb03 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -190,7 +190,8 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx,
NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_iconv_convenience(tctx->lp_ctx));
+ lp_iconv_convenience(tctx->lp_ctx),
+ lp_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return false;
diff --git a/source4/torture/raw/tconrate.c b/source4/torture/raw/tconrate.c
index 1615b5322a..0109b65481 100644
--- a/source4/torture/raw/tconrate.c
+++ b/source4/torture/raw/tconrate.c
@@ -103,7 +103,8 @@ static int fork_tcon_client(struct torture_context *tctx,
NULL, lp_socket_options(tctx->lp_ctx), cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_iconv_convenience(tctx->lp_ctx));
+ lp_iconv_convenience(tctx->lp_ctx),
+ lp_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c
index 9d6c803ad7..b0c122c1b6 100644
--- a/source4/torture/rpc/join.c
+++ b/source4/torture/rpc/join.c
@@ -43,7 +43,8 @@ bool torture_rpc_join(struct torture_context *torture)
machine_account,
lp_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_iconv_convenience(torture->lp_ctx));
+ lp_iconv_convenience(torture->lp_ctx),
+ lp_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
TORTURE_NETBIOS_NAME));
@@ -71,7 +72,8 @@ bool torture_rpc_join(struct torture_context *torture)
machine_account,
lp_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_iconv_convenience(torture->lp_ctx));
+ lp_iconv_convenience(torture->lp_ctx),
+ lp_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
TORTURE_NETBIOS_NAME));
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 73c2044449..c2b849127f 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -94,7 +94,8 @@ bool torture_bind_authcontext(struct torture_context *torture)
cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_iconv_convenience(torture->lp_ctx));
+ lp_iconv_convenience(torture->lp_ctx),
+ lp_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -316,7 +317,8 @@ bool torture_bind_samba3(struct torture_context *torture)
cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_iconv_convenience(torture->lp_ctx));
+ lp_iconv_convenience(torture->lp_ctx),
+ lp_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1254,7 +1256,8 @@ bool torture_netlogon_samba3(struct torture_context *torture)
anon_creds,
lp_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_iconv_convenience(torture->lp_ctx));
+ lp_iconv_convenience(torture->lp_ctx),
+ lp_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1344,7 +1347,8 @@ static bool test_join3(struct torture_context *tctx,
"IPC$", NULL, lp_socket_options(tctx->lp_ctx),
smb_creds, lp_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_iconv_convenience(tctx->lp_ctx));
+ lp_iconv_convenience(tctx->lp_ctx),
+ lp_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1727,7 +1731,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
"IPC$", NULL, lp_socket_options(torture->lp_ctx), cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_iconv_convenience(torture->lp_ctx));
+ lp_iconv_convenience(torture->lp_ctx),
+ lp_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) smbcli_full_connection failed: %s\n",
__location__, nt_errstr(status));
@@ -1755,7 +1760,8 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
lp_socket_options(torture->lp_ctx), anon_creds,
lp_resolve_context(torture->lp_ctx),
torture->ev, &options, &session_options,
- lp_iconv_convenience(torture->lp_ctx));
+ lp_iconv_convenience(torture->lp_ctx),
+ lp_gensec_settings(torture, torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) anon smbcli_full_connection failed: %s\n",
__location__, nt_errstr(status));
diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c
index 2e451e1999..d0a2c3d041 100644
--- a/source4/torture/unix/unix_info2.c
+++ b/source4/torture/unix/unix_info2.c
@@ -67,7 +67,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx)
cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_iconv_convenience(tctx->lp_ctx));
+ lp_iconv_convenience(tctx->lp_ctx),
+ lp_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c
index f3a6acee50..5e5a5e81cd 100644
--- a/source4/torture/unix/whoami.c
+++ b/source4/torture/unix/whoami.c
@@ -87,7 +87,8 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx,
share, NULL, lp_socket_options(tctx->lp_ctx),
creds, lp_resolve_context(tctx->lp_ctx),
tctx->ev, &options, &session_options,
- lp_iconv_convenience(tctx->lp_ctx));
+ lp_iconv_convenience(tctx->lp_ctx),
+ lp_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index 5157369a78..ae051b9735 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -490,7 +490,8 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
ev, &options, &session_options,
- lp_iconv_convenience(tctx->lp_ctx));
+ lp_iconv_convenience(tctx->lp_ctx),
+ lp_gensec_settings(tctx, tctx->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return false;