* compat_recv.c: Only include krb.h if KRB5_KRB4_COMPAT.
authorKen Raeburn <raeburn@mit.edu>
Wed, 5 Mar 2003 01:20:50 +0000 (01:20 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 5 Mar 2003 01:20:50 +0000 (01:20 +0000)
(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

src/appl/bsd/ChangeLog
src/appl/bsd/compat_recv.c
src/appl/bsd/krlogind.c

index 0f495d62cde4bc80a10501f9a873b71c1733bd7c..30340017095b1ea71952c57f288a9c8e5cb570fc 100644 (file)
@@ -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.
index 29fc2fb7d0a486a5cda1d9cc8d45db691499e5a4..b5f9c60b072537607ac6666a3e17f51acb4740f4 100644 (file)
@@ -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
index 7c8365972fad3d7497d03de055f5567786ff457d..82e560143dd43fa81b63c8bb38e321713ca5d0ad 100644 (file)
@@ -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