Fixing "-k" in S4 smbtorture.

Jeremy Allison jra at
Thu May 20 11:59:53 MDT 2010

I just had to spend 10 minutes with a Microsoft
engineer tracking down why the smbtorture command line
options :

smbtorture -k ncacn_ip_tcp:<name>[options] RPC-NETLOGON

just said :

Error parsing "-k ncacn_ip_tcp:<name>[options]".

Of course, it needed :

smbtorture -k yes ncacn_ip_tcp:<name>[options] RPC-NETLOGON

instead :-(. I had to look in the source code for this
to find out what "Error parsing XXX" meant for the -k
option. Why does the -k option need to be followed
by a bool ? Is there any case where someone would
use "-k no" ?

Given that, I'd like to push the following patch.

Comments ?

-------------- next part --------------
diff --git a/source4/lib/cmdline/popt_credentials.c b/source4/lib/cmdline/popt_credentials.c
index 80f71eb..384024f 100644
--- a/source4/lib/cmdline/popt_credentials.c
+++ b/source4/lib/cmdline/popt_credentials.c
@@ -103,15 +103,6 @@ static void popt_common_credentials_callback(poptContext con,
 		bool use_kerberos = true;
-		/* Force us to only use kerberos */
-		if (arg) {
-			if (!set_boolean(arg, &use_kerberos)) {
-				fprintf(stderr, "Error parsing -k %s\n", arg);
-				exit(1);
-				break;
-			}
-		}

More information about the samba-technical mailing list