Jeff Trawick [Tue, 24 Oct 2000 11:38:06 +0000 (11:38 +0000)]
Back out the suexec change to mod_rewrite.c. It now builds again.
(No, it wasn't a simple issue to get the suexec patch working.)
The suexec support doesn't apply to the external mapping process,
which is not related to any particular request. Instead, [IMHO]
the external mapping process should switch to the configured user/group
that the daemon processes switch to.
Remove an attempt to fix a race condition. The attempt is not
successful, the race condition is not particularly important (people
deleting users in the middle of a request), and the attempt introduces
more thread-safeness problems. Oh, and I thought I had taken this out
already. :)
A more thorough example is appropriate. Also simplify the behavior and
always return root (/) if n < 1, which is no worse than returning elems
if n > elems.
Add a temporary pool argument to unixd_pre_config, so that it can call
APR functions (grumble). This is needed for apr_stat, which will be in
the suexec path coming up.
Ryan Bloom [Mon, 23 Oct 2000 10:46:20 +0000 (10:46 +0000)]
Make lingering close access the socket directly, instead of relying on
BUFF. This has been tested, but all we can determine is that it doesn't
fail, not that it works. This needs to be tested much better.
Bill Stoddard [Sun, 22 Oct 2000 15:48:34 +0000 (15:48 +0000)]
Correct a check to see if we are attempting to remove a filter that has
already been removed from the stack. Hummm, seems to me we should not
attempt to remove filters multiple times....
Bill Stoddard [Sun, 22 Oct 2000 15:20:08 +0000 (15:20 +0000)]
Fix problem where a 304 response was not generating an EOS bucket.
ap_finalize_request_protocol()'s sole purpose in Apache 2.0 is to
send the EOS bucket. Probably need to reimplement ap_send_error_response()
to be consistent with ap_finalize...'s new mission.
Ryan Bloom [Sat, 21 Oct 2000 14:20:14 +0000 (14:20 +0000)]
Hack headers to work semi-properly. This is a hack that will need to be
fixed, but it is good enough for now. The idea is that headers shouldn't
flow through the BUFF anymore. Now, we have a header filter that is
called at the end of the request-filter chain. This filter writes the
headers directly to the connection filters.
Jeff Trawick [Sat, 21 Oct 2000 14:07:41 +0000 (14:07 +0000)]
Get translation of request bodies working.
This code is pretty ugly, but I need to checkpoint (and this stuff
actually works).
The direction: Get xlate_brigade() working for output too, then
kill the analogous code in xlate_out_filter(). At that point, the
same translation code works for input and output.
Tony Finch [Thu, 19 Oct 2000 19:24:51 +0000 (19:24 +0000)]
Belatedly update the documentation to include the NameVirtualHost *
stuff. This isn't quite a sync with the 1.3 docco because we don't
want to mention 1.3 in the 2.0 docs.
Tony Finch [Thu, 19 Oct 2000 19:15:14 +0000 (19:15 +0000)]
Belatedly update the documentation to include the NameVirtualHost *
stuff. This isn't quite a sync with the 1.3 docco because we don't
want to mention 1.3 in the 2.0 docs.
Greg Stein [Thu, 19 Oct 2000 10:43:03 +0000 (10:43 +0000)]
somebody was a Very Bad Boy when they inserted casts into this function.
casting away the const was absolutely wrong... the warnings were saying the
return value type needed to be fixed. did that and torched the casts.
Tony Finch [Thu, 19 Oct 2000 00:40:57 +0000 (00:40 +0000)]
Update to the media types as of 2000-10-19. I also fixed the case of
application/batch-SMTP to match the official name.
Obtained from: ftp://ftp.isi.edu/in-notes/iana/assignments/media-types
PR: 6613
Ryan Bloom [Wed, 18 Oct 2000 22:14:18 +0000 (22:14 +0000)]
Sub-requests have to have a value for their request_config structure,
or we'll seg-fault. This should set the sub-request's request_config
structure to the same exact same structure as the main request is using.
Ryan Bloom [Wed, 18 Oct 2000 19:32:30 +0000 (19:32 +0000)]
Make the core access the socket directly instead of going through the
BUFF. This doesn't actually change any behavior, it just makes the core
access socket directly.
Ryan Bloom [Wed, 18 Oct 2000 19:12:16 +0000 (19:12 +0000)]
This begins to remove BUFF from the server. The idea is to go very slowly
with this. To begin with, we store both the socket and the BUFF in the
conn_rec. Functions are free to use which ever they want, in the end all
of the data goes to the same place. This modifies all of the MPMs except
Windows. All of the Unix MPMs are working, but the others need to be
tested.
Ryan Bloom [Wed, 18 Oct 2000 18:50:11 +0000 (18:50 +0000)]
We have to create the core_request_config structure in the core on internal
redirects. If this isn't done, we'll seg-fault during the AP_DEBUG_ASSERT
that makes sure getline didn't leave any droppings.
Jeff Trawick [Wed, 18 Oct 2000 17:42:44 +0000 (17:42 +0000)]
ap_get_client_block() now uses a brigade in core_request_config
instead of a brigade in core_dir_conf. For now, getline() and
ap_get_client_block() share a brigade.
Ryan Bloom [Wed, 18 Oct 2000 15:58:29 +0000 (15:58 +0000)]
The final line of the config file was not being read if there was
no \n at the end of it. This was caused by apr_fgets returning
APR_EOF even though we had read valid data. This is solved by
making cfg_getline check the buff that was returned from apr_fgets.
If apr_fgets return APR_EOF, but there was data in the buf, then we
return the buf, otherwise we return NULL.
Greg Ames [Wed, 18 Oct 2000 15:21:32 +0000 (15:21 +0000)]
Add a core_request_config so we have a safe semi-hidden place to save core data
that lives across function calls during a single request. Change getline() to
take a request_rec parm (rather than a conn_rec) so we can access the
core_request_config.
This is in preparation for adding look-ahead functionality to getline(), so it
can support header line folding once again. I'm committing these changes first
so the core_request_config can be used elsewhere (i.e. ap_get_client_block).
Ryan Bloom [Wed, 18 Oct 2000 06:09:10 +0000 (06:09 +0000)]
Fix piped logs in 2.0. This basically:
1) cleans up an annoying type that was getting in my way while I was
trying to fix things.
2) Makes some of the allocations pcalloc instead of palloc
3) The arg array passed to create_process is a const *char *, not
const *char [].
PR: 6642
Tony Finch [Wed, 18 Oct 2000 04:50:25 +0000 (04:50 +0000)]
Restore functionality broken by the mod_rewrite security fix:
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
Tony Finch [Wed, 18 Oct 2000 04:48:34 +0000 (04:48 +0000)]
Tighten up the syntax checking of Host: headers to fix a
security bug in some mass virtual hosting configurations
that can allow a remote attacker to retrieve some files
on the system that should be inaccessible. The problem
occured with requests including the line "Host: ..." --
the last dot is stripped and the remaining ".." then
reveals a parent directory.
Reported by: Peter Christoffersen <pch@mindpass.com>
Message-ID: <8quts6$2el$1@news.inet.tele.dk>
Newsgroups: comp.infosystems.www.servers.unix
Ryan Bloom [Tue, 17 Oct 2000 21:53:41 +0000 (21:53 +0000)]
Add pool buckets to the bucket list. These buckets are not currently
used although I have begun to test them on my machine. The idea behind
these buckets is that data allocated out of a pool and put into a bucket
has to survive the death of the pool until the bucket is destroyed. To
accomplish this, we register a cleanup when we create the bucket. If the
pool is cleared, the cleanup converts the bucket to a heap bucket and
everything is good. If the pool isn't cleared, then we kill the cleanup
when the bucket is destroyed.
With this bucket type, all of the core buckets that were listed have been
implemented.
Jeff Trawick [Tue, 17 Oct 2000 20:43:35 +0000 (20:43 +0000)]
ap_get_client_block() allocates its brigade from r->pool (as it was
before today) so that we don't have a growth of these across many
pipelined requests.
http_filter() uses one brigade per connection which it reads into.
As it needs to deliver buckets to the caller, they are removed from
its brigade into the caller's brigade.
Submitted by: Ryan Bloom (but anything broken is my fault)
Jeff Trawick [Tue, 17 Oct 2000 15:28:57 +0000 (15:28 +0000)]
http_filter():
when delivering body bytes, only deliver one block of data (however
much is returned by bucket read) instead of delivering the entire
body at once; this gets painful with a large body
make a note of an issue with the blocking state of the socket;
currently, the socket is non-blocking, but when reading body bytes
we should feel free to wait for body bytes until a timeout occurs;
Jeff Trawick [Tue, 17 Oct 2000 01:35:12 +0000 (01:35 +0000)]
Rename output filters field ("filters") in core_dir_config to
"output_filters" for consistency with the name of the input
filters field ("input_filters").
Ryan Bloom [Tue, 17 Oct 2000 00:24:36 +0000 (00:24 +0000)]
Add a flush bucket type. This bucket advises filters to flush any data
they are currently storing. There is no way we can force them to flush,
but we can advise. This also adds the code to ap_rflush to use flush
buckets, although it isn't enabled yet. I will enable it once we remove
buff from the code. I also removed all calls to ap_rflush that are either
immediately before or immediately after a call to ap_finalize_protocol.
ap_finalize_protocol sends an EOS bucket, which also advises filters to
flush their data, so having both calls right next to each other is
redundant.
Ryan Bloom [Mon, 16 Oct 2000 23:15:55 +0000 (23:15 +0000)]
Add a sub-request filter. This filter just strips the EOS from the
brigade generated by the sub-request. If this is not done, then the
main-request's core_output_filter will get very confused, as will any other
filter in the main-request filter-stack that looks for EOS.
Jeff Trawick [Mon, 16 Oct 2000 20:08:14 +0000 (20:08 +0000)]
dechunk filter:
Get rid of an assertion which assumed that HTTP_IN is the filter
below us. Some other filter may play the same role.
ap_setup_client_block():
Get rid of a commented-out hack which was used to allow chunked
transport encoding of a request body received by mod_cgi[d].
ap_get_client_block():
Get rid of special handling for zero-length buckets... The main
loop handles that fine.
Submitted by: Ryan Bloom
Jeff Trawick [Mon, 16 Oct 2000 19:11:53 +0000 (19:11 +0000)]
input filtering changes:
get dechunking working
verify that infrastructure for input filters works
(use existing AddInputFilter directive)
Unlike with my previous patch, ap_get_client_block() saves state between
calls in the core's per-request dir config.
Unlike with my previous patch, HTTP_IN keeps a count of remaining bytes
in the conn_rec. Code that needs to prod it to deliver a certain amount
of request body plays with conn_rec->remain directly.
Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols
for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper)
and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE.
All _VAR_ flavors changes to _DATA to be absolutely clear.
Thank you Greg, for the most obvious suggestion.