From 6be962e7460b1ef3cf1ef1ae5dc2e52ce0fbc45d Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 14 Jan 1994 20:42:26 +0000 Subject: [PATCH] Don't use V4 Kerberos routines unless compiled with V4 compatibility mode git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@3344 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/krlogind.c | 12 +++++++++++- src/appl/bsd/krshd.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index fdd3a31da..bd49f7feb 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -107,7 +107,9 @@ static char sccsid[] = "@(#)rlogind.c 5.17 (Berkeley) 8/31/88"; */ #define LOG_REMOTE_REALM #define CRYPT +#ifdef KRB5_KRB4_COMPAT #define SERVE_V4 +#endif #include #include @@ -1061,8 +1063,14 @@ do_krb_login(host) /* OK we have authenticated this user - now check authorization. */ /* The Kerberos authenticated programs must use krb5_kuserok or kuserok*/ +#ifdef SERVE_V4 + if (auth_sys == KRB5_RECVAUTH_V4) { + fatal(netf, "This server does not support Kerberos V4"); + } +#endif + if (must_pass_k5 || must_pass_one) { -#ifdef ALWAYS_V5_KUSEROK +#if (defined(ALWAYS_V5_KUSEROK) || !defined(SERVE_V4)) /* krb5_kuserok returns 1 if OK */ if (client && krb5_kuserok(client, lusername)) passed_krb++; @@ -1458,6 +1466,7 @@ recvauth() getstr(netf, lusername, sizeof (lusername), "locuser"); getstr(netf, term, sizeof(term), "Terminal type"); +#ifdef SERVE_V4 if (auth_sys == KRB5_RECVAUTH_V4) { des_read = v4_des_read; @@ -1478,6 +1487,7 @@ recvauth() return(status); return 0; } +#endif /* Must be V5 */ diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index 6e4cf677c..c98c92129 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -870,7 +870,7 @@ doit(f, fromp) #ifdef KERBEROS if (must_pass_k5 || must_pass_one) { -#ifdef ALWAYS_V5_KUSEROK +#if (defined(ALWAYS_V5_KUSEROK) || !defined(KRB5_KRB4_COMPAT)) if (!krb5_kuserok(client,locuser)) { syslog(LOG_ERR , "Principal %s (%s@%s) for local user %s failed krb5_kuserok.\n", -- 2.26.2