1008fafead
using the pkgsrc expat library instead of the builtin one (this is to avoid conflicts between expat libraries when an expat XML parser is loaded by either mod_perl or mod_php), and: Security vulnerabilities * A vulnerability was found in the split-logfile support program. A request with a specially crafted Host: header could allow any file with a .log extension on the system to be written to. * A vulnerability was found when Multiviews are used to negotiate the directory index. In some configurations, requesting a URI with a QUERY_STRING of M=D could return a directory listing rather than the expected index page. General bug fixes and improvements * Bug fixes * The supplied icons are now also distributed in PNG format * New directives have been added to the mod_usertrack module, The first, CookieDomain, can be used to customise the Domain attribute. * A new directive, AcceptMutex, allows run-time configuration of the mutex type used for accept serialization. * mod_auth has been enhanced to allow access to a document to be controlled based on the owner of the file being served. * A new directive, AcceptFilter, has been added to control BSD accept filters at run-time. The functionality can postpone the requirement for a child process to handle a new connection until an HTTP request has arrived, therefore increasing the number of connections that a given number of child processes can handle
87 lines
2.7 KiB
Text
87 lines
2.7 KiB
Text
$NetBSD: patch-ae,v 1.6 2001/10/17 19:17:00 jlam Exp $
|
|
|
|
--- src/modules/standard/mod_include.c.orig Thu Sep 20 23:51:54 2001
|
|
+++ src/modules/standard/mod_include.c
|
|
@@ -93,7 +93,11 @@
|
|
#include "http_log.h"
|
|
#include "http_main.h"
|
|
#include "util_script.h"
|
|
+#include "ap_include_extern.h"
|
|
+#include "ap_hook.h"
|
|
#endif
|
|
+#define get_tag ap_include_get_tag
|
|
+#define parse_string ap_include_parse_string
|
|
|
|
#define STARTING_SEQUENCE "<!--#"
|
|
#define ENDING_SEQUENCE "-->"
|
|
@@ -352,7 +356,8 @@
|
|
* the tag value is html decoded if dodecode is non-zero
|
|
*/
|
|
|
|
-static char *get_tag(pool *p, FILE *in, char *tag, int tagbuf_len, int dodecode)
|
|
+API_EXPORT(char *)
|
|
+ap_include_get_tag(pool *p, FILE *in, char *tag, int tagbuf_len, int dodecode)
|
|
{
|
|
char *t = tag, *tag_val, c, term;
|
|
|
|
@@ -471,7 +476,8 @@
|
|
/*
|
|
* Do variable substitution on strings
|
|
*/
|
|
-static void parse_string(request_rec *r, const char *in, char *out,
|
|
+API_EXPORT(void)
|
|
+ap_include_parse_string(request_rec *r, const char *in, char *out,
|
|
size_t length, int leave_name)
|
|
{
|
|
char ch;
|
|
@@ -669,7 +675,8 @@
|
|
parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0);
|
|
if (tag[0] == 'f') {
|
|
/* be safe; only files in this directory or below allowed */
|
|
- if (!is_only_below(parsed_string)) {
|
|
+ if ((ap_allow_options(r) & OPT_INCNOEXEC) &&
|
|
+ !is_only_below(parsed_string)) {
|
|
error_fmt = "unable to include file \"%s\" "
|
|
"in parsed file %s";
|
|
}
|
|
@@ -1081,7 +1088,8 @@
|
|
"in parsed file %s";
|
|
}
|
|
else {
|
|
- ap_getparents(tag_val); /* get rid of any nasties */
|
|
+ if (ap_allow_options(r) & OPT_INCNOEXEC)
|
|
+ ap_getparents(tag_val); /* get rid of any nasties */
|
|
rr = ap_sub_req_lookup_file(tag_val, r);
|
|
|
|
if (rr->status == HTTP_OK && rr->finfo.st_mode != 0) {
|
|
@@ -2162,6 +2170,16 @@
|
|
}
|
|
}
|
|
|
|
+API_EXPORT(int)
|
|
+ap_include_register_extern(const char *cmd, ap_include_extern_func func) {
|
|
+ char cmdbuf[40] = "include::";
|
|
+
|
|
+ strncat(cmdbuf, cmd, 30);
|
|
+ ap_hook_configure(cmdbuf, AP_HOOK_SIG5(int,ptr,ptr,ptr,ptr), AP_HOOK_TOPMOST);
|
|
+ ap_hook_register(cmdbuf, func, NULL);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
|
|
|
|
/* -------------------------- The main function --------------------------- */
|
|
@@ -2300,6 +2318,13 @@
|
|
}
|
|
#endif
|
|
else {
|
|
+ char cmdbuf[40] = "include::";
|
|
+
|
|
+ strncat(cmdbuf, directive, 30);
|
|
+ if ((ap_hook_status(cmdbuf) >= AP_HOOK_STATE_CONFIGURED) &&
|
|
+ (ap_hook_call(cmdbuf, &ret, f, r, error, timefmt) == TRUE))
|
|
+ continue;
|
|
+
|
|
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
|
|
"unknown directive \"%s\" "
|
|
"in parsed doc %s",
|