+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.
#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>
#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,
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"
#define KRB5_RECVAUTH_V4 4
#define KRB5_RECVAUTH_V5 5
+#ifdef KRB5_KRB4_COMPAT
krb5_error_code
krb5_compat_recvauth(context, auth_context,
/* IN */
return retval;
}
+#endif /* KRB5_KRB4_COMPAT */
#ifndef max
#ifdef KERBEROS
#include <krb5.h>
+#ifdef KRB5_KRB4_COMPAT
#include <kerberosIV/krb.h>
+#endif
#include <libpty.h>
#ifdef HAVE_UTMP_H
#include <utmp.h>
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"
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;
exit(1);
}
+#ifdef KRB5_KRB4_COMPAT
strcpy(v4_instance, "*");
+#endif
if ((status = krb5_auth_con_init(bsd_context, &auth_context)))
return status;
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 */
&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