summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-11-24 15:50:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:29 -0500
commitb48a01b4a53005e0bae69ec3b8bb434f3a0aa9c7 (patch)
tree305fd7654260ef2d1122c961ff4c0060401bcc4e /source4
parentf4e6be00ac5ff1662253cc66de9f26d819a9ab89 (diff)
downloadsamba-b48a01b4a53005e0bae69ec3b8bb434f3a0aa9c7.tar.gz
samba-b48a01b4a53005e0bae69ec3b8bb434f3a0aa9c7.tar.bz2
samba-b48a01b4a53005e0bae69ec3b8bb434f3a0aa9c7.zip
r19875: set torture:host and torture:share also when we are given a binding string
metze (This used to be commit 8202f98123a13727b5cda3b4ca6f1040a41908ca)
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/smbtorture.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 5ec8a2d6c4..55d415a518 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -250,18 +250,6 @@ static void usage(poptContext pc)
exit(1);
}
-static bool is_binding_string(const char *binding_string)
-{
- TALLOC_CTX *mem_ctx = talloc_named_const(NULL, 0, "is_binding_string");
- struct dcerpc_binding *binding_struct;
- NTSTATUS status;
-
- status = dcerpc_parse_binding(mem_ctx, binding_string, &binding_struct);
-
- talloc_free(mem_ctx);
- return NT_STATUS_IS_OK(status);
-}
-
static void max_runtime_handler(int sig)
{
DEBUG(0,("maximum runtime exceeded for smbtorture - terminating\n"));
@@ -516,6 +504,8 @@ int main(int argc,char *argv[])
poptContext pc;
static const char *target = "other";
const char **subunit_dir;
+ struct dcerpc_binding *binding_struct;
+ NTSTATUS status;
int shell = False;
static const char *ui_ops_name = "simple";
enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS,
@@ -645,7 +635,10 @@ int main(int argc,char *argv[])
}
/* see if its a RPC transport specifier */
- if (is_binding_string(argv_new[1])) {
+ status = dcerpc_parse_binding(talloc_autofree_context(), argv_new[1], &binding_struct);
+ if (NT_STATUS_IS_OK(status)) {
+ 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;