lars 98/11/13 16:36:05
Modified: src/main http_core.c src CHANGES Log: The docs already mention that ErrorDocument 401 must refer to a local document, but it doesn't look good if Apache replies with a redirect instead of a 401 error in such a case. This is now checked in set_error_document(). Revision Changes Path 1.240 +15 -7 apache-1.3/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v retrieving revision 1.239 retrieving revision 1.240 diff -u -r1.239 -r1.240 --- http_core.c 1998/11/08 09:51:10 1.239 +++ http_core.c 1998/11/14 00:35:54 1.240 @@ -886,15 +886,23 @@ return ap_pstrcat(cmd->pool, "Unsupported HTTP response code ", w, NULL); } - - /* Store it... */ - if (conf->response_code_strings == NULL) { - conf->response_code_strings = - ap_pcalloc(cmd->pool, - sizeof(*conf->response_code_strings) * RESPONSE_CODES); + /* The entry should be ignored if it is a full URL for a 401 error */ + + if (error_number == 401 && + line[0] != '/' && line[0] != '"') { /* Ignore it... */ + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, NULL, + "cannot use a full URL in a 401 ErrorDocument " + "directive --- ignoring!"); } - conf->response_code_strings[index_number] = ap_pstrdup(cmd->pool, line); + else { /* Store it... */ + if (conf->response_code_strings == NULL) { + conf->response_code_strings = + ap_pcalloc(cmd->pool, + sizeof(*conf->response_code_strings) * RESPONSE_CODES); + } + conf->response_code_strings[index_number] = ap_pstrdup(cmd->pool, line); + } return NULL; } 1.1146 +4 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1145 retrieving revision 1.1146 diff -u -r1.1145 -r1.1146 --- CHANGES 1998/11/11 18:36:06 1.1145 +++ CHANGES 1998/11/14 00:36:01 1.1146 @@ -1,5 +1,9 @@ Changes with Apache 1.3.4 + *) Ignore a "ErrorDocument 401" directive with a full URL and write a + notice to the error log. It is not possible to send a 401 response + and a redirect at the same time. [Lars Eilebrecht] + *) Fallback to native compilers for IRIX-32 platform. It seems that a gcc 2.8.1 compiled apache is logging client addresses with all bits set (255.255.255.255). This is the second such problem caused