~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to debian/patches/021_internal_pcre.patch

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -urN build-tree.orig/apache2/Makefile.in build-tree/apache2/Makefile.in
2
 
--- build-tree.orig/apache2/Makefile.in 2004-11-24 12:31:09.000000000 -0700
3
 
+++ build-tree/apache2/Makefile.in      2005-02-09 11:27:22.000000000 -0700
4
 
@@ -179,7 +179,6 @@
5
 
        @cp -p $(srcdir)/modules/http/mod_core.h $(DESTDIR)$(includedir)
6
 
        @cp -p $(srcdir)/modules/proxy/mod_proxy.h $(DESTDIR)$(includedir)
7
 
        @cp -p $(srcdir)/modules/ssl/*.h $(DESTDIR)$(includedir)
8
 
-       @cp -p $(srcdir)/srclib/pcre/pcre*.h $(DESTDIR)$(includedir)
9
 
        @cp -p $(srcdir)/os/$(OS_DIR)/*.h $(DESTDIR)$(includedir)
10
 
        @chmod 644 $(DESTDIR)$(includedir)/*.h
11
 
 
12
 
diff -urN build-tree.orig/apache2/configure.in build-tree/apache2/configure.in
13
 
--- build-tree.orig/apache2/configure.in        2004-11-24 12:31:09.000000000 -0700
14
 
+++ build-tree/apache2/configure.in     2005-02-09 11:25:13.000000000 -0700
15
 
@@ -476,6 +476,7 @@
16
 
 
17
 
 dnl AP_LIBS specifies the actual libraries. note we have some required libs.
18
 
 AP_LIBS="$abs_builddir/srclib/pcre/libpcre.la $AP_LIBS"
19
 
+APR_ADDTO(CPPFLAGS, [-I$abs_builddir/srclib/pcre])
20
 
 
21
 
 dnl APR should go after the other libs, so the right symbols can be picked up
22
 
 AP_LIBS="$AP_LIBS `$apu_config --link-libtool --libs` `$apr_config --link-libtool --libs`"
23
 
diff -urN build-tree.orig/apache2/include/ap_regex.h build-tree/apache2/include/ap_regex.h
24
 
--- build-tree.orig/apache2/include/ap_regex.h  1969-12-31 17:00:00.000000000 -0700
25
 
+++ build-tree/apache2/include/ap_regex.h       2005-02-09 11:28:02.000000000 -0700
26
 
@@ -0,0 +1,117 @@
27
 
+/*************************************************
28
 
+*       Perl-Compatible Regular Expressions      *
29
 
+*************************************************/
30
 
+
31
 
+/* Copyright (c) 1997-2000 University of Cambridge */
32
 
+
33
 
+/**
34
 
+ * @file include/pcreposix.h
35
 
+ * @brief PCRE definitions
36
 
+ */
37
 
+
38
 
+#ifndef _AP_PCREPOSIX_H
39
 
+#define _AP_PCREPOSIX_H
40
 
+
41
 
+/* This is the header for the POSIX wrapper interface to the PCRE Perl-
42
 
+Compatible Regular Expression library. It defines the things POSIX says should
43
 
+be there. I hope. */
44
 
+
45
 
+/* Have to include stdlib.h in order to ensure that size_t is defined. */
46
 
+
47
 
+#include <stdlib.h>
48
 
+
49
 
+/* Allow for C++ users */
50
 
+
51
 
+#ifdef __cplusplus
52
 
+extern "C" {
53
 
+#endif
54
 
+
55
 
+/* Options defined by POSIX. */
56
 
+
57
 
+  /** Ignore case */
58
 
+#define AP_REG_ICASE     0x01
59
 
+  /** Don't match newlines with wildcards */
60
 
+#define AP_REG_NEWLINE   0x02
61
 
+  /** Don't match BOL */
62
 
+#define AP_REG_NOTBOL    0x04
63
 
+  /** Don't match EOL */
64
 
+#define AP_REG_NOTEOL    0x08
65
 
+
66
 
+/* These are not used by PCRE, but by defining them we make it easier
67
 
+to slot PCRE into existing programs that make POSIX calls. */
68
 
+
69
 
+  /** UNUSED! */
70
 
+#define AP_REG_EXTENDED  0
71
 
+  /** UNUSED! */
72
 
+#define AP_REG_NOSUB     0
73
 
+
74
 
+/* Error values. Not all these are relevant or used by the wrapper. */
75
 
+
76
 
+enum {
77
 
+  AP_REG_ASSERT = 1,  /* internal error ? */
78
 
+  AP_REG_ESPACE,      /* failed to get memory */
79
 
+  AP_REG_INVARG,      /* bad argument */
80
 
+  AP_REG_NOMATCH      /* match failed */
81
 
+};
82
 
+
83
 
+
84
 
+/* The structure representing a compiled regular expression. */
85
 
+
86
 
+typedef struct {
87
 
+  void *re_pcre;
88
 
+  size_t re_nsub;
89
 
+  size_t re_erroffset;
90
 
+} ap_regex_t;
91
 
+
92
 
+/* The structure in which a captured offset is returned. */
93
 
+
94
 
+typedef int ap_regoff_t;
95
 
+
96
 
+typedef struct {
97
 
+  ap_regoff_t rm_so;
98
 
+  ap_regoff_t rm_eo;
99
 
+} ap_regmatch_t;
100
 
+
101
 
+#ifndef AP_DECLARE
102
 
+#define AP_DECLARE(x) x
103
 
+#endif /* AP_DECLARE */
104
 
+
105
 
+/* The functions */
106
 
+
107
 
+AP_DECLARE(int) ap_regcomp(ap_regex_t *, const char *, int);
108
 
+
109
 
+/**
110
 
+ * Match a null-terminated string against a pre-compiled regex.
111
 
+ * @param preg The pre-compiled regex
112
 
+ * @param string The string to match
113
 
+ * @param nmatch Provide information regarding the location of any matches
114
 
+ * @param pmatch Provide information regarding the location of any matches
115
 
+ * @param eflags Bitwise or of any of:
116
 
+ *   @li #REG_NOTBOL - match-beginning-of-line operator always
117
 
+ *     fails to match
118
 
+ *   @li #REG_NOTEOL - match-end-of-line operator always fails to match
119
 
+ * @return 0 for successful match, #REG_NOMATCH otherwise
120
 
+ */ 
121
 
+AP_DECLARE(int) ap_regexec(const ap_regex_t *preg, const char *string,
122
 
+                                          size_t nmatch, ap_regmatch_t *pmatch, int eflags);
123
 
+
124
 
+/**
125
 
+ * Return the error code returned by regcomp or regexec into error messages
126
 
+ * @param errcode the error code returned by regexec or regcomp
127
 
+ * @param preg The precompiled regex
128
 
+ * @param errbuf A buffer to store the error in
129
 
+ * @param errbuf_size The size of the buffer
130
 
+ */
131
 
+AP_DECLARE(size_t) ap_regerror(int errcode, const ap_regex_t *preg, 
132
 
+                                              char *errbuf, size_t errbuf_size);
133
 
+
134
 
+/** Destroy a pre-compiled regex.
135
 
+ * @param preg The pre-compiled regex to free.
136
 
+ */
137
 
+AP_DECLARE(void) ap_regfree(ap_regex_t *preg);
138
 
+
139
 
+#ifdef __cplusplus
140
 
+}   /* extern "C" */
141
 
+#endif
142
 
+
143
 
+#endif /* End of pcreposix.h */
144
 
diff -urN build-tree.orig/apache2/include/http_core.h build-tree/apache2/include/http_core.h
145
 
--- build-tree.orig/apache2/include/http_core.h 2005-02-04 13:21:18.000000000 -0700
146
 
+++ build-tree/apache2/include/http_core.h      2005-02-09 11:25:13.000000000 -0700
147
 
@@ -490,7 +490,7 @@
148
 
     
149
 
     /* Access control */
150
 
     apr_array_header_t *sec_file;
151
 
-    regex_t *r;
152
 
+    ap_regex_t *r;
153
 
 
154
 
     const char *mime_type;       /* forced with ForceType  */
155
 
     const char *handler;         /* forced with SetHandler */
156
 
diff -urN build-tree.orig/apache2/include/httpd.h build-tree/apache2/include/httpd.h
157
 
--- build-tree.orig/apache2/include/httpd.h     2005-02-04 13:21:18.000000000 -0700
158
 
+++ build-tree/apache2/include/httpd.h  2005-02-09 11:25:13.000000000 -0700
159
 
@@ -41,7 +41,7 @@
160
 
 
161
 
 #include "os.h"
162
 
 
163
 
-#include "pcreposix.h"
164
 
+#include "ap_regex.h"
165
 
 
166
 
 /* Note: util_uri.h is also included, see below */
167
 
 
168
 
@@ -1503,7 +1503,7 @@
169
 
  *   @li #REG_NEWLINE  - Match-any-character operators don't match new-line
170
 
  * @return The compiled regular expression
171
 
  */
172
 
-AP_DECLARE(regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
173
 
+AP_DECLARE(ap_regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
174
 
                                   int cflags);
175
 
 
176
 
 /**
177
 
@@ -1511,32 +1511,7 @@
178
 
  * @param p The pool the regex was allocated from
179
 
  * @param reg The regular expression to free
180
 
  */
181
 
-AP_DECLARE(void) ap_pregfree(apr_pool_t *p, regex_t *reg);
182
 
-
183
 
-/**
184
 
- * Match a null-terminated string against a pre-compiled regex.
185
 
- * @param preg The pre-compiled regex
186
 
- * @param string The string to match
187
 
- * @param nmatch Provide information regarding the location of any matches
188
 
- * @param pmatch Provide information regarding the location of any matches
189
 
- * @param eflags Bitwise or of any of:
190
 
- *   @li #REG_NOTBOL - match-beginning-of-line operator always
191
 
- *     fails to match
192
 
- *   @li #REG_NOTEOL - match-end-of-line operator always fails to match
193
 
- * @return 0 for successful match, #REG_NOMATCH otherwise
194
 
- */ 
195
 
-AP_DECLARE(int)    ap_regexec(regex_t *preg, const char *string,
196
 
-                              size_t nmatch, regmatch_t pmatch[], int eflags);
197
 
-
198
 
-/**
199
 
- * Return the error code returned by regcomp or regexec into error messages
200
 
- * @param errcode the error code returned by regexec or regcomp
201
 
- * @param preg The precompiled regex
202
 
- * @param errbuf A buffer to store the error in
203
 
- * @param errbuf_size The size of the buffer
204
 
- */
205
 
-AP_DECLARE(size_t) ap_regerror(int errcode, const regex_t *preg, 
206
 
-                               char *errbuf, size_t errbuf_size);
207
 
+AP_DECLARE(void) ap_pregfree(apr_pool_t *p, ap_regex_t *reg);
208
 
 
209
 
 /**
210
 
  * After performing a successful regex match, you may use this function to 
211
 
@@ -1550,7 +1525,7 @@
212
 
  * @param pmatch the pmatch array returned from ap_pregex
213
 
  */
214
 
 AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source,
215
 
-                              size_t nmatch, regmatch_t pmatch[]);
216
 
+                              size_t nmatch, ap_regmatch_t pmatch[]);
217
 
 
218
 
 /**
219
 
  * We want to downcase the type/subtype for comparison purposes
220
 
diff -urN build-tree.orig/apache2/include/pcreposix.h build-tree/apache2/include/pcreposix.h
221
 
--- build-tree.orig/apache2/include/pcreposix.h 2004-11-24 12:31:09.000000000 -0700
222
 
+++ build-tree/apache2/include/pcreposix.h      1969-12-31 17:00:00.000000000 -0700
223
 
@@ -1,99 +0,0 @@
224
 
-/*************************************************
225
 
-*       Perl-Compatible Regular Expressions      *
226
 
-*************************************************/
227
 
-
228
 
-/* Copyright (c) 1997-2000 University of Cambridge */
229
 
-
230
 
-/**
231
 
- * @file include/pcreposix.h
232
 
- * @brief PCRE definitions
233
 
- */
234
 
-
235
 
-#ifndef _PCREPOSIX_H
236
 
-#define _PCREPOSIX_H
237
 
-
238
 
-/* This is the header for the POSIX wrapper interface to the PCRE Perl-
239
 
-Compatible Regular Expression library. It defines the things POSIX says should
240
 
-be there. I hope. */
241
 
-
242
 
-/* Have to include stdlib.h in order to ensure that size_t is defined. */
243
 
-
244
 
-#include <stdlib.h>
245
 
-
246
 
-/* Allow for C++ users */
247
 
-
248
 
-#ifdef __cplusplus
249
 
-extern "C" {
250
 
-#endif
251
 
-
252
 
-/* Options defined by POSIX. */
253
 
-
254
 
-  /** Ignore case */
255
 
-#define REG_ICASE     0x01
256
 
-  /** Don't match newlines with wildcards */
257
 
-#define REG_NEWLINE   0x02
258
 
-  /** Don't match BOL */
259
 
-#define REG_NOTBOL    0x04
260
 
-  /** Don't match EOL */
261
 
-#define REG_NOTEOL    0x08
262
 
-
263
 
-/* These are not used by PCRE, but by defining them we make it easier
264
 
-to slot PCRE into existing programs that make POSIX calls. */
265
 
-
266
 
-  /** UNUSED! */
267
 
-#define REG_EXTENDED  0
268
 
-  /** UNUSED! */
269
 
-#define REG_NOSUB     0
270
 
-
271
 
-/* Error values. Not all these are relevant or used by the wrapper. */
272
 
-
273
 
-enum {
274
 
-  REG_ASSERT = 1,  /* internal error ? */
275
 
-  REG_BADBR,       /* invalid repeat counts in {} */
276
 
-  REG_BADPAT,      /* pattern error */
277
 
-  REG_BADRPT,      /* ? * + invalid */
278
 
-  REG_EBRACE,      /* unbalanced {} */
279
 
-  REG_EBRACK,      /* unbalanced [] */
280
 
-  REG_ECOLLATE,    /* collation error - not relevant */
281
 
-  REG_ECTYPE,      /* bad class */
282
 
-  REG_EESCAPE,     /* bad escape sequence */
283
 
-  REG_EMPTY,       /* empty expression */
284
 
-  REG_EPAREN,      /* unbalanced () */
285
 
-  REG_ERANGE,      /* bad range inside [] */
286
 
-  REG_ESIZE,       /* expression too big */
287
 
-  REG_ESPACE,      /* failed to get memory */
288
 
-  REG_ESUBREG,     /* bad back reference */
289
 
-  REG_INVARG,      /* bad argument */
290
 
-  REG_NOMATCH      /* match failed */
291
 
-};
292
 
-
293
 
-
294
 
-/* The structure representing a compiled regular expression. */
295
 
-
296
 
-typedef struct {
297
 
-  void *re_pcre;
298
 
-  size_t re_nsub;
299
 
-  size_t re_erroffset;
300
 
-} regex_t;
301
 
-
302
 
-/* The structure in which a captured offset is returned. */
303
 
-
304
 
-typedef int regoff_t;
305
 
-
306
 
-typedef struct {
307
 
-  regoff_t rm_so;
308
 
-  regoff_t rm_eo;
309
 
-} regmatch_t;
310
 
-
311
 
-/* The functions */
312
 
-
313
 
-extern int regcomp(regex_t *, const char *, int);
314
 
-extern int regexec(regex_t *, const char *, size_t, regmatch_t *, int);
315
 
-extern size_t regerror(int, const regex_t *, char *, size_t);
316
 
-extern void regfree(regex_t *);
317
 
-
318
 
-#ifdef __cplusplus
319
 
-}   /* extern "C" */
320
 
-#endif
321
 
-
322
 
-#endif /* End of pcreposix.h */
323
 
diff -urN build-tree.orig/apache2/modules/filters/mod_include.c build-tree/apache2/modules/filters/mod_include.c
324
 
--- build-tree.orig/apache2/modules/filters/mod_include.c       2005-02-04 13:21:18.000000000 -0700
325
 
+++ build-tree/apache2/modules/filters/mod_include.c    2005-02-09 11:25:13.000000000 -0700
326
 
@@ -1173,11 +1173,11 @@
327
 
 static int re_check(request_rec *r, include_ctx_t *ctx, 
328
 
                     char *string, char *rexp)
329
 
 {
330
 
-    regex_t *compiled;
331
 
-    const apr_size_t nres = sizeof(*ctx->re_result) / sizeof(regmatch_t);
332
 
+    ap_regex_t *compiled;
333
 
+    const apr_size_t nres = sizeof(*ctx->re_result) / sizeof(ap_regmatch_t);
334
 
     int regex_error;
335
 
 
336
 
-    compiled = ap_pregcomp(r->pool, rexp, REG_EXTENDED | REG_NOSUB);
337
 
+    compiled = ap_pregcomp(r->pool, rexp, AP_REG_EXTENDED | AP_REG_NOSUB);
338
 
     if (compiled == NULL) {
339
 
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
340
 
                       "unable to compile pattern \"%s\"", rexp);
341
 
diff -urN build-tree.orig/apache2/modules/filters/mod_include.h build-tree/apache2/modules/filters/mod_include.h
342
 
--- build-tree.orig/apache2/modules/filters/mod_include.h       2005-02-04 13:21:18.000000000 -0700
343
 
+++ build-tree/apache2/modules/filters/mod_include.h    2005-02-09 11:25:13.000000000 -0700
344
 
@@ -140,7 +140,7 @@
345
 
     int          start_seq_len;
346
 
     char         *end_seq;
347
 
     char         *re_string;
348
 
-    regmatch_t   (*re_result)[10];
349
 
+    ap_regmatch_t   (*re_result)[10];
350
 
 } include_ctx_t;
351
 
 
352
 
 /* These flags are used to set flag bits. */
353
 
diff -urN build-tree.orig/apache2/modules/mappers/mod_alias.c build-tree/apache2/modules/mappers/mod_alias.c
354
 
--- build-tree.orig/apache2/modules/mappers/mod_alias.c 2005-02-04 13:21:18.000000000 -0700
355
 
+++ build-tree/apache2/modules/mappers/mod_alias.c      2005-02-09 11:25:13.000000000 -0700
356
 
@@ -40,7 +40,7 @@
357
 
     const char *real;
358
 
     const char *fake;
359
 
     char *handler;
360
 
-    regex_t *regexp;
361
 
+    ap_regex_t *regexp;
362
 
     int redir_status;                /* 301, 302, 303, 410, etc */
363
 
 } alias_entry;
364
 
 
365
 
@@ -112,7 +112,7 @@
366
 
     /* XX r can NOT be relative to DocumentRoot here... compat bug. */
367
 
 
368
 
     if (use_regex) {
369
 
-        new->regexp = ap_pregcomp(cmd->pool, f, REG_EXTENDED);
370
 
+        new->regexp = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
371
 
         if (new->regexp == NULL)
372
 
             return "Regular expression could not be compiled.";
373
 
         new->real = r;
374
 
@@ -176,7 +176,7 @@
375
 
     alias_server_conf *serverconf = ap_get_module_config(s->module_config,
376
 
                                                          &alias_module);
377
 
     int status = (int) (long) cmd->info;
378
 
-    regex_t *r = NULL;
379
 
+    ap_regex_t *r = NULL;
380
 
     const char *f = arg2;
381
 
     const char *url = arg3;
382
 
 
383
 
@@ -196,7 +196,7 @@
384
 
     }
385
 
 
386
 
     if (use_regex) {
387
 
-        r = ap_pregcomp(cmd->pool, f, REG_EXTENDED);
388
 
+        r = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
389
 
         if (r == NULL)
390
 
             return "Regular expression could not be compiled.";
391
 
     }
392
 
@@ -314,7 +314,7 @@
393
 
                             int doesc, int *status)
394
 
 {
395
 
     alias_entry *entries = (alias_entry *) aliases->elts;
396
 
-    regmatch_t regm[AP_MAX_REG_MATCH];
397
 
+    ap_regmatch_t regm[AP_MAX_REG_MATCH];
398
 
     char *found = NULL;
399
 
     int i;
400
 
 
401
 
diff -urN build-tree.orig/apache2/modules/mappers/mod_rewrite.c build-tree/apache2/modules/mappers/mod_rewrite.c
402
 
--- build-tree.orig/apache2/modules/mappers/mod_rewrite.c       2005-02-04 13:21:18.000000000 -0700
403
 
+++ build-tree/apache2/modules/mappers/mod_rewrite.c    2005-02-09 11:25:13.000000000 -0700
404
 
@@ -552,7 +552,7 @@
405
 
     char *str = apr_pstrdup(cmd->pool, in_str);
406
 
     rewrite_server_conf *sconf;
407
 
     rewritecond_entry *newcond;
408
 
-    regex_t *regexp;
409
 
+    ap_regex_t *regexp;
410
 
     char *a1;
411
 
     char *a2;
412
 
     char *a3;
413
 
@@ -602,11 +602,11 @@
414
 
        we can compile the pattern for case insensitive matching,
415
 
        under the old V8 library we have to do it self via a hack */
416
 
     if (newcond->flags & CONDFLAG_NOCASE) {
417
 
-        rc = ((regexp = ap_pregcomp(cmd->pool, cp, REG_EXTENDED|REG_ICASE))
418
 
+        rc = ((regexp = ap_pregcomp(cmd->pool, cp, AP_REG_EXTENDED|AP_REG_ICASE))
419
 
               == NULL);
420
 
     }
421
 
     else {
422
 
-        rc = ((regexp = ap_pregcomp(cmd->pool, cp, REG_EXTENDED)) == NULL);
423
 
+        rc = ((regexp = ap_pregcomp(cmd->pool, cp, AP_REG_EXTENDED)) == NULL);
424
 
     }
425
 
     if (rc) {
426
 
         return apr_pstrcat(cmd->pool,
427
 
@@ -697,7 +697,7 @@
428
 
     char *str = apr_pstrdup(cmd->pool, in_str);
429
 
     rewrite_server_conf *sconf;
430
 
     rewriterule_entry *newrule;
431
 
-    regex_t *regexp;
432
 
+    ap_regex_t *regexp;
433
 
     char *a1;
434
 
     char *a2;
435
 
     char *a3;
436
 
@@ -743,9 +743,9 @@
437
 
         newrule->flags |= RULEFLAG_NOTMATCH;
438
 
         cp++;
439
 
     }
440
 
-    mode = REG_EXTENDED;
441
 
+    mode = AP_REG_EXTENDED;
442
 
     if (newrule->flags & RULEFLAG_NOCASE) {
443
 
-        mode |= REG_ICASE;
444
 
+        mode |= AP_REG_ICASE;
445
 
     }
446
 
     if ((regexp = ap_pregcomp(cmd->pool, cp, mode)) == NULL) {
447
 
         return apr_pstrcat(cmd->pool,
448
 
@@ -1945,8 +1945,8 @@
449
 
     char *output;
450
 
     const char *vary;
451
 
     char newuri[MAX_STRING_LEN];
452
 
-    regex_t *regexp;
453
 
-    regmatch_t regmatch[AP_MAX_REG_MATCH];
454
 
+    ap_regex_t *regexp;
455
 
+    ap_regmatch_t regmatch[AP_MAX_REG_MATCH];
456
 
     backrefinfo *briRR = NULL;
457
 
     backrefinfo *briRC = NULL;
458
 
     int failed;
459
 
@@ -2303,7 +2303,7 @@
460
 
     char input[MAX_STRING_LEN];
461
 
     apr_finfo_t sb;
462
 
     request_rec *rsub;
463
 
-    regmatch_t regmatch[AP_MAX_REG_MATCH];
464
 
+    ap_regmatch_t regmatch[AP_MAX_REG_MATCH];
465
 
     int rc;
466
 
 
467
 
     /*
468
 
diff -urN build-tree.orig/apache2/modules/mappers/mod_rewrite.h build-tree/apache2/modules/mappers/mod_rewrite.h
469
 
--- build-tree.orig/apache2/modules/mappers/mod_rewrite.h       2005-02-04 13:21:18.000000000 -0700
470
 
+++ build-tree/apache2/modules/mappers/mod_rewrite.h    2005-02-09 11:25:13.000000000 -0700
471
 
@@ -199,14 +199,14 @@
472
 
 typedef struct {
473
 
     char    *input;                /* Input string of RewriteCond */
474
 
     char    *pattern;              /* the RegExp pattern string */
475
 
-    regex_t *regexp;
476
 
+    ap_regex_t *regexp;
477
 
     int      flags;                /* Flags which control the match */
478
 
 } rewritecond_entry;
479
 
 
480
 
 typedef struct {
481
 
     apr_array_header_t *rewriteconds;    /* the corresponding RewriteCond entries */
482
 
     char    *pattern;              /* the RegExp pattern string */
483
 
-    regex_t *regexp;               /* the RegExp pattern compilation */
484
 
+    ap_regex_t *regexp;               /* the RegExp pattern compilation */
485
 
     char    *output;               /* the Substitution string */
486
 
     int      flags;                /* Flags which control the substitution */
487
 
     char    *forced_mimetype;      /* forced MIME type of substitution */
488
 
@@ -290,7 +290,7 @@
489
 
 typedef struct backrefinfo {
490
 
     char *source;
491
 
     int nsub;
492
 
-    regmatch_t regmatch[AP_MAX_REG_MATCH];
493
 
+    ap_regmatch_t regmatch[AP_MAX_REG_MATCH];
494
 
 } backrefinfo;
495
 
 
496
 
 
497
 
diff -urN build-tree.orig/apache2/modules/metadata/mod_headers.c build-tree/apache2/modules/metadata/mod_headers.c
498
 
--- build-tree.orig/apache2/modules/metadata/mod_headers.c      2005-02-04 13:21:18.000000000 -0700
499
 
+++ build-tree/apache2/modules/metadata/mod_headers.c   2005-02-09 11:25:13.000000000 -0700
500
 
@@ -113,7 +113,7 @@
501
 
     hdr_actions action;
502
 
     char *header;
503
 
     apr_array_header_t *ta;   /* Array of format_tag structs */
504
 
-    regex_t *regex;
505
 
+    ap_regex_t *regex;
506
 
     const char *condition_var;
507
 
 } header_entry;
508
 
 
509
 
@@ -344,13 +344,13 @@
510
 
             return "header unset takes two arguments";
511
 
     }
512
 
     else if (new->action == hdr_echo) {
513
 
-        regex_t *regex;
514
 
+        ap_regex_t *regex;
515
 
         if (value)
516
 
             return "Header echo takes two arguments";
517
 
         else if (cmd->info == &hdr_in)
518
 
             return "Header echo only valid on Header directive";
519
 
         else {
520
 
-            regex = ap_pregcomp(cmd->pool, hdr, REG_EXTENDED | REG_NOSUB);
521
 
+            regex = ap_pregcomp(cmd->pool, hdr, AP_REG_EXTENDED | AP_REG_NOSUB);
522
 
             if (regex == NULL) {
523
 
                 return "Header echo regex could not be compiled";
524
 
             }
525
 
diff -urN build-tree.orig/apache2/modules/metadata/mod_setenvif.c build-tree/apache2/modules/metadata/mod_setenvif.c
526
 
--- build-tree.orig/apache2/modules/metadata/mod_setenvif.c     2005-02-04 13:21:18.000000000 -0700
527
 
+++ build-tree/apache2/modules/metadata/mod_setenvif.c  2005-02-09 11:25:13.000000000 -0700
528
 
@@ -106,9 +106,9 @@
529
 
 };
530
 
 typedef struct {
531
 
     char *name;                 /* header name */
532
 
-    regex_t *pnamereg;          /* compiled header name regex */
533
 
+    ap_regex_t *pnamereg;          /* compiled header name regex */
534
 
     char *regex;                /* regex to match against */
535
 
-    regex_t *preg;              /* compiled regex */
536
 
+    ap_regex_t *preg;              /* compiled regex */
537
 
     const apr_strmatch_pattern *pattern; /* non-regex pattern to match */
538
 
     apr_table_t *features;      /* env vars to set (or unset) */
539
 
     enum special special_type;  /* is it a "special" header ? */
540
 
@@ -159,7 +159,7 @@
541
 
 }
542
 
 
543
 
 /*
544
 
- * any non-NULL magic constant will do... used to indicate if REG_ICASE should
545
 
+ * any non-NULL magic constant will do... used to indicate if AP_REG_ICASE should
546
 
  * be used
547
 
  */
548
 
 #define ICASE_MAGIC    ((void *)(&setenvif_module))
549
 
@@ -171,8 +171,8 @@
550
 
      *    -,_,[A-Z\, [a-z] and [0-9].
551
 
      * assume the header name is a regular expression.
552
 
      */
553
 
-    regex_t *preg = ap_pregcomp(p, "^[-A-Za-z0-9_]*$",
554
 
-                                (REG_EXTENDED | REG_NOSUB ));
555
 
+    ap_regex_t *preg = ap_pregcomp(p, "^[-A-Za-z0-9_]*$",
556
 
+                                (AP_REG_EXTENDED | AP_REG_NOSUB ));
557
 
     ap_assert(preg != NULL);
558
 
 
559
 
     if (ap_regexec(preg, name, 0, NULL, 0)) {
560
 
@@ -318,7 +318,7 @@
561
 
         }
562
 
         else {
563
 
             new->preg = ap_pregcomp(cmd->pool, regex,
564
 
-                                    (REG_EXTENDED | (icase ? REG_ICASE : 0)));
565
 
+                                    (AP_REG_EXTENDED | (icase ? AP_REG_ICASE : 0)));
566
 
             if (new->preg == NULL) {
567
 
                 return apr_pstrcat(cmd->pool, cmd->cmd->name,
568
 
                                    " regex could not be compiled.", NULL);
569
 
@@ -354,8 +354,8 @@
570
 
              */
571
 
             if (is_header_regex(cmd->pool, fname)) {
572
 
                 new->pnamereg = ap_pregcomp(cmd->pool, fname,
573
 
-                                            (REG_EXTENDED | REG_NOSUB
574
 
-                                             | (icase ? REG_ICASE : 0)));
575
 
+                                            (AP_REG_EXTENDED | AP_REG_NOSUB
576
 
+                                             | (icase ? AP_REG_ICASE : 0)));
577
 
                 if (new->pnamereg == NULL)
578
 
                     return apr_pstrcat(cmd->pool, cmd->cmd->name,
579
 
                                        "Header name regex could not be "
580
 
@@ -453,7 +453,7 @@
581
 
     apr_size_t val_len = 0;
582
 
     int i, j;
583
 
     char *last_name;
584
 
-    regmatch_t regm[AP_MAX_REG_MATCH];
585
 
+    ap_regmatch_t regm[AP_MAX_REG_MATCH];
586
 
 
587
 
     if (!ap_get_module_config(r->request_config, &setenvif_module)) {
588
 
         ap_set_module_config(r->request_config, &setenvif_module,
589
 
diff -urN build-tree.orig/apache2/modules/metadata/mod_usertrack.c build-tree/apache2/modules/metadata/mod_usertrack.c
590
 
--- build-tree.orig/apache2/modules/metadata/mod_usertrack.c    2005-02-04 13:21:18.000000000 -0700
591
 
+++ build-tree/apache2/modules/metadata/mod_usertrack.c 2005-02-09 11:25:13.000000000 -0700
592
 
@@ -84,7 +84,7 @@
593
 
     char *cookie_name;
594
 
     char *cookie_domain;
595
 
     char *regexp_string;  /* used to compile regexp; save for debugging */
596
 
-    regex_t *regexp;  /* used to find usertrack cookie in cookie header */
597
 
+    ap_regex_t *regexp;  /* used to find usertrack cookie in cookie header */
598
 
 } cookie_dir_rec;
599
 
 
600
 
 /* Make Cookie: Now we have to generate something that is going to be
601
 
@@ -201,7 +201,7 @@
602
 
                                       cookie_name,
603
 
                                       "=([^;]+)", NULL);
604
 
 
605
 
-    dcfg->regexp = ap_pregcomp(p, dcfg->regexp_string, REG_EXTENDED);
606
 
+    dcfg->regexp = ap_pregcomp(p, dcfg->regexp_string, AP_REG_EXTENDED);
607
 
     ap_assert(dcfg->regexp != NULL);
608
 
 }
609
 
 
610
 
@@ -210,7 +210,7 @@
611
 
     cookie_dir_rec *dcfg = ap_get_module_config(r->per_dir_config,
612
 
                                                &usertrack_module);
613
 
     const char *cookie_header;
614
 
-    regmatch_t regm[NUM_SUBS];
615
 
+    ap_regmatch_t regm[NUM_SUBS];
616
 
 
617
 
     /* Do not run in subrequests */
618
 
     if (!dcfg->enabled || r->main) {
619
 
diff -urN build-tree.orig/apache2/modules/proxy/mod_proxy.c build-tree/apache2/modules/proxy/mod_proxy.c
620
 
--- build-tree.orig/apache2/modules/proxy/mod_proxy.c   2005-02-04 13:21:18.000000000 -0700
621
 
+++ build-tree/apache2/modules/proxy/mod_proxy.c        2005-02-09 11:25:13.000000000 -0700
622
 
@@ -524,7 +524,7 @@
623
 
     struct proxy_remote *new;
624
 
     char *p, *q;
625
 
     char *r, *f, *scheme;
626
 
-    regex_t *reg = NULL;
627
 
+    ap_regex_t *reg = NULL;
628
 
     int port;
629
 
 
630
 
     r = apr_pstrdup(cmd->pool, r1);
631
 
@@ -554,7 +554,7 @@
632
 
         port = -1;
633
 
     *p = '\0';
634
 
     if (regex) {
635
 
-        reg = ap_pregcomp(cmd->pool, f, REG_EXTENDED);
636
 
+        reg = ap_pregcomp(cmd->pool, f, AP_REG_EXTENDED);
637
 
         if (!reg)
638
 
             return "Regular expression for ProxyRemoteMatch could not be compiled.";
639
 
     }
640
 
@@ -912,7 +912,7 @@
641
 
     char *old_path = cmd->path;
642
 
     proxy_dir_conf *conf;
643
 
     ap_conf_vector_t *new_dir_conf = ap_create_per_dir_config(cmd->pool);
644
 
-    regex_t *r = NULL;
645
 
+    ap_regex_t *r = NULL;
646
 
     const command_rec *thiscmd = cmd->cmd;
647
 
 
648
 
     const char *err = ap_check_cmd_context(cmd,
649
 
@@ -946,7 +946,7 @@
650
 
      * scheme?  See proxy_fixup()
651
 
      */
652
 
     if (thiscmd->cmd_data) { /* <ProxyMatch> */
653
 
-        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
654
 
+        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED);
655
 
         if (!r) {
656
 
             return "Regex could not be compiled";
657
 
         }
658
 
@@ -957,7 +957,7 @@
659
 
             return "<Proxy ~ > block must specify a path";
660
 
         if (strncasecmp(cmd->path, "proxy:", 6))
661
 
             cmd->path += 6;
662
 
-        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
663
 
+        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED);
664
 
         if (!r) {
665
 
             return "Regex could not be compiled";
666
 
         }
667
 
diff -urN build-tree.orig/apache2/modules/proxy/mod_proxy.h build-tree/apache2/modules/proxy/mod_proxy.h
668
 
--- build-tree.orig/apache2/modules/proxy/mod_proxy.h   2005-02-04 13:21:18.000000000 -0700
669
 
+++ build-tree/apache2/modules/proxy/mod_proxy.h        2005-02-09 11:25:13.000000000 -0700
670
 
@@ -94,7 +94,7 @@
671
 
     const char *protocol;      /* the scheme used to talk to this proxy */
672
 
     const char *hostname;      /* the hostname of this proxy */
673
 
     apr_port_t  port;          /* the port for this proxy */
674
 
-    regex_t *regexp;           /* compiled regex (if any) for the remote */
675
 
+    ap_regex_t *regexp;                /* compiled regex (if any) for the remote */
676
 
     int use_regex;             /* simple boolean. True if we have a regex pattern */
677
 
 };
678
 
 
679
 
@@ -165,7 +165,7 @@
680
 
 typedef struct {
681
 
     const char *p;            /* The path */
682
 
     int         p_is_fnmatch; /* Is this path an fnmatch candidate? */
683
 
-    regex_t    *r;            /* Is this a regex? */
684
 
+    ap_regex_t    *r;            /* Is this a regex? */
685
 
 } proxy_dir_conf;
686
 
 
687
 
 typedef struct {
688
 
diff -urN build-tree.orig/apache2/modules/proxy/proxy_ftp.c build-tree/apache2/modules/proxy/proxy_ftp.c
689
 
--- build-tree.orig/apache2/modules/proxy/proxy_ftp.c   2005-02-04 13:21:18.000000000 -0700
690
 
+++ build-tree/apache2/modules/proxy/proxy_ftp.c        2005-02-09 11:25:13.000000000 -0700
691
 
@@ -426,11 +426,11 @@
692
 
         int found = 0;
693
 
         int eos = 0;
694
 
 
695
 
-        regex_t *re = NULL;
696
 
-        regmatch_t re_result[LS_REG_MATCH];
697
 
+        ap_regex_t *re = NULL;
698
 
+        ap_regmatch_t re_result[LS_REG_MATCH];
699
 
 
700
 
         /* Compile the output format of "ls -s1" as a fallback for non-unix ftp listings */
701
 
-        re = ap_pregcomp(p, LS_REG_PATTERN, REG_EXTENDED);
702
 
+        re = ap_pregcomp(p, LS_REG_PATTERN, AP_REG_EXTENDED);
703
 
         ap_assert(re != NULL);
704
 
 
705
 
         /* get a complete line */
706
 
diff -urN build-tree.orig/apache2/modules/ssl/ssl_expr_eval.c build-tree/apache2/modules/ssl/ssl_expr_eval.c
707
 
--- build-tree.orig/apache2/modules/ssl/ssl_expr_eval.c 2005-02-04 13:21:18.000000000 -0700
708
 
+++ build-tree/apache2/modules/ssl/ssl_expr_eval.c      2005-02-09 11:25:13.000000000 -0700
709
 
@@ -126,24 +126,24 @@
710
 
             ssl_expr *e1;
711
 
             ssl_expr *e2;
712
 
             char *word;
713
 
-            regex_t *regex;
714
 
+            ap_regex_t *regex;
715
 
 
716
 
             e1 = (ssl_expr *)node->node_arg1;
717
 
             e2 = (ssl_expr *)node->node_arg2;
718
 
             word = ssl_expr_eval_word(r, e1);
719
 
-            regex = (regex_t *)(e2->node_arg1);
720
 
+            regex = (ap_regex_t *)(e2->node_arg1);
721
 
             return (ap_regexec(regex, word, 0, NULL, 0) == 0);
722
 
         }
723
 
         case op_NRE: {
724
 
             ssl_expr *e1;
725
 
             ssl_expr *e2;
726
 
             char *word;
727
 
-            regex_t *regex;
728
 
+            ap_regex_t *regex;
729
 
 
730
 
             e1 = (ssl_expr *)node->node_arg1;
731
 
             e2 = (ssl_expr *)node->node_arg2;
732
 
             word = ssl_expr_eval_word(r, e1);
733
 
-            regex = (regex_t *)(e2->node_arg1);
734
 
+            regex = (ap_regex_t *)(e2->node_arg1);
735
 
             return !(ap_regexec(regex, word, 0, NULL, 0) == 0);
736
 
         }
737
 
         default: {
738
 
diff -urN build-tree.orig/apache2/modules/ssl/ssl_expr_parse.c build-tree/apache2/modules/ssl/ssl_expr_parse.c
739
 
--- build-tree.orig/apache2/modules/ssl/ssl_expr_parse.c        2005-02-07 10:23:43.000000000 -0700
740
 
+++ build-tree/apache2/modules/ssl/ssl_expr_parse.c     2005-02-09 11:25:13.000000000 -0700
741
 
@@ -818,9 +818,9 @@
742
 
 case 24:
743
 
 #line 148 "ssl_expr_parse.y"
744
 
 { 
745
 
-                regex_t *regex;
746
 
+                ap_regex_t *regex;
747
 
                 if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, 
748
 
-                                         REG_EXTENDED|REG_NOSUB)) == NULL) {
749
 
+                                         AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) {
750
 
                     ssl_expr_error = "Failed to compile regular expression";
751
 
                     YYERROR;
752
 
                     regex = NULL;
753
 
@@ -831,9 +831,9 @@
754
 
 case 25:
755
 
 #line 158 "ssl_expr_parse.y"
756
 
 {
757
 
-                regex_t *regex;
758
 
+                ap_regex_t *regex;
759
 
                 if ((regex = ap_pregcomp(ssl_expr_info.pool, ssl_expr_yyvsp[0].cpVal, 
760
 
-                                         REG_EXTENDED|REG_NOSUB|REG_ICASE)) == NULL) {
761
 
+                                         AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) {
762
 
                     ssl_expr_error = "Failed to compile regular expression";
763
 
                     YYERROR;
764
 
                     regex = NULL;
765
 
diff -urN build-tree.orig/apache2/modules/ssl/ssl_expr_parse.y build-tree/apache2/modules/ssl/ssl_expr_parse.y
766
 
--- build-tree.orig/apache2/modules/ssl/ssl_expr_parse.y        2005-02-07 10:23:36.000000000 -0700
767
 
+++ build-tree/apache2/modules/ssl/ssl_expr_parse.y     2005-02-09 11:25:13.000000000 -0700
768
 
@@ -112,18 +112,18 @@
769
 
           ;
770
 
 
771
 
 regex     : T_REGEX { 
772
 
-                regex_t *regex;
773
 
+                ap_regex_t *regex;
774
 
                 if ((regex = ap_pregcomp(ssl_expr_info.pool, $1, 
775
 
-                                         REG_EXTENDED|REG_NOSUB)) == NULL) {
776
 
+                                         AP_REG_EXTENDED|AP_REG_NOSUB)) == NULL) {
777
 
                     ssl_expr_error = "Failed to compile regular expression";
778
 
                     YYERROR;
779
 
                 }
780
 
                 $$ = ssl_expr_make(op_Regex, regex, NULL);
781
 
             }
782
 
           | T_REGEX_I {
783
 
-                regex_t *regex;
784
 
+                ap_regex_t *regex;
785
 
                 if ((regex = ap_pregcomp(ssl_expr_info.pool, $1, 
786
 
-                                         REG_EXTENDED|REG_NOSUB|REG_ICASE)) == NULL) {
787
 
+                                        AP_REG_EXTENDED|AP_REG_NOSUB|AP_REG_ICASE)) == NULL) {
788
 
                     ssl_expr_error = "Failed to compile regular expression";
789
 
                     YYERROR;
790
 
                 }
791
 
diff -urN build-tree.orig/apache2/server/Makefile.in build-tree/apache2/server/Makefile.in
792
 
--- build-tree.orig/apache2/server/Makefile.in  2005-02-04 10:40:14.000000000 -0700
793
 
+++ build-tree/apache2/server/Makefile.in       2005-02-09 11:25:13.000000000 -0700
794
 
@@ -13,7 +13,7 @@
795
 
        util_script.c util_md5.c util_cfgtree.c util_ebcdic.c util_time.c \
796
 
        rfc1413.c connection.c listen.c \
797
 
        mpm_common.c util_charset.c util_debug.c util_xml.c \
798
 
-       util_filter.c exports.c buildmark.c \
799
 
+       util_filter.c util_pcre.c exports.c buildmark.c \
800
 
        scoreboard.c error_bucket.c protocol.c core.c request.c provider.c \
801
 
        eoc_bucket.c
802
 
 
803
 
diff -urN build-tree.orig/apache2/server/core.c build-tree/apache2/server/core.c
804
 
--- build-tree.orig/apache2/server/core.c       2005-02-04 13:21:18.000000000 -0700
805
 
+++ build-tree/apache2/server/core.c    2005-02-09 11:25:13.000000000 -0700
806
 
@@ -1618,7 +1618,7 @@
807
 
  */
808
 
 
809
 
 #ifdef WIN32
810
 
-#define USE_ICASE REG_ICASE
811
 
+#define USE_ICASE AP_REG_ICASE
812
 
 #else
813
 
 #define USE_ICASE 0
814
 
 #endif
815
 
@@ -1640,7 +1640,7 @@
816
 
     char *old_path = cmd->path;
817
 
     core_dir_config *conf;
818
 
     ap_conf_vector_t *new_dir_conf = ap_create_per_dir_config(cmd->pool);
819
 
-    regex_t *r = NULL;
820
 
+    ap_regex_t *r = NULL;
821
 
     const command_rec *thiscmd = cmd->cmd;
822
 
 
823
 
     const char *err = ap_check_cmd_context(cmd,
824
 
@@ -1669,13 +1669,13 @@
825
 
         cmd->path = ap_getword_conf(cmd->pool, &arg);
826
 
         if (!cmd->path)
827
 
             return "<Directory ~ > block must specify a path";
828
 
-        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
829
 
+        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED|USE_ICASE);
830
 
         if (!r) {
831
 
             return "Regex could not be compiled";
832
 
         }
833
 
     }
834
 
     else if (thiscmd->cmd_data) { /* <DirectoryMatch> */
835
 
-        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
836
 
+        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED|USE_ICASE);
837
 
         if (!r) {
838
 
             return "Regex could not be compiled";
839
 
         }
840
 
@@ -1740,7 +1740,7 @@
841
 
     int old_overrides = cmd->override;
842
 
     char *old_path = cmd->path;
843
 
     core_dir_config *conf;
844
 
-    regex_t *r = NULL;
845
 
+    ap_regex_t *r = NULL;
846
 
     const command_rec *thiscmd = cmd->cmd;
847
 
     ap_conf_vector_t *new_url_conf = ap_create_per_dir_config(cmd->pool);
848
 
     const char *err = ap_check_cmd_context(cmd,
849
 
@@ -1759,14 +1759,14 @@
850
 
     cmd->override = OR_ALL|ACCESS_CONF;
851
 
 
852
 
     if (thiscmd->cmd_data) { /* <LocationMatch> */
853
 
-        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
854
 
+        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED);
855
 
         if (!r) {
856
 
             return "Regex could not be compiled";
857
 
         }
858
 
     }
859
 
     else if (!strcmp(cmd->path, "~")) {
860
 
         cmd->path = ap_getword_conf(cmd->pool, &arg);
861
 
-        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
862
 
+        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED);
863
 
         if (!r) {
864
 
             return "Regex could not be compiled";
865
 
         }
866
 
@@ -1804,7 +1804,7 @@
867
 
     int old_overrides = cmd->override;
868
 
     char *old_path = cmd->path;
869
 
     core_dir_config *conf;
870
 
-    regex_t *r = NULL;
871
 
+    ap_regex_t *r = NULL;
872
 
     const command_rec *thiscmd = cmd->cmd;
873
 
     core_dir_config *c = mconfig;
874
 
     ap_conf_vector_t *new_file_conf = ap_create_per_dir_config(cmd->pool);
875
 
@@ -1827,14 +1827,14 @@
876
 
     }
877
 
 
878
 
     if (thiscmd->cmd_data) { /* <FilesMatch> */
879
 
-        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
880
 
+        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED|USE_ICASE);
881
 
         if (!r) {
882
 
             return "Regex could not be compiled";
883
 
         }
884
 
     }
885
 
     else if (!strcmp(cmd->path, "~")) {
886
 
         cmd->path = ap_getword_conf(cmd->pool, &arg);
887
 
-        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
888
 
+        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED|USE_ICASE);
889
 
         if (!r) {
890
 
             return "Regex could not be compiled";
891
 
         }
892
 
diff -urN build-tree.orig/apache2/server/request.c build-tree/apache2/server/request.c
893
 
--- build-tree.orig/apache2/server/request.c    2005-02-04 13:21:18.000000000 -0700
894
 
+++ build-tree/apache2/server/request.c 2005-02-09 11:25:13.000000000 -0700
895
 
@@ -1040,7 +1040,7 @@
896
 
                 continue;
897
 
             }
898
 
 
899
 
-            if (ap_regexec(entry_core->r, r->filename, 0, NULL, REG_NOTEOL)) {
900
 
+            if (ap_regexec(entry_core->r, r->filename, 0, NULL, AP_REG_NOTEOL)) {
901
 
                 continue;
902
 
             }
903
 
 
904
 
diff -urN build-tree.orig/apache2/server/util.c build-tree/apache2/server/util.c
905
 
--- build-tree.orig/apache2/server/util.c       2005-02-04 13:21:18.000000000 -0700
906
 
+++ build-tree/apache2/server/util.c    2005-02-09 11:25:13.000000000 -0700
907
 
@@ -256,16 +256,16 @@
908
 
 
909
 
 static apr_status_t regex_cleanup(void *preg)
910
 
 {
911
 
-    regfree((regex_t *) preg);
912
 
+    ap_regfree((ap_regex_t *) preg);
913
 
     return APR_SUCCESS;
914
 
 }
915
 
 
916
 
-AP_DECLARE(regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
917
 
+AP_DECLARE(ap_regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
918
 
                                    int cflags)
919
 
 {
920
 
-    regex_t *preg = apr_palloc(p, sizeof(regex_t));
921
 
+    ap_regex_t *preg = apr_palloc(p, sizeof *preg);
922
 
 
923
 
-    if (regcomp(preg, pattern, cflags)) {
924
 
+    if (ap_regcomp(preg, pattern, cflags)) {
925
 
         return NULL;
926
 
     }
927
 
 
928
 
@@ -275,9 +275,9 @@
929
 
     return preg;
930
 
 }
931
 
 
932
 
-AP_DECLARE(void) ap_pregfree(apr_pool_t *p, regex_t * reg)
933
 
+AP_DECLARE(void) ap_pregfree(apr_pool_t *p, ap_regex_t * reg)
934
 
 {
935
 
-    regfree(reg);
936
 
+    ap_regfree(reg);
937
 
     apr_pool_cleanup_kill(p, (void *) reg, regex_cleanup);
938
 
 }
939
 
 
940
 
@@ -344,25 +344,6 @@
941
 
     return bigstring;
942
 
 }
943
 
 
944
 
-/* 
945
 
- * Apache stub function for the regex libraries regexec() to make sure the
946
 
- * whole regex(3) API is available through the Apache (exported) namespace.
947
 
- * This is especially important for the DSO situations of modules.
948
 
- * DO NOT MAKE A MACRO OUT OF THIS FUNCTION!
949
 
- */
950
 
-AP_DECLARE(int) ap_regexec(regex_t *preg, const char *string,
951
 
-                           size_t nmatch, regmatch_t pmatch[], int eflags)
952
 
-{
953
 
-    return regexec(preg, string, nmatch, pmatch, eflags);
954
 
-}
955
 
-
956
 
-AP_DECLARE(size_t) ap_regerror(int errcode, const regex_t *preg, char *errbuf,
957
 
-                               size_t errbuf_size)
958
 
-{
959
 
-    return regerror(errcode, preg, errbuf, errbuf_size);
960
 
-}
961
 
-
962
 
-
963
 
 /* This function substitutes for $0-$9, filling in regular expression
964
 
  * submatches. Pass it the same nmatch and pmatch arguments that you
965
 
  * passed ap_regexec(). pmatch should not be greater than the maximum number
966
 
@@ -379,7 +360,7 @@
967
 
 
968
 
 AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input,
969
 
                               const char *source, size_t nmatch,
970
 
-                              regmatch_t pmatch[])
971
 
+                              ap_regmatch_t pmatch[])
972
 
 {
973
 
     const char *src = input;
974
 
     char *dest, *dst;
975
 
diff -urN build-tree.orig/apache2/server/util_pcre.c build-tree/apache2/server/util_pcre.c
976
 
--- build-tree.orig/apache2/server/util_pcre.c  1969-12-31 17:00:00.000000000 -0700
977
 
+++ build-tree/apache2/server/util_pcre.c       2005-02-09 11:25:13.000000000 -0700
978
 
@@ -0,0 +1,220 @@
979
 
+/*************************************************
980
 
+*      Perl-Compatible Regular Expressions       *
981
 
+*************************************************/
982
 
+
983
 
+/*
984
 
+This is a library of functions to support regular expressions whose syntax
985
 
+and semantics are as close as possible to those of the Perl 5 language. See
986
 
+the file Tech.Notes for some information on the internals.
987
 
+
988
 
+This module is a wrapper that provides a POSIX API to the underlying PCRE
989
 
+functions.
990
 
+
991
 
+Written by: Philip Hazel <ph10@cam.ac.uk>
992
 
+
993
 
+           Copyright (c) 1997-2001 University of Cambridge
994
 
+
995
 
+-----------------------------------------------------------------------------
996
 
+Permission is granted to anyone to use this software for any purpose on any
997
 
+computer system, and to redistribute it freely, subject to the following
998
 
+restrictions:
999
 
+
1000
 
+1. This software is distributed in the hope that it will be useful,
1001
 
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
1002
 
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1003
 
+
1004
 
+2. The origin of this software must not be misrepresented, either by
1005
 
+   explicit claim or by omission.
1006
 
+
1007
 
+3. Altered versions must be plainly marked as such, and must not be
1008
 
+   misrepresented as being the original software.
1009
 
+
1010
 
+4. If PCRE is embedded in any software that is released under the GNU
1011
 
+   General Purpose Licence (GPL), then the terms of that licence shall
1012
 
+   supersede any condition above with which it is incompatible.
1013
 
+-----------------------------------------------------------------------------
1014
 
+*/
1015
 
+
1016
 
+#include <stdlib.h>
1017
 
+
1018
 
+#include "ap_regex.h"
1019
 
+#include "pcre.h"
1020
 
1021
 
+#ifndef POSIX_MALLOC_THRESHOLD
1022
 
+#define POSIX_MALLOC_THRESHOLD (10)
1023
 
+#endif
1024
 
+
1025
 
+/* Table of error strings corresponding to POSIX error codes; must be
1026
 
+ * kept in synch with include/ap_regex.h's AP_REG_E* definitions. */
1027
 
+
1028
 
+static const char *const pstring[] = {
1029
 
+  "",                                /* Dummy for value 0 */
1030
 
+  "internal error",                  /* AP_REG_ASSERT */
1031
 
+  "failed to get memory",            /* AP_REG_ESPACE */
1032
 
+  "bad argument",                    /* AP_REG_INVARG */
1033
 
+  "match failed"                     /* AP_REG_NOMATCH */
1034
 
+};
1035
 
+
1036
 
+AP_DECLARE(size_t) ap_regerror(int errcode, const ap_regex_t *preg, 
1037
 
+                               char *errbuf, size_t errbuf_size)
1038
 
+{
1039
 
+const char *message, *addmessage;
1040
 
+size_t length, addlength;
1041
 
+
1042
 
+message = (errcode >= (int)(sizeof(pstring)/sizeof(char *)))?
1043
 
+  "unknown error code" : pstring[errcode];
1044
 
+length = strlen(message) + 1;
1045
 
+
1046
 
+addmessage = " at offset ";
1047
 
+addlength = (preg != NULL && (int)preg->re_erroffset != -1)?
1048
 
+  strlen(addmessage) + 6 : 0;
1049
 
+
1050
 
+if (errbuf_size > 0)
1051
 
+  {
1052
 
+  if (addlength > 0 && errbuf_size >= length + addlength)
1053
 
+    sprintf(errbuf, "%s%s%-6d", message, addmessage, (int)preg->re_erroffset);
1054
 
+  else
1055
 
+    {
1056
 
+    strncpy(errbuf, message, errbuf_size - 1);
1057
 
+    errbuf[errbuf_size-1] = 0;
1058
 
+    }
1059
 
+  }
1060
 
+
1061
 
+return length + addlength;
1062
 
+}
1063
 
+
1064
 
+
1065
 
+
1066
 
+
1067
 
+/*************************************************
1068
 
+*           Free store held by a regex           *
1069
 
+*************************************************/
1070
 
+
1071
 
+AP_DECLARE(void) ap_regfree(ap_regex_t *preg)
1072
 
+{
1073
 
+(pcre_free)(preg->re_pcre);
1074
 
+}
1075
 
+
1076
 
+
1077
 
+
1078
 
+
1079
 
+/*************************************************
1080
 
+*            Compile a regular expression        *
1081
 
+*************************************************/
1082
 
+
1083
 
+/*
1084
 
+Arguments:
1085
 
+  preg        points to a structure for recording the compiled expression
1086
 
+  pattern     the pattern to compile
1087
 
+  cflags      compilation flags
1088
 
+
1089
 
+Returns:      0 on success
1090
 
+              various non-zero codes on failure
1091
 
+*/
1092
 
+
1093
 
+AP_DECLARE(int) ap_regcomp(ap_regex_t *preg, const char *pattern, int cflags)
1094
 
+{
1095
 
+const char *errorptr;
1096
 
+int erroffset;
1097
 
+int options = 0;
1098
 
+
1099
 
+if ((cflags & AP_REG_ICASE) != 0) options |= PCRE_CASELESS;
1100
 
+if ((cflags & AP_REG_NEWLINE) != 0) options |= PCRE_MULTILINE;
1101
 
+
1102
 
+preg->re_pcre = pcre_compile(pattern, options, &errorptr, &erroffset, NULL);
1103
 
+preg->re_erroffset = erroffset;
1104
 
+
1105
 
+if (preg->re_pcre == NULL) return AP_REG_INVARG;
1106
 
+
1107
 
+preg->re_nsub = pcre_info(preg->re_pcre, NULL, NULL);
1108
 
+return 0;
1109
 
+}
1110
 
+
1111
 
+
1112
 
+
1113
 
+
1114
 
+/*************************************************
1115
 
+*              Match a regular expression        *
1116
 
+*************************************************/
1117
 
+
1118
 
+/* Unfortunately, PCRE requires 3 ints of working space for each captured
1119
 
+substring, so we have to get and release working store instead of just using
1120
 
+the POSIX structures as was done in earlier releases when PCRE needed only 2
1121
 
+ints. */
1122
 
+
1123
 
+#define SMALL_NMATCH 5
1124
 
+AP_DECLARE(int) ap_regexec(const ap_regex_t *preg, const char *string, size_t nmatch,
1125
 
+                           ap_regmatch_t pmatch[], int eflags)
1126
 
+{
1127
 
+int rc;
1128
 
+int options = 0;
1129
 
+/* NOTE: The code related to the "SMALL_NMATCH" optimization
1130
 
+ * currently is unique to the httpd-2.0 copy of PCRE 3.9.  I've
1131
 
+ * submitted the patch to the PCRE maintainer for inclusion in
1132
 
+ * the next PCRE release, slated for late 2002.  At that time,
1133
 
+ * we can merge the new PCRE version into the httpd-2.0/srclib
1134
 
+ * tree.  --brianp 3/20/2002
1135
 
+ */
1136
 
+int small_ovector[SMALL_NMATCH * 3];
1137
 
+int *ovector = NULL;
1138
 
+int allocated_ovector = 0;
1139
 
+
1140
 
+if ((eflags & AP_REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
1141
 
+if ((eflags & AP_REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
1142
 
+
1143
 
+#if 0
1144
 
+/* This causes a memory segfault after locking the const, thread-shared *preg 
1145
 
+ * generated at compile time, and is entirely unnecessary.
1146
 
+ */
1147
 
+((ap_regex_t *)preg->re_erroffset = (size_t)(-1);   /* Only has meaning after compile */
1148
 
+#endif
1149
 
+
1150
 
+if (nmatch > 0)
1151
 
+  {
1152
 
+    if (nmatch <= SMALL_NMATCH)
1153
 
+      {
1154
 
+      ovector = &(small_ovector[0]);
1155
 
+      }
1156
 
+    else
1157
 
+      {
1158
 
+      ovector = (int *)malloc(sizeof(int) * nmatch * 3);
1159
 
+      if (ovector == NULL) return AP_REG_ESPACE;
1160
 
+      allocated_ovector = 1;
1161
 
+      }
1162
 
+  }
1163
 
+
1164
 
+rc = pcre_exec(preg->re_pcre, NULL, string, (int)strlen(string), 0, options,
1165
 
+  ovector, nmatch * 3);
1166
 
+
1167
 
+if (rc == 0) rc = nmatch;    /* All captured slots were filled in */
1168
 
+
1169
 
+if (rc >= 0)
1170
 
+  {
1171
 
+  size_t i;
1172
 
+  for (i = 0; i < (size_t) rc; i++)
1173
 
+    {
1174
 
+    pmatch[i].rm_so = ovector[i*2];
1175
 
+    pmatch[i].rm_eo = ovector[i*2+1];
1176
 
+    }
1177
 
+  if (allocated_ovector) free(ovector);
1178
 
+  for (; i < nmatch; i++) pmatch[i].rm_so = pmatch[i].rm_eo = -1;
1179
 
+  return 0;
1180
 
+  }
1181
 
+
1182
 
+else
1183
 
+  {
1184
 
+  if (allocated_ovector) free(ovector);
1185
 
+  switch(rc)
1186
 
+    {
1187
 
+    case PCRE_ERROR_NOMATCH: return AP_REG_NOMATCH;
1188
 
+    case PCRE_ERROR_NULL: return AP_REG_INVARG;
1189
 
+    case PCRE_ERROR_BADOPTION: return AP_REG_INVARG;
1190
 
+    case PCRE_ERROR_BADMAGIC: return AP_REG_INVARG;
1191
 
+    case PCRE_ERROR_UNKNOWN_NODE: return AP_REG_ASSERT;
1192
 
+    case PCRE_ERROR_NOMEMORY: return AP_REG_ESPACE;
1193
 
+    default: return AP_REG_ASSERT;
1194
 
+    }
1195
 
+  }
1196
 
+}
1197
 
+
1198
 
+/* End of pcreposix.c */
1199
 
diff -urN build-tree.orig/apache2/srclib/pcre/Makefile.in build-tree/apache2/srclib/pcre/Makefile.in
1200
 
--- build-tree.orig/apache2/srclib/pcre/Makefile.in     2004-11-24 12:31:09.000000000 -0700
1201
 
+++ build-tree/apache2/srclib/pcre/Makefile.in  2005-02-09 11:25:13.000000000 -0700
1202
 
@@ -1,5 +1,5 @@
1203
 
 LTLIBRARY_NAME = libpcre.la
1204
 
-LTLIBRARY_SOURCES = maketables.c get.c study.c pcre.c pcreposix.c
1205
 
+LTLIBRARY_SOURCES = maketables.c get.c study.c pcre.c
1206
 
 
1207
 
 CLEAN_TARGETS = dftables chartables.c
1208
 
 DISTCLEAN_TARGETS = pcre.h pcre-config config.h config.log config.status $(CLEAN_TARGETS)