summaryrefslogtreecommitdiff
path: root/source4/torture/raw
diff options
context:
space:
mode:
Diffstat (limited to 'source4/torture/raw')
-rw-r--r--source4/torture/raw/composite.c8
-rw-r--r--source4/torture/raw/context.c27
2 files changed, 18 insertions, 17 deletions
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index 9a0f924bfc..b9c7609b5f 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -24,6 +24,7 @@
#include "lib/events/events.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
+#include "lib/cmdline/popt_common.h"
#define BASEDIR "\\composite"
@@ -149,9 +150,10 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
io2.in.calling_name = lp_netbios_name();
io2.in.service = lp_parm_string(-1, "torture", "share");
io2.in.service_type = "A:";
- io2.in.user = lp_parm_string(-1, "torture", "username");
- io2.in.domain = lp_parm_string(-1, "torture", "userdomain");
- io2.in.password = lp_parm_string(-1, "torture", "password");
+
+ io2.in.user = cli_credentials_get_username(cmdline_credentials);
+ io2.in.domain = cli_credentials_get_domain(cmdline_credentials);
+ io2.in.password = cli_credentials_get_password(cmdline_credentials);
io2.in.filename = fname;
printf("testing parallel fetchfile with %d ops\n", torture_numops);
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index cdf8388e93..3eb848eebd 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -22,6 +22,7 @@
#include "libcli/raw/libcliraw.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/composite/composite.h"
+#include "lib/cmdline/popt_common.h"
#define BASEDIR "\\rawcontext"
@@ -57,7 +58,6 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
BOOL ret = True;
- const char *username, *domain, *password;
struct smbcli_session *session;
struct smbcli_session *session2;
struct smbcli_session *session3;
@@ -76,18 +76,14 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
return False;
}
- username = lp_parm_string(-1, "torture", "username");
- password = lp_parm_string(-1, "torture", "password");
- domain = lp_parm_string(-1, "torture", "userdomain");
-
printf("create a second security context on the same transport\n");
session = smbcli_session_init(cli->transport, mem_ctx, False);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
- setup.in.password = password;
- setup.in.user = username;
- setup.in.domain = domain;
+ setup.in.password = cli_credentials_get_password(cmdline_credentials);
+ setup.in.user = cli_credentials_get_username(cmdline_credentials);
+ setup.in.domain = cli_credentials_get_domain(cmdline_credentials);
status = smb_composite_sesssetup(session, &setup);
CHECK_STATUS(status, NT_STATUS_OK);
@@ -100,9 +96,10 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
session2->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
- setup.in.password = password;
- setup.in.user = username;
- setup.in.domain = domain;
+
+ setup.in.password = cli_credentials_get_password(cmdline_credentials);
+ setup.in.user = cli_credentials_get_username(cmdline_credentials);
+ setup.in.domain = cli_credentials_get_domain(cmdline_credentials);
status = smb_composite_sesssetup(session2, &setup);
CHECK_STATUS(status, NT_STATUS_OK);
@@ -120,9 +117,11 @@ static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
session3->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = 0; /* force a non extended security login (should fail) */
- setup.in.password = password;
- setup.in.user = username;
- setup.in.domain = domain;
+
+
+ setup.in.password = cli_credentials_get_password(cmdline_credentials);
+ setup.in.user = cli_credentials_get_username(cmdline_credentials);
+ setup.in.domain = cli_credentials_get_domain(cmdline_credentials);
status = smb_composite_sesssetup(session3, &setup);
CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);