Skip to content

Commit 6862859

Browse files
frozencemeterysimo5
authored andcommitted
Make requirement on gss_krb5_ccache_name() hard
This function has been in krb5 since 1999. Heimdal started using gssapi_krb5.h 2006, and this function predates that there too (2004). Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
1 parent fe50dfe commit 6862859

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ else
7878
fi
7979
AC_CHECK_LIB([gssapi_krb5], [gss_accept_sec_context], [],
8080
[AC_MSG_ERROR([GSSAPI library check failed])])
81+
AC_CHECK_FUNCS(gss_krb5_ccache_name, [],
82+
[AC_MSG_ERROR([gss_krb5_ccache_name() not found])])
8183
AC_CHECK_FUNCS(gss_acquire_cred_from)
8284
AC_CHECK_FUNCS(gss_store_cred_into)
8385
AC_CHECK_FUNCS(gss_acquire_cred_with_password)
84-
AC_CHECK_FUNCS(gss_krb5_ccache_name)
8586

8687
AC_SUBST([GSSAPI_CFLAGS])
8788
AC_SUBST([GSSAPI_LIBS])

src/mod_auth_gssapi.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,10 @@ static bool mag_auth_basic(request_rec *req,
489489
gss_cred_id_t *delegated_cred,
490490
uint32_t *vtime)
491491
{
492-
#ifdef HAVE_GSS_KRB5_CCACHE_NAME
493492
const char *user_ccache = NULL;
494493
const char *orig_ccache = NULL;
495494
long long unsigned int rndname;
496495
apr_status_t rs;
497-
#endif
498496
gss_name_t user = GSS_C_NO_NAME;
499497
gss_cred_id_t user_cred = GSS_C_NO_CREDENTIAL;
500498
gss_cred_id_t server_cred = GSS_C_NO_CREDENTIAL;
@@ -555,7 +553,6 @@ static bool mag_auth_basic(request_rec *req,
555553
allowed_mechs = filtered_mechs;
556554
}
557555

558-
#ifdef HAVE_GSS_KRB5_CCACHE_NAME
559556
/* If we are using the krb5 mechanism make sure to set a per thread
560557
* memory ccache so that there can't be interferences between threads.
561558
* Also make sure we have new cache so no cached results end up being
@@ -585,7 +582,6 @@ static bool mag_auth_basic(request_rec *req,
585582
goto done;
586583
}
587584
}
588-
#endif
589585

590586
maj = gss_acquire_cred_with_password(&min, user, &ba_pwd,
591587
GSS_C_INDEFINITE,
@@ -621,7 +617,7 @@ static bool mag_auth_basic(request_rec *req,
621617
gss_release_cred(&min, &user_cred);
622618
gss_release_oid_set(&min, &actual_mechs);
623619
gss_release_oid_set(&min, &filtered_mechs);
624-
#ifdef HAVE_GSS_KRB5_CCACHE_NAME
620+
625621
if (user_ccache != NULL) {
626622
maj = gss_krb5_ccache_name(&min, orig_ccache, NULL);
627623
if (maj != GSS_S_COMPLETE) {
@@ -631,7 +627,7 @@ static bool mag_auth_basic(request_rec *req,
631627
"failed", maj, min));
632628
}
633629
}
634-
#endif
630+
635631
return ret;
636632
}
637633

0 commit comments

Comments
 (0)