From 1c13573311e9547e31bc4b39ef613ac546871135 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Tue, 15 Oct 1996 21:05:10 +0000 Subject: [PATCH] * configure.in: add DO_SUBDIRS so make will descend into unit-test git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9177 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/rpc/ChangeLog | 4 ++++ src/lib/rpc/Makefile.in | 2 +- src/lib/rpc/auth_gssapi.c | 21 +++++++++++++++++++-- src/lib/rpc/configure.in | 2 ++ src/lib/rpc/svc_auth_gssapi.c | 22 +++++++++++++++------- 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 0b62729c4..7a7d812fc 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 15 17:04:09 1996 Barry Jaspan + + * configure.in: add DO_SUBDIRS so make will descend into unit-test + Wed Oct 9 14:15:34 1996 Tom Yu * Makefile.in (all-unix): Force $(OBJS) to depend on includes, diff --git a/src/lib/rpc/Makefile.in b/src/lib/rpc/Makefile.in index 2b75d1dbf..5c4a32b32 100644 --- a/src/lib/rpc/Makefile.in +++ b/src/lib/rpc/Makefile.in @@ -1,4 +1,4 @@ -CFLAGS = $(CCOPTS) $(DEFS) -DDEBUG_GSSAPI=0 +CFLAGS = $(CCOPTS) $(DEFS) -DGSSAPI_KRB5 -DDEBUG_GSSAPI=0 ##DOSBUILDTOP = ..\.. ##DOSLIBNAME=libgssrpc.lib diff --git a/src/lib/rpc/auth_gssapi.c b/src/lib/rpc/auth_gssapi.c index 7d4e77aa7..2263512cb 100644 --- a/src/lib/rpc/auth_gssapi.c +++ b/src/lib/rpc/auth_gssapi.c @@ -15,6 +15,9 @@ static char *rcsid = "$Header$"; #include #include +#ifdef GSSAPI_KRB5 +#include +#endif #include #include @@ -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; diff --git a/src/lib/rpc/configure.in b/src/lib/rpc/configure.in index fede09104..c23c77f68 100644 --- a/src/lib/rpc/configure.in +++ b/src/lib/rpc/configure.in @@ -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 diff --git a/src/lib/rpc/svc_auth_gssapi.c b/src/lib/rpc/svc_auth_gssapi.c index b65996abc..be277ec83 100644 --- a/src/lib/rpc/svc_auth_gssapi.c +++ b/src/lib/rpc/svc_auth_gssapi.c @@ -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 #endif +#ifdef GSSAPI_KRB5 /* This is here for the krb5_error_code typedef and the KRB5KRB_AP_WRONG_PRINC #define.*/ #include +#endif #include #include @@ -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; -- 2.26.2