r3045: Allow object-uuid@... binding strings
authorJelmer Vernooij <jelmer@samba.org>
Mon, 18 Oct 2004 15:33:34 +0000 (15:33 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:01:53 +0000 (13:01 -0500)
(This used to be commit 38e9290bcf0295fb2a68090061310a4a8cb6c490)

source4/torture/torture.c

index 6b5d9ebd2eeff0b33225bd00a613b6d3e80d9df2..8f282caf5dc365476a1f6799382536b567a0c98d 100644 (file)
@@ -3553,6 +3553,18 @@ static void usage(poptContext pc)
        exit(1);
 }
 
+static BOOL is_binding_string(const char *binding_string)
+{
+       TALLOC_CTX *mem_ctx = talloc_init("is_binding_string");
+       struct dcerpc_binding binding_struct;
+       NTSTATUS status;
+       
+       status = dcerpc_parse_binding(mem_ctx, binding_string, &binding_struct);
+
+       talloc_destroy(mem_ctx);
+       return NT_STATUS_IS_OK(status);
+}
+
 /****************************************************************************
   main program
 ****************************************************************************/
@@ -3648,7 +3660,7 @@ static void usage(poptContext pc)
        }
 
        /* see if its a RPC transport specifier */
-       if (strncmp(argv_new[1], "ncacn_", 6) == 0) {
+       if (is_binding_string(argv_new[1])) {
                lp_set_cmdline("torture:binding", argv_new[1]);
        } else {
                char *binding = NULL;