summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2003-03-05 01:20:50 +0000
committerKen Raeburn <raeburn@mit.edu>2003-03-05 01:20:50 +0000
commit7f97fa877497ac21fba4bedc18735c7227c7b169 (patch)
treea95fb57424bf5a5a442e684b7ba4ce88887196b1 /src
parentba89d20ec8c2f8a414f3162f1a46ceb30c7f70ff (diff)
downloadkrb5-7f97fa877497ac21fba4bedc18735c7227c7b169.tar.gz
krb5-7f97fa877497ac21fba4bedc18735c7227c7b169.tar.xz
krb5-7f97fa877497ac21fba4bedc18735c7227c7b169.zip
* compat_recv.c: Only include krb.h if KRB5_KRB4_COMPAT.
(krb_v4_recvauth, krb5_compat_recvauth, krb5_compat_recvauth_version): Define only if KRB5_KRB4_COMPAT. * krlogind.c: Include krb.h only if KRB5_KRB4_COMPAT. (v4_kdata, v4_schedule): Define only if KRB5_KRB4_COMPAT. (recvauth) [!KRB5_KRB4_COMPAT]: Skip v4 stuff and call krb5_recvauth_version. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15223 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/appl/bsd/ChangeLog10
-rw-r--r--src/appl/bsd/compat_recv.c6
-rw-r--r--src/appl/bsd/krlogind.c19
3 files changed, 33 insertions, 2 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog
index 0f495d62cd..3034001709 100644
--- a/src/appl/bsd/ChangeLog
+++ b/src/appl/bsd/ChangeLog
@@ -1,3 +1,13 @@
+2003-03-04 Ken Raeburn <raeburn@mit.edu>
+
+ * compat_recv.c: Only include krb.h if KRB5_KRB4_COMPAT.
+ (krb_v4_recvauth, krb5_compat_recvauth,
+ krb5_compat_recvauth_version): Define only if KRB5_KRB4_COMPAT.
+ * krlogind.c: Include krb.h only if KRB5_KRB4_COMPAT.
+ (v4_kdata, v4_schedule): Define only if KRB5_KRB4_COMPAT.
+ (recvauth) [!KRB5_KRB4_COMPAT]: Skip v4 stuff and call
+ krb5_recvauth_version.
+
2003-03-03 Tom Yu <tlyu@mit.edu>
* Makefile.in (DEFINES): Add -DKERBEROS.
diff --git a/src/appl/bsd/compat_recv.c b/src/appl/bsd/compat_recv.c
index 29fc2fb7d0..b5f9c60b07 100644
--- a/src/appl/bsd/compat_recv.c
+++ b/src/appl/bsd/compat_recv.c
@@ -39,7 +39,9 @@
#define NEED_SOCKETS
#include "k5-int.h"
#if !defined(_MACINTOSH)
+#ifdef KRB5_KRB4_COMPAT
#include <kerberosIV/krb.h>
+#endif
#include "com_err.h"
#include <errno.h>
@@ -48,6 +50,7 @@
#include "defines.h"
+#ifdef KRB5_KRB4_COMPAT
static int krb_v4_recvauth(long options, int fd, KTEXT ticket,
char *service, char *instance,
struct sockaddr_in *faddr,
@@ -56,6 +59,7 @@ static int krb_v4_recvauth(long options, int fd, KTEXT ticket,
char *filename,
Key_schedule schedule,
char *version);
+#endif
#define KRB_V4_SENDAUTH_VERS "AUTHV0.1" /* MUST be 8 chars long */
#define KRB_V5_SENDAUTH_VERS "KRB5_SENDAUTH_V1.0"
@@ -63,6 +67,7 @@ static int krb_v4_recvauth(long options, int fd, KTEXT ticket,
#define KRB5_RECVAUTH_V4 4
#define KRB5_RECVAUTH_V5 5
+#ifdef KRB5_KRB4_COMPAT
krb5_error_code
krb5_compat_recvauth(context, auth_context,
/* IN */
@@ -347,6 +352,7 @@ krb5_compat_recvauth_version(context, auth_context,
return retval;
}
+#endif /* KRB5_KRB4_COMPAT */
#ifndef max
diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c
index 7c8365972f..82e560143d 100644
--- a/src/appl/bsd/krlogind.c
+++ b/src/appl/bsd/krlogind.c
@@ -234,7 +234,9 @@ struct winsize {
#ifdef KERBEROS
#include <krb5.h>
+#ifdef KRB5_KRB4_COMPAT
#include <kerberosIV/krb.h>
+#endif
#include <libpty.h>
#ifdef HAVE_UTMP_H
#include <utmp.h>
@@ -249,8 +251,10 @@ int auth_sys = 0; /* Which version of Kerberos used to authenticate */
int non_privileged = 0; /* set when connection is seen to be from */
/* a non-privileged port */
+#ifdef KRB5_KRB4_COMPAT
AUTH_DAT *v4_kdata;
Key_schedule v4_schedule;
+#endif
#include "com_err.h"
#include "defines.h"
@@ -1357,7 +1361,9 @@ recvauth(valid_checksum)
struct sockaddr_storage peersin, laddr;
socklen_t len;
krb5_data inbuf;
+#ifdef KRB5_KRB4_COMPAT
char v4_instance[INST_SZ]; /* V4 Instance */
+#endif
krb5_data version;
krb5_authenticator *authenticator;
krb5_rcache rcache;
@@ -1376,7 +1382,9 @@ recvauth(valid_checksum)
exit(1);
}
+#ifdef KRB5_KRB4_COMPAT
strcpy(v4_instance, "*");
+#endif
if ((status = krb5_auth_con_init(bsd_context, &auth_context)))
return status;
@@ -1406,7 +1414,8 @@ recvauth(valid_checksum)
if (status) return status;
}
- if ((status = krb5_compat_recvauth_version(bsd_context, &auth_context,
+#ifdef KRB5_KRB4_COMPAT
+ status = krb5_compat_recvauth_version(bsd_context, &auth_context,
&netf,
NULL, /* Specify daemon principal */
0, /* no flags */
@@ -1422,7 +1431,13 @@ recvauth(valid_checksum)
&ticket, /* return ticket */
&auth_sys, /* which authentication system*/
&v4_kdata, v4_schedule,
- &version))) {
+ &version);
+#else
+ auth_sys = KRB5_RECVAUTH_V5;
+ status = krb5_recvauth_version(bsd_context, &auth_context, &netf,
+ NULL, 0, keytab, &ticket, &version);
+#endif
+ if (status) {
if (auth_sys == KRB5_RECVAUTH_V5) {
/*
* clean up before exiting