From b3b115bcde2550d2b3f84ae4e1cd7872da829fd3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 7 Jun 2016 09:57:26 -0400 Subject: Fix cred cache detection The stat call was not using the full path name, therefore it was always failing. Signed-off-by: Simo Sorce Reviewed-by: Jan Pazdziora Close #91 --- src/environ.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/environ.c b/src/environ.c index c0be4f8..8fefb8e 100644 --- a/src/environ.c +++ b/src/environ.c @@ -248,16 +248,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); + "KRB5CCNAME file (%s) lookup failed!", path); } - 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); } -- cgit