1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

371 Commits

Author SHA1 Message Date
André Malo
70d30b01f0 minor optimization.
this avoids a variable on stack and some internal
pointer operations.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100774 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 19:50:45 +00:00
André Malo
ce50cb7bcc remove outdated comments about different regex libs
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100773 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 19:39:11 +00:00
André Malo
7f68f45af6 optimization/cleanup.
The generic flagparser (read: lexer) for RewriteRules and RewriteConds
does the same except for one function call.
Collapse these to functions to one and make the result more
readable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100772 13f79535-47bb-0310-9956-ffa450edef68
2003-07-24 19:06:33 +00:00
André Malo
2f283a1dcd don't compute the strlen of dconf->directory three times
Submitted by: Justin


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100744 13f79535-47bb-0310-9956-ffa450edef68
2003-07-23 13:32:14 +00:00
André Malo
279a27db23 when prefixing document root, use the core translator instead
of baking our own. The core function is much better maintained
and probably more safe.
Additionally this removes just another fixed buffer :)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100681 13f79535-47bb-0310-9956-ffa450edef68
2003-07-18 00:38:44 +00:00
André Malo
8af17391ee step two: get a rid of the old do_expand function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100676 13f79535-47bb-0310-9956-ffa450edef68
2003-07-17 21:22:50 +00:00
André Malo
b0572362e9 optimization; rewrite the do_expand function in order to:
+ give it a better interface
  + get a rid of most of the fixed stack buffers and then
  + no longer limit rewritten uris, expanded variables etc to
    2k
  + make it better readable and understandable at all.

This is a two-tiered commit for better diffs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100675 13f79535-47bb-0310-9956-ffa450edef68
2003-07-17 21:18:02 +00:00
André Malo
c80f883337 add some linebreaks and reorder case alphabetically for better
readability. No code changes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100652 13f79535-47bb-0310-9956-ffa450edef68
2003-07-16 19:01:05 +00:00
André Malo
3aae3ae057 optimization: no need to use the pool here. This is
obviously a static value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100651 13f79535-47bb-0310-9956-ffa450edef68
2003-07-16 18:23:37 +00:00
André Malo
1991286e67 optimization:
- add comment about what subst_prefix_path function does
- reduce the use of fixed buffers
- get a rid of unnecessary memory operations


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100650 13f79535-47bb-0310-9956-ffa450edef68
2003-07-16 17:27:26 +00:00
André Malo
9a685a36ed optimization: speed up ruleflag parsing.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100645 13f79535-47bb-0310-9956-ffa450edef68
2003-07-16 01:04:23 +00:00
André Malo
1af42640c5 optimization: no need to search linear for headers.
apr_table_get should be more efficient nearly always.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100644 13f79535-47bb-0310-9956-ffa450edef68
2003-07-15 23:30:40 +00:00
André Malo
4bf361a0e9 optimization: rewrite reduce_uri function:
get a rid of static buffers and unnecessary memory operations


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100643 13f79535-47bb-0310-9956-ffa450edef68
2003-07-15 22:29:38 +00:00
André Malo
606c7d4243 minor optimization. No need to use a function overhead here.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100637 13f79535-47bb-0310-9956-ffa450edef68
2003-07-15 20:38:04 +00:00
Paul J. Reder
4afe1d7747 Namespace protected the table label.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100634 13f79535-47bb-0310-9956-ffa450edef68
2003-07-15 18:43:41 +00:00
André Malo
742a08e311 Ignore RewriteRules in .htaccess files if the directory
containing the .htaccess file is requested without a trailing slash.

PR:	20195


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100632 13f79535-47bb-0310-9956-ffa450edef68
2003-07-15 17:49:03 +00:00
Paul J. Reder
cbf0523733 Remove some extraneous code committed as part of the fix for 13946 pointed
out by Andre Malo. [Paul J. Reder]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100615 13f79535-47bb-0310-9956-ffa450edef68
2003-07-14 19:30:14 +00:00
Paul J. Reder
0c1c05d572 mod_rewrite: fix a problem in the proxy support of mod_rewrite. The broken
code was inserting multiple "proxy:" fields in the rewritten URIs.
[Submitted by:  Eider Oliveira <eider@bol.com.br>]
[Updated and reviewed by: Paul J. Reder]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100600 13f79535-47bb-0310-9956-ffa450edef68
2003-07-14 16:40:13 +00:00
Jeff Trawick
8f0cd048e0 Unix: Handle permissions settings for flock-based mutexes in
unixd_set_global|proc_mutex_perms().  Allow the functions to be
called for any type of mutex.

This resolves a fatal problem with mod_rewrite on systems where
APR uses flock-based mutex.

It simplifies mod_ssl as well, which had special logic to perform
the chown().  It fixed an init error with mod_ssl on systems where
flock is used when the user had no SSLMutex directive.

The Unix MPMs continue to call unixd_set_global|proc_mutex_perms()
only for SysV sems.  There is no permission problem with flock-based
accept mutexes since the child init logic for the MPMs is done
prior to switching identity.

PR:              20312


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100189 13f79535-47bb-0310-9956-ffa450edef68
2003-06-07 19:50:01 +00:00
Jeff Trawick
d7d7c6a73e mod_rewrite: Perform child initialization on the rewrite log lock.
This fixes a log corruption issue when flock-based serialization
is used (e.g., FreeBSD).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100187 13f79535-47bb-0310-9956-ffa450edef68
2003-06-07 13:09:10 +00:00
André Malo
87bb42c589 fix LA-U lookaheads in directory context.
I'm wondering if this ever worked ...

PR: 8493 (related to)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99902 13f79535-47bb-0310-9956-ffa450edef68
2003-05-17 22:28:23 +00:00
André Malo
5c7b03d75b Make sure that mod_rewrite's type checker is evaluated before mod_mime.
PR: 19626


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99704 13f79535-47bb-0310-9956-ffa450edef68
2003-05-04 18:31:18 +00:00
William A. Rowe Jr
1e7b7d79bb SECURITY: Eliminated leaks of several file descriptors to child
processes, such as CGI scripts.

PR: 17206
Submitted by:	Christian Kratzer <ck@cksoft.de>, Bjoern A. Zeeb <bz@zabbadoz.net>
Reviewed by:	Joe Orton, Will Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99032 13f79535-47bb-0310-9956-ffa450edef68
2003-03-20 21:50:40 +00:00
André Malo
811bb3ecab Prevent endless loops of internal redirects in mod_rewrite by
aborting after exceeding a limit of internal redirects. The
limit defaults to 10 and can be changed using the RewriteOptions
directive with the new MaxRedirects=n argument.
(The latter required some restructuring of the RewriteOptions
 evaluation code).

(Documentation patch follows asap)

PR: 17462


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98863 13f79535-47bb-0310-9956-ffa450edef68
2003-03-01 18:35:50 +00:00
Jeff Trawick
5261b44556 mod_rewrite: Fix some problems reporting errors with mapping
programs (RewriteMap prg:/something).

the wrong field was specified when trying to log the name of
the program that couldn't be started

recent APR features used to provide better error reporting
on systems where apr_proc_create() uses fork()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98840 13f79535-47bb-0310-9956-ffa450edef68
2003-02-28 13:13:39 +00:00
André Malo
5cede9cd45 Fix mod_rewrite's abs_URI handling.
- uris were partially not correctly escaped (in particular:
  ldap, news, mailto)
- not all uri schemes contain an authority component (//)
- add nntp:// scheme
- don't add a query string (and drop r->args) if it's not
  http or mailto scheme
- be more efficient (think so)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98808 13f79535-47bb-0310-9956-ffa450edef68
2003-02-27 02:50:04 +00:00
Jeff Trawick
5c6fce7f56 fix some const-ness problems which break the compile with the native
compiler for AIX (and probably HP-UX and Tru64 as well, since they
tend to be picky too)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98792 13f79535-47bb-0310-9956-ffa450edef68
2003-02-25 14:44:42 +00:00
André Malo
7addaa4a89 This is part three.
It fixes the misunderstandings between local URL paths and local
system paths. Note that mod_rewrite handles _both_.
Fixed also some comments to make the explanations more clear.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98783 13f79535-47bb-0310-9956-ffa450edef68
2003-02-24 21:55:07 +00:00
André Malo
5c89fed043 This is part two.
It fixes the prefix_stat function. (which does a stat call on the first
path segment). This function was still tailored for unix systems only.
It should work on other systems as well now.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98782 13f79535-47bb-0310-9956-ffa450edef68
2003-02-24 21:44:15 +00:00
André Malo
6c0e1bf982 Well, here comes a major fix. I've splitted the patch into 3 parts
for better understanding, what I'm doing there. This is part one.

mod_rewrite appears to be very broken in several cases, especially on
non-unix systems. However, let's start with fixing the path handling, since
it's _the_ major PITA, e.g. on win32.

This part removes _unused_ code. The condition is never true, because
"A local rewrite in per-directory context" was caught much earlier.
I'd guess this piece of code was c&p accidentally...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98781 13f79535-47bb-0310-9956-ffa450edef68
2003-02-24 21:34:51 +00:00
André Malo
73bb5423fc guess, what happens, when l == 0
theoretical case, maybe ...


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98773 13f79535-47bb-0310-9956-ffa450edef68
2003-02-23 22:04:23 +00:00
André Malo
ee1225a25e uh, oh. Fix possible 1-byte buffer overflow.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98769 13f79535-47bb-0310-9956-ffa450edef68
2003-02-23 00:05:32 +00:00
André Malo
6f1e0d8307 Hook mod_proxy's fixup before mod_rewrite's fixup, so that by
mod_rewrite proxied URLs will not be escaped accidentally by
mod_proxy's fixup.

PR: 16368


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98707 13f79535-47bb-0310-9956-ffa450edef68
2003-02-18 20:35:28 +00:00
André Malo
732d090388 catch some style issues. No code changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98669 13f79535-47bb-0310-9956-ffa450edef68
2003-02-15 02:17:21 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
André Malo
4bba29a962 allow RewriteEngine Off even if Options -FollowSymlinks is set.
PR: 12395
Reviewed by: Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98122 13f79535-47bb-0310-9956-ffa450edef68
2002-12-29 01:46:46 +00:00
Jeff Trawick
8f946ccdc8 Fix a bug with dbm rewrite maps which caused the wrong value to
be used when the key was not found in the dbm.

apr_dbm_fetch() returns APR_SUCCESS as long as there was no I/O
error.  mod_rewrite needed to look further to see if the key
was actually found.

PR 13204


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97106 13f79535-47bb-0310-9956-ffa450edef68
2002-10-04 16:57:38 +00:00
Justin Erenkrantz
6a2b11ae6e The style police just get really annoyed with this file in general.
(No code changes)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96585 13f79535-47bb-0310-9956-ffa450edef68
2002-08-30 04:47:57 +00:00
Jeff Trawick
345b9bf855 fix a type mismatch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96583 13f79535-47bb-0310-9956-ffa450edef68
2002-08-30 01:06:14 +00:00
Ian Holsman
da6a8884aa new option 'path' to the cookie
PR: 12172

Submitted by: apachecvslog@robcromwell.com (Rob Cromwell)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96581 13f79535-47bb-0310-9956-ffa450edef68
2002-08-29 23:14:52 +00:00
Ian Holsman
2ddfc425e5 just saw this bug
PR: 12181


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96579 13f79535-47bb-0310-9956-ffa450edef68
2002-08-29 22:58:52 +00:00
Ian Holsman
a7d7da0fcf shot in the arm by the style police while trying to escape
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96578 13f79535-47bb-0310-9956-ffa450edef68
2002-08-29 22:51:40 +00:00
Ian Holsman
0eb174ae52 set expiry time correctly.
set Cookie on err_headers_out, and ensure it is only set once.

PR: 12132
Submitted by:	apachecvslog@robcromwell.com (Rob Cromwell)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96577 13f79535-47bb-0310-9956-ffa450edef68
2002-08-29 22:45:13 +00:00
Jeff Trawick
c9f89b721a fix breakage of dbm maps which was introduced in the previous commit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96502 13f79535-47bb-0310-9956-ffa450edef68
2002-08-23 18:51:44 +00:00
Jeff Trawick
a424be649c add the ability to specify the dbm type (e.g., gdbm, ndbm) for
dbm rewrite maps

use dbm:filename for the default type

use dbm=TYPE:filename for a non-default type


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96493 13f79535-47bb-0310-9956-ffa450edef68
2002-08-23 12:49:08 +00:00
Jeff Trawick
c14aa6528b Change mod_rewrite to use apr-util's dbm support for dbm rewrite
maps.

For now, the SDBM dbm flavor is always used.  It won't be compatible
with dbm rewrite maps built for Apache 1.3 until apr-util supports
ndbm and mod_rewrite is changed to prefer ndbm over the built-in
sdbm.

PR:         10644


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96478 13f79535-47bb-0310-9956-ffa450edef68
2002-08-21 19:47:15 +00:00
Cliff Woolley
951ffb24ac Fix a problem whereby RewriteMap prg:'s would get out of sync due to
the inappropriate use of nonblocking reads.  Also get rid of the stderr
altogether since mod_rewrite never uses it.

PR: 9534


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96475 13f79535-47bb-0310-9956-ffa450edef68
2002-08-21 17:49:18 +00:00
Victor J. Orlikowski
d982829aa1 Continue the Bill Rowe apr_size_t crusade.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95993 13f79535-47bb-0310-9956-ffa450edef68
2002-07-10 06:01:14 +00:00
Ian Holsman
dd2ac7d1c8 new configuration option for mod_rewrite to set cookies.
configuration is like the following

RewriteRule (.*) - [CO=<cookiename>:$1:<domain>:<expiry in minutes>]

Submitted by:	Brian Degenhardt <bmd@mp3.com>
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95840 13f79535-47bb-0310-9956-ffa450edef68
2002-06-22 03:36:57 +00:00
Jeff Trawick
20881b2fa0 Fix some casting in mod_rewrite which broke random maps.
PR:           9770
Submitted by: Allan Edwards, Greg Ames, Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95611 13f79535-47bb-0310-9956-ffa450edef68
2002-06-11 14:43:04 +00:00