format strings in deny_info?

From: Gerard Eviston <geviston@dont-contact.us>
Date: Sun, 1 Jun 2003 22:29:08 +1000

Hi all,

deny_info allows format strings in urls when redirection is happening. This
might be a silly question, but is this intended?

In HEAD -> errorpage.cc -> errorBuildReply() :

    const char *name = errorPageName(err->page_id);
...
    if (strchr(name, ':')) {
        /* Redirection */
        char *quoted_url = rfc1738_escape_part(errorConvert('u', err));
        httpReplySetHeaders(rep, version, HTTP_MOVED_TEMPORARILY, NULL,
"text/html", 0, 0, squid_curtime);
        httpHeaderPutStrf(&rep->header, HDR_LOCATION, name, quoted_url);
        httpHeaderPutStrf(&rep->header, HDR_X_SQUID_ERROR, "%d %s\n",
err->httpStatus, "Access Denied");
    } else {

Where "name" may include %'s. Actually this might handy for logging, eg
deny_info http://myserver/log.cgi?%s sex_domains
but this feature looks to be accidental. Or maybe I'm missing something?

Cheers
Gerard
Received on Sun Jun 01 2003 - 06:24:15 MDT

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