diff options
author | Stef Walter <stef@memberwebs.com> | 2006-05-10 18:03:11 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2006-05-10 18:03:11 +0000 |
commit | c4866d1a1b224db86cb4a2c44d34c27912d423df (patch) | |
tree | 752e2016c3071e3df8beb8d5480b6913c9b939c5 | |
parent | 17753b2c45290ed5d9c3f7b3106de73db6fe171e (diff) |
Support NTLM properly in apache1x plugin
-rw-r--r-- | apache1x/mod_httpauth.c | 14 |
1 files 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) |