pkgsrc/www/apache/patches/patch-ae
jlam cf3f21d472 Update apache to 1.3.19. The pkgsrc-related changes include adding a
config.layout file instead of specifying every directory as on option to
the Apache configure script.  This layout file might be useful later when
we package Apache 2.x.  I also reordered a few lines so that it's easier
to diff apache/Makefile and apache6/Makefile (hi itojun!).  Also build
the mod_define shared module from the mod_ssl sources.

Relevant changes from version 1.3.17.1 include:

  *) Rewrite ap_unparse_uri_components() to make it safer and more readable
  *) Under certain circumstances, Apache did not supply the
     right response headers when requiring authentication.
  *) Clean up some end-of-loop not reached warnings
  *) Add the correct language tag for interoperation with the Taiwanese
     versions of MSIE and Netscape.
  *) Workaround enabled for a core dump which appeared in broken
     NameVirtualHost configurations.
  *) Sporadic core dump in ap_default_port_for_scheme() with
     internal requests
  *) SECURITY: The default installation could lead to mod_negotiation
     and mod_dir/mod_autoindex displaying a directory listing instead of
     the index.html.* files, if a very long path was created artificially
     by using many slashes. Now a 403 FORBIDDEN is returned.
  *) Trailing slashes (if they exist) are now removed from ServerRoot,
     because there were known problems with them.
  *) TPF startup/shutdown fixes.
  *) Correct a typo in httpd.conf.
  *) Get the correct IP address if ServerName isn't set and we can't
     find a fully-qualified domain name at startup.
  *) Fix pointer arithmetic in mod_rewrite map expansion.
  *) Fixed a problem with file extensions being truncated during
     the call to ap_os_canonical_filename().
2001-03-13 20:52:26 +00:00

87 lines
2.7 KiB
Text

$NetBSD: patch-ae,v 1.5 2001/03/13 20:52:28 jlam Exp $
--- src/modules/standard/mod_include.c.orig Fri Feb 23 11:37:26 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 --------------------------- */
@@ -2286,6 +2304,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",