(main): redo the v4/v5 selection for consistency.
-4 -> try only v4 -5 -> try only v5 none, -45 -> try v5, v4 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7297 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
20
appl/kx/kx.c
20
appl/kx/kx.c
@@ -618,13 +618,13 @@ doit_v5 (const char *host, int port, const char *user,
|
||||
*/
|
||||
|
||||
#ifdef KRB4
|
||||
static int use_v4 = 0;
|
||||
static int use_v4 = -1;
|
||||
#ifdef HAVE_KRB_ENABLE_DEBUG
|
||||
static int krb_debug_flag = 0;
|
||||
#endif /* HAVE_KRB_ENABLE_DEBUG */
|
||||
#endif /* KRB4 */
|
||||
#ifdef KRB5
|
||||
static int use_v5 = 0;
|
||||
static int use_v5 = -1;
|
||||
#endif
|
||||
static char *port_str = NULL;
|
||||
static const char *user = NULL;
|
||||
@@ -736,16 +736,12 @@ main(int argc, char **argv)
|
||||
krb_enable_debug ();
|
||||
#endif
|
||||
|
||||
#if defined(KRB5)
|
||||
#if defined(KRB4)
|
||||
if (use_v4 == 0 && use_v5 == 0)
|
||||
use_v5 = 1;
|
||||
#else
|
||||
use_v5 = 1;
|
||||
#endif /* KRB4 */
|
||||
#elif defined(KRB4)
|
||||
use_v4 = 1;
|
||||
#endif
|
||||
#if defined(KRB4) && defined(KRB5)
|
||||
if(use_v4 == -1 && use_v5 == 1)
|
||||
use_v4 = 0;
|
||||
if(use_v5 == -1 && use_v4 == 1)
|
||||
use_v5 = 0;
|
||||
#endif
|
||||
|
||||
#ifdef KRB5
|
||||
if (ret && use_v5) {
|
||||
|
@@ -191,9 +191,9 @@ doit_v5 (char *host, int port)
|
||||
|
||||
|
||||
#ifdef KRB4
|
||||
static int use_v4 = 0;
|
||||
static int use_v4 = -1;
|
||||
#endif
|
||||
static int use_v5 = 1;
|
||||
static int use_v5 = -1;
|
||||
static char *port_str;
|
||||
static int do_version;
|
||||
static int do_help;
|
||||
@@ -265,6 +265,13 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(KRB4) && defined(KRB5)
|
||||
if(use_v4 == -1 && use_v5 == 1)
|
||||
use_v4 = 0;
|
||||
if(use_v5 == -1 && use_v4 == 1)
|
||||
use_v5 = 0;
|
||||
#endif
|
||||
|
||||
#ifdef KRB5
|
||||
if (ret && use_v5) {
|
||||
ret = doit_v5 (argv[0], port);
|
||||
|
@@ -713,15 +713,11 @@ main(int argc, char **argv)
|
||||
argv += optind;
|
||||
|
||||
#if defined(KRB4) && defined(KRB5)
|
||||
if(use_v4 == -1 && use_v5 == -1)
|
||||
use_v4 = use_v5 = 1;
|
||||
#elif defined(KRB4)
|
||||
if (use_v4 == -1)
|
||||
use_v4 = 1;
|
||||
#elif defined(KRB5)
|
||||
if (use_v5 == -1)
|
||||
use_v5 = 1;
|
||||
#endif
|
||||
if(use_v4 == -1 && use_v5 == 1)
|
||||
use_v4 = 0;
|
||||
if(use_v5 == -1 && use_v4 == 1)
|
||||
use_v5 = 0;
|
||||
#endif
|
||||
|
||||
if (do_help)
|
||||
usage (0);
|
||||
|
@@ -711,9 +711,9 @@ doit (const char *hostname,
|
||||
}
|
||||
|
||||
#ifdef KRB4
|
||||
static int use_v4 = 0;
|
||||
static int use_v4 = -1;
|
||||
#endif
|
||||
static int use_v5 = 0;
|
||||
static int use_v5 = -1;
|
||||
static int use_only_broken = 0;
|
||||
static int use_broken = 1;
|
||||
static char *port_str;
|
||||
@@ -825,11 +825,12 @@ main(int argc, char **argv)
|
||||
if (do_forwardable)
|
||||
do_forward = 1;
|
||||
|
||||
/* default to v5 */
|
||||
#ifdef KRB4
|
||||
if(use_v4 == 0 && use_v5 == 0)
|
||||
#endif
|
||||
use_v5 = 1;
|
||||
#if defined(KRB4) && defined(KRB5)
|
||||
if(use_v4 == -1 && use_v5 == 1)
|
||||
use_v4 = 0;
|
||||
if(use_v5 == -1 && use_v4 == 1)
|
||||
use_v5 = 0;
|
||||
#endif
|
||||
|
||||
if (use_only_broken) {
|
||||
#ifdef KRB4
|
||||
|
Reference in New Issue
Block a user