diff options
author | Stef Walter <stef@memberwebs.com> | 2006-06-19 16:30:37 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-06-19 16:30:37 +0000 |
commit | 0b7db8805d91eac81a4b526d3400a9d50bd5c7e1 (patch) | |
tree | 3fc79298cd9ac9b723d826418bfb2bfba2672c22 | |
parent | 40d910975e099c1a8174a9f2e44e0b7c0314954a (diff) |
Fix NTLM problems with apache 2x module.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | apache2x/mod_httpauth.c | 26 | ||||
-rw-r--r-- | configure.in | 4 |
3 files changed, 29 insertions, 4 deletions
@@ -1,3 +1,6 @@ +0.5.3 + - Guarantee unique connection identfier for NTLM when using apache2 + 0.5.2 - Better messages when keepalives are not used with NTLM - Fix problems in java servlet authenticator [Ross Elliot] diff --git a/apache2x/mod_httpauth.c b/apache2x/mod_httpauth.c index 9e8a95a..9d3854b 100644 --- a/apache2x/mod_httpauth.c +++ b/apache2x/mod_httpauth.c @@ -54,6 +54,12 @@ module AP_MODULE_DECLARE_DATA httpauth_module; +/* Keep track of a unique identifier */ +static void* conn_current = NULL; + +/* And increment this when it goes out of scope */ +static unsigned int conn_seen = 0; + typedef struct httpauth_context { const char* socketname; @@ -614,6 +620,14 @@ finally: return ret; } +/* Make sure our connection identifier is unique */ +static apr_status_t connection_gone (void *data) +{ + conn_current = NULL; + conn_seen++; + return APR_SUCCESS; +} + int write_request(httpauth_context_t* ctx, request_rec* r) { char pidid[40]; @@ -623,9 +637,17 @@ int write_request(httpauth_context_t* ctx, request_rec* r) const apr_array_header_t* hdrs_arr; const apr_table_entry_t* elts; + /* When the connection goes away, call our handler */ + if(conn_current != r->connection) + { + conn_current = r->connection; + apr_pool_cleanup_register(r->connection->pool, r, + connection_gone, apr_pool_cleanup_null); + } + /* A unique per connection id */ - snprintf(connid, sizeof(connid), "0x%X-%X", - (unsigned int)r->connection, (unsigned int)r->connection->id); + snprintf(connid, sizeof(connid), "0x%X-%X-%X", + (unsigned int)r->connection, conn_seen, (unsigned int)r->connection->id); connid[sizeof(connid) - 1] = 0; snprintf(pidid, sizeof(pidid), "%d", (unsigned int)getpid()); pidid[sizeof(pidid) - 1] = 0; diff --git a/configure.in b/configure.in index c3fa502..784e34c 100644 --- a/configure.in +++ b/configure.in @@ -36,8 +36,8 @@ dnl Nate Nielsen <nielsen@memberwebs.com> dnl dnl Process this file with autoconf to produce a configure script. -AC_INIT(httpauth, 0.5.2, nielsen@memberwebs.com) -AM_INIT_AUTOMAKE(httpauth, 0.5.2) +AC_INIT(httpauth, 0.5.2.90, nielsen@memberwebs.com) +AM_INIT_AUTOMAKE(httpauth, 0.5.2.90) LDFLAGS="$LDFLAGS -L/usr/local/lib" CFLAGS="$CFLAGS -I/usr/local/include -g -O0" |