Skip to content

Commit 798ab2c

Browse files
committed
Fix GssapiCredStore usage
This allows to always define the keytab in terms of GssapiCredStore options instead of having to set a KRB5_KTNAME variable. Fixes Issue 2
1 parent 49002c0 commit 798ab2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mod_auth_gssapi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static int mag_auth(request_rec *req)
166166
gss_name_t client = GSS_C_NO_NAME;
167167
gss_cred_id_t acquired_cred = GSS_C_NO_CREDENTIAL;
168168
gss_cred_id_t delegated_cred = GSS_C_NO_CREDENTIAL;
169+
gss_cred_usage_t cred_usage = GSS_C_ACCEPT;
169170
uint32_t flags;
170171
uint32_t vtime;
171172
uint32_t maj, min;
@@ -247,8 +248,11 @@ static int mag_auth(request_rec *req)
247248

248249
#ifdef HAVE_GSS_ACQUIRE_CRED_FROM
249250
if (cfg->use_s4u2proxy) {
251+
cred_usage = GSS_C_BOTH;
252+
}
253+
if (cfg->cred_store) {
250254
maj = gss_acquire_cred_from(&min, GSS_C_NO_NAME, 0,
251-
GSS_C_NO_OID_SET, GSS_C_BOTH,
255+
GSS_C_NO_OID_SET, cred_usage,
252256
cfg->cred_store, &acquired_cred,
253257
NULL, NULL);
254258
if (GSS_ERROR(maj)) {

0 commit comments

Comments
 (0)