Re: Allowing a redirector to view proxy based auth username

From: Joshua Reich <joshr@dont-contact.us>
Date: Thu, 07 Oct 1999 14:30:15 +1000

In reply to my own question, i did a very minor modification to the
src/redirect.c file to acheive the results i desire... am i reinventing
the wheel? is there a better way of doing it ?

begin excerpt from src/redirect.c :

redirectStart(clientHttpRequest * http, RH * handler, void *data)
{
    ConnStateData *conn = http->conn;
    redirectStateData *r = NULL;
    const char *fqdn;
    char buf[8192];
    assert(http);
    assert(handler);
    debug(29, 5) ("redirectStart: '%s'\n", http->uri);
    if (Config.Program.redirect == NULL) {
        handler(data, NULL);
        return;
    }
    r = xcalloc(1, sizeof(redirectStateData));
    cbdataAdd(r, cbdataXfree, 0);
    r->orig_url = xstrdup(http->uri);
    r->client_addr = conn->log_addr;
    if (conn->ident == NULL || *conn->ident == '\0') {
        r->client_ident = dash_str;
    } else {
        r->client_ident = conn->ident;
    }

    /**** MODIFIED BY JOSHUA REICH joshr@netspace.net.au - 6/10/1999
****/
    if (http->request->user_ident)
    {
       r->client_ident = http->request->user_ident;
    }
    /****** END MODIFICATION *******/

    r->method_s = RequestMethodStr[http->request->method];
    r->handler = handler;
    r->data = data;
    cbdataLock(r->data);
    if ((fqdn = fqdncache_gethostbyaddr(r->client_addr, 0)) == NULL)
        fqdn = dash_str;
    snprintf(buf, 8192, "%s %s/%s %s %s %d\n",
        r->orig_url,
        inet_ntoa(r->client_addr),
        fqdn,
        r->client_ident,
        r->method_s,
        http->request->port);
    printf ("[%s]\n", buf);
    helperSubmit(redirectors, buf, redirectHandleReply, r);
}

Joshua Reich wrote:
>
> Hi.
>
> Ive just written a redirector program and i was wondering if it was
> possible (without hacking squid) to get it to replace the ident field
> that squid passes to my redirector with the username that successfully
> authorizes with squid. Basically im trying to implement a redirector
> that can be used on machines that arent running ident, with the user
> authentication superceeding the ident information (if available)
>
> Thanks
>
> Joshua Reich
> Netspace Online Systems.
Received on Wed Oct 06 1999 - 22:41:01 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:48:45 MST