Antti Andreimann <Antti.Andreimann@mail.ee> has done some changes to enable
[tprouty/samba.git] / source / torture / torture.c
index 56b8da768e53b529cfc022a9a55ce9df0f05561c..97e864de965d2a6a76deaee4fe76dba6ba332875 100644 (file)
@@ -4082,6 +4082,7 @@ static void usage(void)
 {
        int opt, i;
        char *p;
+       int gotuser = 0;
        int gotpass = 0;
        extern char *optarg;
        extern int optind;
@@ -4167,13 +4168,13 @@ static void usage(void)
                case 'k':
 #ifdef HAVE_KRB5
                        use_kerberos = True;
-                       gotpass = True;
 #else
                        d_printf("No kerberos support compiled in\n");
                        exit(1);
 #endif
                        break;
                case 'U':
+                       gotuser = 1;
                        fstrcpy(username,optarg);
                        p = strchr_m(username,'%');
                        if (p) {
@@ -4188,6 +4189,7 @@ static void usage(void)
                }
        }
 
+       if(use_kerberos && !gotuser) gotpass = True;
 
        while (!gotpass) {
                p = getpass("Password:");