Blob Blame History Raw
From 20ac4be6af9c3f5608063e96b5f1b4a04a9bc593 Mon Sep 17 00:00:00 2001
From: Simo Sorce <simo@redhat.com>
Date: Tue, 7 Jun 2016 09:57:26 -0400
Subject: [PATCH 2/2] Fix cred cache detection

The stat call was not using the full path name, therefore it was always
failing.

Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Jan Pazdziora <jpazdziora@redhat.com>
Close #91
---
 src/mod_auth_gssapi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mod_auth_gssapi.c b/src/mod_auth_gssapi.c
index 48eb76f982b1b0f053fe6d8de41dfdc5c3faf8b6..7e2e7a83481386e8c4ee25e40913b42390b1d81a 100644
--- a/src/mod_auth_gssapi.c
+++ b/src/mod_auth_gssapi.c
@@ -259,16 +259,19 @@ static void mag_set_KRB5CCNAME(request_rec *req, const char *dir,
 {
     apr_status_t status;
     apr_finfo_t finfo;
+    char *path;
     char *value;
 
-    status = apr_stat(&finfo, ccname, APR_FINFO_MIN, req->pool);
+    path = apr_psprintf(req->pool, "%s/%s", dir, ccname);
+
+    status = apr_stat(&finfo, path, APR_FINFO_MIN, req->pool);
     if (status != APR_SUCCESS && status != APR_INCOMPLETE) {
         /* set the file cache anyway, but warn */
         ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, req,
                       "KRB5CCNAME file (%s) lookup failed!", ccname);
     }
 
-    value = apr_psprintf(req->pool, "FILE:%s/%s", dir, ccname);
+    value = apr_psprintf(req->pool, "FILE:%s", path);
     apr_table_set(req->subprocess_env, "KRB5CCNAME", value);
 }
 
-- 
2.5.5