-
- s = strsav(s,
- "</pre>\n"
- "<br>\n"
- "<p><a href=\"show-proxy-args\">Back to proxy status</a></p>\n"
- "<br>\n"
- "<small><small><p>\n"
- "The " BANNER " Proxy - \n"
- "<a href=\"" HOME_PAGE_URL "\">" HOME_PAGE_URL "</a>\n"
- "</small></small>"
- "</body></html>\n");
- return(s);
- }
-#endif /* def SPLIT_PROXY_ARGS */
-
- s = strsav(s, proxy_args->header);
- s = strsav(s, proxy_args->invocation);
-#ifdef STATISTICS
- s = add_stats(s);
-#endif /* def STATISTICS */
- s = strsav(s, proxy_args->gateways);
-
-#ifdef SPLIT_PROXY_ARGS
- s = strsav(s,
- "<h2>The following files are in use:</h2>\n"
- "<p>(Click a filename to view it)</p>\n"
- "<ul>\n");
-
- if (csp->blist)
- {
- s = strsav(s, "<li>Block List: <a href=\"show-proxy-args?block\"><code>");
- s = strsav(s, csp->blist->filename);
- s = strsav(s, "</code></a></li>\n");
- }
-
- if (csp->permissions_list)
- {
- s = strsav(s, "<li>Permissions List: <a href=\"show-proxy-args?permit\"><code>");
- s = strsav(s, csp->permissions_list->filename);
- s = strsav(s, "</code></a></li>\n");
- }
-
- if (csp->flist)
- {
- s = strsav(s, "<li>Forward List: <a href=\"show-proxy-args?forward\"><code>");
- s = strsav(s, csp->flist->filename);
- s = strsav(s, "</code></a></li>\n");
- }
-
-#ifdef ACL_FILES
- if (csp->alist)
- {
- s = strsav(s, "<li>Access Control List: <a href=\"show-proxy-args?acl\"><code>");
- s = strsav(s, csp->alist->filename);
- s = strsav(s, "</code></a></li>\n");
- }
-#endif /* def ACL_FILES */
-
-#ifdef USE_IMAGE_LIST
- if (csp->ilist)
- {
- s = strsav(s, "<li>Image List: <a href=\"show-proxy-args?image\"><code>");
- s = strsav(s, csp->ilist->filename);
- s = strsav(s, "</code></a></li>\n");
- }
-#endif /* def USE_IMAGE_LIST */
-
-#ifdef PCRS
- if (csp->rlist)
- {
- s = strsav(s, "<li>RE Filter List: <a href=\"show-proxy-args?re\"><code>");
- s = strsav(s, csp->rlist->filename);
- s = strsav(s, "</code></a></li>\n");
- }
-#endif /* def PCRS */
-
-#ifdef TRUST_FILES
- if (csp->tlist)
- {
- s = strsav(s, "<li>Trust List: <a href=\"show-proxy-args?trust\"><code>");
- s = strsav(s, csp->tlist->filename);
- s = strsav(s, "</code></a></li>\n");
- }
-#endif /* def TRUST_FILES */
-
- s = strsav(s, "</ul>");
-
-#else /* ifndef SPLIT_PROXY_ARGS */
- if (csp->blist)
- {
- s = strsav(s, csp->blist->proxy_args);
- }
-
- if (csp->clist)
- {
- s = strsav(s, csp->clist->proxy_args);
- }
-
- if (csp->flist)
- {
- s = strsav(s, csp->flist->proxy_args);
- }
-
-#ifdef ACL_FILES
- if (csp->alist)
- {
- s = strsav(s, csp->alist->proxy_args);
- }
-#endif /* def ACL_FILES */
-
-#ifdef USE_IMAGE_LIST
- if (csp->ilist)
- {
- s = strsav(s, csp->ilist->proxy_args);
- }
-#endif /* def USE_IMAGE_LIST */
-
-#ifdef PCRS
- if (csp->rlist)
- {
- s = strsav(s, csp->rlist->proxy_args);
- }
-#endif /* def PCRS */
-
-#ifdef TRUST_FILES
- if (csp->tlist)
- {
- s = strsav(s, csp->tlist->proxy_args);
- }
-#endif /* def TRUST_FILES */
-
-#endif /* ndef SPLIT_PROXY_ARGS */
-
- s = strsav(s, proxy_args->trailer);
-
- return(s);
-
-}
-
-
-/*********************************************************************
- *
- * Function : ijb_send_banner
- *
- * Description : This "crunch"es "http:/any.thing/ijb-send-banner and
- * thus triggers sending the image in jcc.c:chat.
- * For the unlikely case, that the imagefile/MSIE
- * mechanism is not used, or tinygif = 0, a page
- * describing the reson of the interception is generated.
- *
- * Parameters :
- * 1 : http = http_request request for crunched URL
- * 2 : csp = Current client state (buffers, headers, etc...)
- *
- * Returns : A string that contains why this was intercepted.
- *
- *********************************************************************/
-char *ijb_send_banner(struct http_request *http, struct client_state *csp)
-{
- return(strdup(CNOBANNER));
-}
-
-#ifdef TRUST_FILES
-/*********************************************************************
- *
- * Function : ij_untrusted_url
- *
- * Description : This "crunch"es "http:/any.thing/ij-untrusted-url" and
- * returns a web page describing why it was untrusted.
- *
- * Parameters :
- * 1 : http = http_request request for crunched URL
- * 2 : csp = Current client state (buffers, headers, etc...)
- *
- * Returns : A string that contains why this was untrusted.
- *
- *********************************************************************/
-char *ij_untrusted_url(struct http_request *http, struct client_state *csp)
-{
- int n;
- char *hostport, *path, *refer, *p, *v[9];
- char buf[BUFSIZ];
- struct url_spec **tl, *t;
-
-
- static const char format[] =
- "HTTP/1.0 200 OK\r\n"
- "Pragma: no-cache\n"
- "Last-Modified: Thu Jul 31, 1997 07:42:22 pm GMT\n"
- "Expires: Thu Jul 31, 1997 07:42:22 pm GMT\n"
- "Content-Type: text/html\n\n"
- "<html>\n"
- "<head>\n"
- "<title>Internet Junkbuster: Request for untrusted URL</title>\n"
- "</head>\n"
- BODY
- "<center><h1>"
- BANNER
- "</h1></center>"
- "The " BANNER " Proxy "
- "<A href=\"" HOME_PAGE_URL "\">"
- "(" HOME_PAGE_URL ") </A>"
- "intercepted the request for %s%s\n"
- "because the URL is not trusted.\n"
- "<br><br>\n";
-
- if ((n = ssplit(http->path, "?+", v, SZ(v), 0, 0)) == 4)
- {
- hostport = url_decode(v[1]);
- path = url_decode(v[2]);
- refer = url_decode(v[3]);
- }
- else
- {
- hostport = strdup("undefined_host");
- path = strdup("/undefined_path");
- refer = strdup("undefined");
- }
-
- n = sizeof(format);
- n += strlen(hostport);
- n += strlen(path );
-
- if ((p = (char *)malloc(n)))
- {
- sprintf(p, format, hostport, path);
- }
-
- strsav(p, "The referrer in this request was <strong>");
- strsav(p, refer);
- strsav(p, "</strong><br>\n");
-
- freez(hostport);
- freez(path );
- freez(refer );
-
- p = strsav(p, "<h3>The following referrers are trusted</h3>\n");
-
- for (tl = trust_list; (t = *tl) ; tl++)
- {
- sprintf(buf, "%s<br>\n", t->spec);
- p = strsav(p, buf);
- }
-
- if (trust_info->next)
- {
- struct list *l;
-
- strcpy(buf,
- "<p>"
- "You can learn more about what this means "
- "and what you may be able to do about it by "
- "reading the following documents:<br>\n"
- "<ol>\n"
- );
-
- p = strsav(p, buf);
-
- for (l = trust_info->next; l ; l = l->next)