53 lines
1.8 KiB
Text
53 lines
1.8 KiB
Text
$NetBSD: patch-ae,v 1.2 2001/02/06 10:58:18 itojun Exp $
|
|
|
|
--- src/modules/standard/mod_include.c.orig Tue Jan 16 02:05:42 2001
|
|
+++ src/modules/standard/mod_include.c Tue Feb 6 19:49:25 2001
|
|
@@ -94,6 +94,8 @@
|
|
#include "http_main.h"
|
|
#include "util_script.h"
|
|
#endif
|
|
+#define get_tag ap_include_get_tag
|
|
+#define parse_string ap_include_parse_string
|
|
|
|
#define STARTING_SEQUENCE "<!--#"
|
|
#define ENDING_SEQUENCE "-->"
|
|
@@ -352,7 +354,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 +474,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 +673,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 +1086,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) {
|