Revert "TODO tests s3:popt_common: implement -k [yes|no] as alternative to just -k"
authorStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2019 11:13:07 +0000 (12:13 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Oct 2019 13:33:03 +0000 (14:33 +0100)
This reverts commit aaaf214b72f2333db05cde97117f19e9941c31c6.

source3/lib/popt_common_cmdline.c

index 438866302064505072534e4db25834b751c58d1d..39a787510a32e8155d786bcc34abf85f5a2a5e5a 100644 (file)
@@ -24,7 +24,7 @@
 /* Handle command line options:
  *             -U,--user
  *             -A,--authentication-file
- *             -k,--kerberos[=yes|no]
+ *             -k,--use-kerberos
  *             -N,--no-pass
  *             -S,--signing
  *             -P --machine-pass
@@ -90,8 +90,6 @@ static void popt_common_credentials_callback(poptContext con,
                                        const struct poptOption *opt,
                                        const char *arg, const void *data)
 {
-       bool use_kerberos = false;
-
        if (reason == POPT_CALLBACK_REASON_PRE) {
                struct user_auth_info *auth_info =
                                user_auth_info_init(NULL);
@@ -139,25 +137,12 @@ static void popt_common_credentials_callback(poptContext con,
                break;
 
        case 'k':
-               /* Force us to only use kerberos */
-               if (arg) {
-                       if (!set_boolean(arg, &use_kerberos)) {
-                               fprintf(stderr, "Error parsing -k %s. Should be "
-                                       "-k [yes|no]\n", arg);
-                               exit(1);
-                               break;
-                       }
-               }
-
-               if (use_kerberos) {
 #ifndef HAVE_KRB5
-                       d_printf("No kerberos support compiled in\n");
-                       exit(1);
+               d_printf("No kerberos support compiled in\n");
+               exit(1);
+#else
+               set_cmdline_auth_info_use_krb5_ticket(cmdline_auth_info);
 #endif
-                       set_cmdline_auth_info_use_krb5_ticket(cmdline_auth_info);
-               } else {
-                       set_cmdline_auth_info_use_kerberos(cmdline_auth_info, false);
-               }
                break;
 
        case 'S':
@@ -257,7 +242,7 @@ struct poptOption popt_common_credentials[] = {
                .shortName  = 'k',
                .argInfo    = POPT_ARG_NONE,
                .val        = 'k',
-               .descrip    = "Use kerberos (active directory) authentication, -k [yes|no]",
+               .descrip    = "Use kerberos (active directory) authentication",
        },
        {
                .longName   = "authentication-file",