reorder the code in mod_rewrite.c in order to get a rid of
the forward declaration. Cleaned up the comments as well.
No real code change, but a quite big diff ...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100792 13f79535-47bb-0310-9956-ffa450edef68
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
+ 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
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
- 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
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
which broke the build on Win32
mod_rewrite.h didn't spit out the decl of lookup_map_dbmfile
if NO_DBM_REWRITEMAP was still defined, and mod_rewrite.dsp
continued to define NO_DBM_REWRITEMAP
Reported by: Jerry Baker <jerrybaker@attbi.com>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96483 13f79535-47bb-0310-9956-ffa450edef68
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
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
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
just use that information later. I was having a problem with prg
directives with arguments failing the configuration. The problem was
a call to stat, which was being passed the program name and the arguments.
Obviously, the arguments were messing up the call to stat. This gets the
test suite working for me again.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95372 13f79535-47bb-0310-9956-ffa450edef68
can't just apr_stat in the first init round because we haven't run
apr_tokenize_to_argv() yet, and it would be a relatively ugly hack to run
it twice just for that. Well, I suppose we could store the argv in the
rewritemap structure, but ... nah. With this, we shutdown (cleanly, as
opposed to the old exit(1) method) if we go to execute a rewritemap
and discover it doesn't exist, and log a nice descriptive message at the
end of the error_log.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95337 13f79535-47bb-0310-9956-ffa450edef68
silently failing when locking/unlocking the mutex, since httpd
child processes didn't have permissions to access the root-created
semaphore.
PR: 8143
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94969 13f79535-47bb-0310-9956-ffa450edef68
causing the server not to start.
previous method was to call exit(1) which would not fail
gracefully
PR:
Obtained from:
Submitted by:
Reviewed by: (Idea only Jeff Trawick)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92144 13f79535-47bb-0310-9956-ffa450edef68
1) we're using an apr_time_t file mtime, but trying to fit it in
a time_t entry in the cache and in parameters to the cache
access routines; use apr_time_t everywhere
2) we need to use apr_fileperms_t instead of mode_t for APR
file permissions
PR: 6980
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88443 13f79535-47bb-0310-9956-ffa450edef68
- explicitly include apr_lib.h since ap_config.h doesn't
- use apr_want.h where possible
- use APR_HAVE_ where possible
- remove some unneeded includes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88060 13f79535-47bb-0310-9956-ffa450edef68
I broke mod_rewrite by modifying strings in place when expanding them,
because variable lookups can cause subrequests which cause mod_rewrite
to do its stuff again including an expansion on the same string, which
is then syntactically invalid. So copy the lookup keys somewhere else
before using them in such a way that may cause recursion.
In addition to this, my parser could also be confused by complicated
nested rewrite map expansions like ${map1:${map2:key|dflt}|dflt} so
fix that too by keeping track of {} when looking for |.
PR: 7087
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87723 13f79535-47bb-0310-9956-ffa450edef68
rewrite map lookup keys and default values are now expanded
so that the lookup can depend on the requested URI etc.
Because the new code is recursive you can now write configurations
like the following (with nested map lookups) which wasn't directly
possible before -- you had to use a RewriteCond and a %N backref
instead, as in http://www.apache.org/docs/vhosts/mass.html#xtra-conf
RewriteMap tolower int:tolower
RewriteMap host2user txt:/home/www/conf/virtusertbl
RewriteRule /(.*) /home/${host2user:${tolower:%{HTTP_HOST}}|www}/public_html
PR: 6671
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86638 13f79535-47bb-0310-9956-ffa450edef68
If the result of a RewriteRule is a filename that contains expansion
specifiers, especially regexp backreferences $0..$9 and %0..%9, then it
may be possible for an attacker to access any file on the web server.
The fix replaces a multi-pass string expander with a one-pass expander,
and includes the code quality improvements that were committed separately
to 1.3.
Message-Id: <E13OQB5-0004Xs-00@hand.dotat.at>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86302 13f79535-47bb-0310-9956-ffa450edef68
including any files. Because of this change, other files must include
their own headers. I also cleaned up a couple of other bugs in some
modules because I had to compile them all.
I expect this to break multiple platforms, but this will be fixed over time.
The massive configure cleanup is almost done. I will go through the files
one more time after this commit.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85553 13f79535-47bb-0310-9956-ffa450edef68