From: wessels <> Date: Tue, 14 Jan 1997 05:47:03 +0000 (+0000) Subject: From: Peter Wemm X-Git-Tag: SQUID_3_0_PRE1~5213 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c8749f3bd3ebb65d44590b6fb157362e2c478ab;p=thirdparty%2Fsquid.git From: Peter Wemm We set passwords on everything and discovered that cachemgr.c has a few problems with passwords. (We are using squid 1.1.3) 1: it parses &password=xxx from the incoming url but doesn't use it. ie: with http://foo/cgi-bin/cachemgr.cgi?host=foo&port=8080&password=xxx the form comes up with an empty password field and it has to be filled in. 2: When it generates a stats page, the hidden password field is empty. This causes the "refresh" button to cause a password failure. --- diff --git a/src/cachemgr.cc b/src/cachemgr.cc index ef18a0850d..2d873d734e 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.52 1997/01/10 23:14:23 wessels Exp $ + * $Id: cachemgr.cc,v 1.53 1997/01/13 22:47:03 wessels Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Harvest Derived @@ -303,7 +303,7 @@ static unsigned int inaddr_none; static char x2c _PARAMS((char *)); static int client_comm_connect _PARAMS((int sock, char *dest_host, u_short dest_port)); static void print_trailer _PARAMS((void)); -static void noargs_html _PARAMS((char *, int, char *)); +static void noargs_html _PARAMS((char *, int, char *, char *)); static void unescape_url _PARAMS((char *)); static void plustospace _PARAMS((char *)); static void parse_object _PARAMS((char *)); @@ -337,7 +337,7 @@ print_option(op_t current_opt, op_t opt_nr) static void -noargs_html(char *host, int port, char *url) +noargs_html(char *host, int port, char *url, char *password) { op_t op = INFO; @@ -354,7 +354,7 @@ noargs_html(char *host, int port, char *url) printf("Cache Port:
\n", port); printf("Password :
\n"); + printf("NAME=\"password\" SIZE=30 VALUE=\"%s\">
\n", password); printf("URL :
\n", url); printf("Operation :"); @@ -692,7 +692,7 @@ main(int argc, char *argv[]) } else { printf("

Unknown CGI parameter: %s

\n", s); - noargs_html(hostname, portnum, url); + noargs_html(hostname, portnum, url, password); exit(0); } } @@ -707,13 +707,13 @@ main(int argc, char *argv[]) } /* prints HTML form if no args */ if (!operation[0] || !strcmp(operation, "empty")) { - noargs_html(hostname, portnum, url); + noargs_html(hostname, portnum, url, password); exit(0); } if (hostname[0] == '\0') { printf("

ERROR

\n"); printf("

You must provide a hostname!\n


"); - noargs_html(hostname, portnum, url); + noargs_html(hostname, portnum, url, password); exit(0); } close(0); @@ -791,7 +791,7 @@ main(int argc, char *argv[]) printf("\n"); printf("\n", hostname); printf("\n", portnum); - printf("\n"); + printf("\n", password); printf("\n", url); printf("\n"); printf("
\n");