Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mdelves:apache
apache2-mod_auth_kerb
0103-mod_auth_kerb-5.4-delegation.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0103-mod_auth_kerb-5.4-delegation.patch of Package apache2-mod_auth_kerb
https://bugzilla.redhat.com/show_bug.cgi?id=688210 diff -rupN mod_auth_kerb-5.4/src/mod_auth_kerb.c mod_auth_kerb-5.4-patched/src/mod_auth_kerb.c --- mod_auth_kerb-5.4/src/mod_auth_kerb.c 2015-05-11 14:09:16.792098102 +0200 +++ mod_auth_kerb-5.4-patched/src/mod_auth_kerb.c 2015-05-11 14:09:24.278173001 +0200 @@ -228,6 +228,7 @@ typedef struct krb5_conn_data { char *authline; char *user; char *mech; + char *ccname; int last_return; } krb5_conn_data; @@ -931,7 +932,7 @@ create_krb5_ccache(krb5_context kcontext int ret; krb5_ccache tmp_ccache = NULL; - ccname = apr_psprintf(r->pool, "FILE:%s/krb5cc_apache_XXXXXX", P_tmpdir); + ccname = apr_psprintf(r->connection->pool, "FILE:%s/krb5cc_apache_XXXXXX", P_tmpdir); fd = mkstemp(ccname + strlen("FILE:")); if (fd < 0) { log_rerror(APLOG_MARK, APLOG_ERR, 0, r, @@ -961,7 +962,7 @@ create_krb5_ccache(krb5_context kcontext } apr_table_setn(r->subprocess_env, "KRB5CCNAME", ccname); - apr_pool_cleanup_register(r->pool, ccname, krb5_cache_cleanup, + apr_pool_cleanup_register(r->connection->pool, ccname, krb5_cache_cleanup, apr_pool_cleanup_null); *ccache = tmp_ccache; @@ -1977,10 +1978,15 @@ already_succeeded(request_rec *r, char * if (apr_pool_userdata_get((void**)&conn_data, keyname, r->connection->pool) != 0) return NULL; - if(conn_data) { - if(strcmp(conn_data->authline, auth_line) == 0) { - log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "matched previous auth request"); - return conn_data; + if(conn_data && conn_data->ccname != NULL) { + apr_finfo_t finfo; + + if (apr_stat(&finfo, conn_data->ccname + strlen("FILE:"), + APR_FINFO_NORM, r->pool) == APR_SUCCESS + && (finfo.valid & APR_FINFO_TYPE) + && finfo.filetype == APR_REG) { + log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "matched previous auth request"); + return conn_data; } } return NULL; @@ -2112,6 +2118,8 @@ kerb_authenticate_user(request_rec *r) ret = prevauth->last_return; MK_USER = prevauth->user; MK_AUTH_TYPE = prevauth->mech; + if (prevauth->ccname) + apr_table_setn(r->subprocess_env, "KRB5CCNAME", prevauth->ccname); } /* @@ -2122,6 +2130,7 @@ kerb_authenticate_user(request_rec *r) prevauth->user = apr_pstrdup(r->connection->pool, MK_USER); prevauth->authline = apr_pstrdup(r->connection->pool, auth_line); prevauth->mech = apr_pstrdup(r->connection->pool, auth_type); + prevauth->ccname = apr_pstrdup(r->connection->pool, apr_table_get(r->subprocess_env, "KRB5CCNAME")); prevauth->last_return = ret; snprintf(keyname, sizeof(keyname) - 1, "mod_auth_kerb::connection::%s::%ld",
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor