svn commit: samba r24757 - in branches/SAMBA_4_0: . source/torture

jelmer at samba.org jelmer at samba.org
Wed Aug 29 00:04:43 GMT 2007


Author: jelmer
Date: 2007-08-29 00:04:40 +0000 (Wed, 29 Aug 2007)
New Revision: 24757

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24757

Log:
Try parsing a UNC location before a DCE/RPC binding string as the latter now 
accepts strings not prefixed with a transport.

Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/torture/smbtorture.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/torture/smbtorture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/smbtorture.c	2007-08-28 22:49:43 UTC (rev 24756)
+++ branches/SAMBA_4_0/source/torture/smbtorture.c	2007-08-29 00:04:40 UTC (rev 24757)
@@ -481,6 +481,7 @@
 	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 @@
 	}
 
 	/* 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")) {



More information about the samba-cvs mailing list