summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-29 00:04:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:04 -0500
commit7ee37fdb1e3612c7e0e281e3c7c44a98b4f8eda2 (patch)
tree84be399013b6294460020808c6e55f29392cd2b3 /source4/torture
parent3e7203d0b34a031e10aeaaf04f246a1de8376ab4 (diff)
downloadsamba-7ee37fdb1e3612c7e0e281e3c7c44a98b4f8eda2.tar.gz
samba-7ee37fdb1e3612c7e0e281e3c7c44a98b4f8eda2.tar.bz2
samba-7ee37fdb1e3612c7e0e281e3c7c44a98b4f8eda2.zip
r24757: Try parsing a UNC location before a DCE/RPC binding string as the latter now
accepts strings not prefixed with a transport. (This used to be commit d131d40ae3df3ca8f4ddec2cd0f16210ffe64367)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/smbtorture.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index c96d8a2e2b..d461828431 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -481,6 +481,7 @@ int main(int argc,char *argv[])
static const char *ui_ops_name = "simple";
const char *basedir = NULL;
static int list_tests = 0;
+ char *host = NULL, *share = NULL;
enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, OPT_LIST,
OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS};
@@ -601,24 +602,19 @@ int main(int argc,char *argv[])
}
/* see if its a RPC transport specifier */
- status = dcerpc_parse_binding(talloc_autofree_context(), argv_new[1], &binding_struct);
- if (NT_STATUS_IS_OK(status)) {
+ if (!smbcli_parse_unc(argv_new[1], NULL, &host, &share)) {
+ status = dcerpc_parse_binding(talloc_autofree_context(), argv_new[1], &binding_struct);
+ if (NT_STATUS_IS_ERR(status)) {
+ d_printf("Invalid option: %s is not a valid torture target (share or binding string)\n\n", argv_new[1]);
+ usage(pc);
+ return false;
+ }
lp_set_cmdline("torture:host", binding_struct->host);
lp_set_cmdline("torture:share", "IPC$");
lp_set_cmdline("torture:binding", argv_new[1]);
} else {
- char *binding = NULL;
- char *host = NULL, *share = NULL;
-
- if (!smbcli_parse_unc(argv_new[1], NULL, &host, &share)) {
- d_printf("Invalid option: %s is not a valid torture target (share or binding string)\n\n", argv_new[1]);
- usage(pc);
- }
-
lp_set_cmdline("torture:host", host);
lp_set_cmdline("torture:share", share);
- asprintf(&binding, "ncacn_np:%s", host);
- lp_set_cmdline("torture:binding", binding);
}
if (!strcmp(ui_ops_name, "simple")) {