From c4866d1a1b224db86cb4a2c44d34c27912d423df Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 10 May 2006 18:03:11 +0000 Subject: Support NTLM properly in apache1x plugin --- apache1x/mod_httpauth.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apache1x/mod_httpauth.c b/apache1x/mod_httpauth.c index b399c5d..4443c81 100644 --- a/apache1x/mod_httpauth.c +++ b/apache1x/mod_httpauth.c @@ -611,18 +611,22 @@ finally: int write_request(httpauth_context_t* ctx, request_rec* r) { + char pidid[40]; + char connid[40]; int i, c = 0; const char* t; const array_header* hdrs_arr; const table_entry* elts; - /* - * TODO: We need to use a valid connection id for - * NTLM connections to work properly. - */ + /* A unique per connection id */ + snprintf(connid, sizeof(connid), "0x%X", (unsigned int)r->connection); + connid[sizeof(connid) - 1] = 0; + snprintf(pidid, sizeof(pidid), "%d", (unsigned int)getpid()); + pidid[sizeof(pidid) - 1] = 0; + t = ap_pstrcat(r->pool, pidid, ":", connid, NULL); /* Send the request header to httpauthd */ - t = ap_pstrcat(r->pool, "AUTH XXX ", r->method, + t = ap_pstrcat(r->pool, "AUTH ", t, " ", r->method, " ", r->unparsed_uri, "\n", NULL); if(write_data(ctx, r->server, t) == -1) -- cgit v1.2.3