* configure.in: add DO_SUBDIRS so make will descend into unit-test
authorBarry Jaspan <bjaspan@mit.edu>
Tue, 15 Oct 1996 21:05:10 +0000 (21:05 +0000)
committerBarry Jaspan <bjaspan@mit.edu>
Tue, 15 Oct 1996 21:05:10 +0000 (21:05 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9177 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/rpc/ChangeLog
src/lib/rpc/Makefile.in
src/lib/rpc/auth_gssapi.c
src/lib/rpc/configure.in
src/lib/rpc/svc_auth_gssapi.c

index 0b62729c48bfacd3862c0c42f7159b0d53858f00..7a7d812fc8a00922619f968763de5c5ab3aa8ebb 100644 (file)
@@ -1,3 +1,7 @@
+Tue Oct 15 17:04:09 1996  Barry Jaspan  <bjaspan@mit.edu>
+
+       * configure.in: add DO_SUBDIRS so make will descend into unit-test
+
 Wed Oct  9 14:15:34 1996  Tom Yu  <tlyu@mit.edu>
 
        * Makefile.in (all-unix): Force $(OBJS) to depend on includes,
index 2b75d1dbf52b2790d60478ec0a7dc427420b9447..5c4a32b3287cae37862b8bfa68eebfd85d7e830f 100644 (file)
@@ -1,4 +1,4 @@
-CFLAGS = $(CCOPTS) $(DEFS) -DDEBUG_GSSAPI=0
+CFLAGS = $(CCOPTS) $(DEFS) -DGSSAPI_KRB5 -DDEBUG_GSSAPI=0
 
 ##DOSBUILDTOP = ..\..
 ##DOSLIBNAME=libgssrpc.lib
index 7d4e77aa7ff2207435692e4e92e931e7640f8b12..2263512cb7ff75cda5fe34b272face7d187832ca 100644 (file)
@@ -15,6 +15,9 @@ static char *rcsid = "$Header$";
 
 #include <gssapi/gssapi.h>
 #include <gssapi/gssapi_generic.h>
+#ifdef GSSAPI_KRB5
+#include <gssapi/gssapi_krb5.h>
+#endif
 
 #include <rpc/rpc.h>
 #include <rpc/auth_gssapi.h>
@@ -203,7 +206,7 @@ AUTH *auth_gssapi_create(clnt, gssstat, minor_stat,
      clnt->cl_auth = auth;
 
      /* start by trying latest version */
-     call_arg.version = 3;
+     call_arg.version = 4;
 
 try_new_version:
      /* set state for initial call to init_sec_context */
@@ -211,7 +214,21 @@ try_new_version:
      AUTH_PRIVATE(auth)->context = GSS_C_NO_CONTEXT;
      init_func = AUTH_GSSAPI_INIT;
 
-     if (call_arg.version == 3) {
+#ifdef GSSAPI_KRB5
+     /*
+      * OV servers up to version 3 used the old mech id.  Beta 7
+      * servers used version 3 with the new mech id; however, the beta
+      * 7 gss-api accept_sec_context accepts either mech id.  Thus, if
+      * any server rejects version 4, we fall back to version 3 with
+      * the old mech id; for the OV server it will be right, and for
+      * the beta 7 server it will be accepted.  Not ideal, but it
+      * works.
+      */
+     if (call_arg.version < 4 && mech_type == gss_mech_krb5)
+         mech_type = gss_mech_krb5_old;
+#endif
+
+     if (call_arg.version >= 3) {
          if (clnt_control(clnt, CLGET_LOCAL_ADDR, &laddr) == FALSE) {
               PRINTF(("gssapi_create: CLGET_LOCAL_ADDR failed"));
               goto cleanup;
index fede091041fc5072583e66bd10cee5ae3ca08f8e..c23c77f6836fd16fe12671fd5cf2b4a14aa90f79 100644 (file)
@@ -1,5 +1,7 @@
 AC_INIT(auth_gssapi.c)
 CONFIG_RULES
+CONFIG_DIRS(unit-test)
+DO_SUBDIRS
 AC_PROG_ARCHIVE
 AC_PROG_ARCHIVE_ADD
 AC_PROG_RANLIB
index b65996abc2fa18a196fb6e7258c0eddab775ac47..be277ec83d1ee543b3c16d3fdcce9eba98983934 100644 (file)
@@ -5,6 +5,9 @@
  * $Source$
  * 
  * $Log$
+ * Revision 1.40  1996/10/15 21:05:10  bjaspan
+ *     * configure.in: add DO_SUBDIRS so make will descend into unit-test
+ *
  * Revision 1.39  1996/08/14 00:01:48  tlyu
  *     * getrpcent.c: Add PROTOTYPE and conditionalize function
  *             prototypes.
@@ -198,9 +201,11 @@ static char *rcsid = "$Header$";
 #include <gssapi/gssapi_krb5.h>
 #endif
 
+#ifdef GSSAPI_KRB5
 /* This is here for the krb5_error_code typedef and the
    KRB5KRB_AP_WRONG_PRINC #define.*/
 #include <krb5.h>
+#endif
 
 #include <sys/file.h>
 #include <fcntl.h>
@@ -556,17 +561,20 @@ enum auth_stat _svcauth_gssapi(rqst, msg, no_dispatch)
                    client_data->server_creds = server_creds;
                    client_data->server_name = server_name_list[i];
                    break;
-              } else if (call_res.gss_major != GSS_S_FAILURE ||
+              } else if (call_res.gss_major != GSS_S_FAILURE
+#ifdef GSSAPI_KRB5
                          /*
-                          * XXX hard-coded because there is no other
-                          * way to prevent all GSS_S_FAILURES from
+                          * hard-coded because there is no other way
+                          * to prevent all GSS_S_FAILURES from
                           * returning a "wrong principal in request"
                           * error
                           */
-                         ((krb5_error_code) call_res.gss_minor !=
-                          (krb5_error_code) KRB5KRB_AP_WRONG_PRINC)) {
-                  break;
-                }
+                         || ((krb5_error_code) call_res.gss_minor !=
+                             (krb5_error_code) KRB5KRB_AP_WRONG_PRINC)
+#endif
+                         ) {
+                   break;
+              }
          }
          
          gssstat = call_res.gss_major;