1
diff -ruN -x configure -x '*~' -x build-tree.orig -x '*.rej' build-tree.orig/apache2/server/config.c build-tree/apache2/server/config.c
2
--- build-tree.orig/apache2/server/config.c 2003-09-17 11:30:47.000000000 +0100
3
+++ build-tree/apache2/server/config.c 2003-10-07 13:03:15.000000000 +0100
1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 008_make_include_safe by Adam Conrad <adconrad@0c3.net>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Avoid including dpkg droppings in globbed includes.
8
--- apache2-2.2.0/server/config.c 2005-11-17 13:39:15.000000000 +0000
9
+++ apache2-2.2.0/server/config.c 2006-01-27 17:06:19.000000000 +0000
5
11
#include "apr_portable.h"
6
12
#include "apr_file_io.h"
7
13
#include "apr_fnmatch.h"
8
14
+#include "apr_lib.h"
10
16
#define APR_WANT_STDIO
11
17
#define APR_WANT_STRFUNC
12
@@ -1535,6 +1535,30 @@
18
@@ -1521,6 +1522,30 @@
19
return strcmp(f1->fname,f2->fname);
16
22
+static int fname_valid(const char *fname) {
40
AP_DECLARE(void) ap_process_resource_config(server_rec *s, const char *fname,
41
ap_directive_t **conftree,
46
static const char *process_resource_config_nofnmatch(server_rec *s,
48
ap_directive_t **conftree,
50
while (apr_dir_read(&dirent, APR_FINFO_DIRENT, dirp) == APR_SUCCESS) {
51
/* strip out '.' and '..' */
52
if (strcmp(dirent.name, ".")
53
- && strcmp(dirent.name, "..")) {
54
+ && strcmp(dirent.name, "..")
55
+ && fname_valid(dirent.name)) {
56
fnew = (fnames *) apr_array_push(candidates);
57
fnew->fname = ap_make_full_path(p, path, dirent.name);
44
60
if (strcmp(dirent.name, ".")
45
61
&& strcmp(dirent.name, "..")
46
62
&& (apr_fnmatch(pattern, dirent.name,
47
- FNM_PERIOD) == APR_SUCCESS)) {
48
+ FNM_PERIOD) == APR_SUCCESS)
63
- APR_FNM_PERIOD) == APR_SUCCESS)) {
64
+ APR_FNM_PERIOD) == APR_SUCCESS)
49
65
+ && fname_valid(dirent.name)) {
50
66
fnew = (fnames *) apr_array_push(candidates);
51
67
fnew->fname = ap_make_full_path(p, path, dirent.name);