Parent Directory
|
Revision Log
| Links to HEAD: | (view) (annotate) |
| Sticky Revision: |
Security fix for CVE-2009-1195: fix Options handling such that
'AllowOverride Options=IncludesNoExec' does not permit Includes with
exec= enabled to be configured in an .htaccess file:
* include/http_core.h: Change semantics of Includes/IncludeNoExec
options bits to be additive; OPT_INCLUDES now means SSI is enabled
without exec=. OPT_INCLUDES|OPT_INC_WITH_EXEC means SSI is enabled
with exec=.
* server/core.c (create_core_dir_config): Remove defunct OPT_INCNOEXEC
from default override_opts; no functional change.
(merge_core_dir_configs): Update logic to ensure that exec= is
disabled in a context where IncludesNoexec is configured, even if
Includes-with-exec is permitted in the inherited options set.
(set_allow_opts, set_options): Update to reflect new semantics
of OPT_INCLUDES, OPT_INC_WITH_EXEC.
* server/config.c: Update to remove OPT_INCNOEXEC from default
override_opts; no functional change.
* modules/filters/mod_include.c (includes_filter): Update to reflect
new options semantics - disable exec= support if the
OPT_INC_WITH_EXEC bit is not set.
Submitted by: Jonathan Peatfield <j.s.peatfield damtp.cam.ac.uk>,
jorton
Thanks to: Vincent Danon <vdanon redhat.com>
rename the new retained-data APIs to ap_retained_data_create()/ap_retained_data_get(), for better consistency with existing APIs (e.g., slotmem) don't bother changing the MMN, which doesn't reflect recent -dev changes anyway
Provide ap_set_retained_data()/ap_get_retained_data() for preservation of module state across unload/load. The existing idiom used by modules to associate userdata with pglobal doesn't work in the earliest phases of module execution. (This does expose pglobal as an implementation detail, but it would be great to unexpose it if at all possible (but modules already have access to pglobal at almost all stages of execution anyway).)
Introduce a new set of APIs to allow MPMs to be proper modules instead of integral parts which share global variables, functions, and macros with the rest of httpd. Converted now: prefork, worker, event, simple, WinNT* *WinNT hasn't been built or tested, and relies on a hack to include the WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c
* Prevent segfaults in handlers by ensuring that r->handler != NULL.
Disabled DefaultType directive and removed ap_default_type() from core. We now exclude Content-Type from responses for which a media type has not been configured via mime.types, AddType, ForceType, or some other mechanism. MMN major bump to NZ time. PR: 13986
allow ap_invoke_handler() to pass-through AP_FILTER_ERROR as if it were a reserved status code (OK/DECLINED/SUSPENDED). Prevents ap_die() from seeing a 500 error when the http header filter has already taken care of the proper error response
Introduce Suspendable Requests to the Event MPM.
Using this basic framework, you can return SUSPENDED from an HTTP Handler,
and then register a callback that is invoked by the MPM at a later time.
This initial version only supports _timers_ as callbacks, but in the future I
would like to add things like wait for socket activity, on a socket specified by
the handler.
Once in a callback, It is then the responsibility of the callback fucntion
to finish the HTTP Request handling, but this alows you to do cool things like
a fully async proxy, COMET support, or even rate limiting.
To prove I'm not insane, I've inlcuded an example module, mod_dialup.
You can configure it like this:
<Location "/docs">
ModemStandard "V.32"
</Location>
And for static files inside that path, you will be rate limited to V.32 speeds,
aka 9.6 kilobits/second.
Does anyone besides Rüdiger read commit emails :-) ?
I know there are likely huge problems with this, but I would like to see how far
we can push the Event MPM, figure out what to do better, if there is anything,
and then really dive into the 3.0 development before ApacheCon.
* server/mpm/experimental/event/fdqueue.h:
(timer_event_t): New structure to hold timer events and callback functions.
* server/mpm/experimental/event/fdqueue.c
(ap_queue_empty): Modify to also look at Timer Ring.
(ap_queue_init): Initialize Timer Ring.
(ap_queue_push_timer): New function, pushes a timer event into the queue.
(ap_queue_pop_something): Renamed function, returns a timer event or
a socket/pool for a worker thread to run.
* server/mpm/experimental/event/event.c
(process_socket): If the connection is in SUSPENDED state, don't force it
into linger mode yet, the callback will have to take care of that.
(push_timer2worker): New shortcut function, pushes timer event into queue
for a worker to run.
(timer_free_ring): New global data structure to recycle memory used by
timer events.
(timer_ring): New global data structure to hold active timer events.
(g_timer_ring_mtx): Thread mutex to protect timer event data structures.
(ap_mpm_register_timed_callback): New Function, registers a callback to be
invoked by the MPM at a later time.
(listener_thread): Calculate our wakeup time based on the upcoming Event
Queue, and after pollset_poll runs, push any Timers that have passed
onto worker threads to run.
(worker_thread): Call new queue pop method, and if the Timer Event is
non-null, invoke the callback. Once the callback is done, push the
structure onto the timer_free_ring, to be recycled.
(child_main): Initialize new mutex and ring structures.
* server/config.c
(ap_invoke_handler): Allow SUSPENDED aa valid return code from handlers.
* modules/http/http_core.c
(ap_process_http_async_connection): Don't close the connection when in
SUSPENDED state.
* modules/http/http_request.c
(ap_process_request_after_handler): New function, body pulled from the old,
ap_process_async_request. Split to let handlers invoke this so they
don't need to know all of the details of finishing a request.
(ap_process_async_request): If the handler returns SUSPENDED, don't do
anything but return.
* include/ap_mmn.h: Bump MMN.
* include/ap_mpm.h
(ap_mpm_register_timed_callback): New function.
* include/httpd.h:
(SUSPENDED): New return code for handlers.
(request_rec::invoke_mtx): New mutex to protect callback invokcations
from being run before the original handler finishes running.
(conn_state_e): Add a suspended state.
* include/http_request.h
(ap_process_request_after_handler): New function to make it easier for
handlers to finish the HTTP Request.
* modules/test/config.m4: Add mod_dialup to build.
* modules/test/mod_dialup.c: New rate limiting module, requires the Event MPM
to work.
Remove all references to CORE_PRIVATE.
Generic fix for PR#31759 If a handler returns a value that is neither reserved nor a valid HTTP response code, log an error and substitute HTTP_INTERNAL_SERVER_ERROR. Allow a handler to override this explicitly by setting a note.
Introduce a check_config phase between pre_config and open_logs, to allow modules to review interdependent configuration directive values and adjust them while messages can still be logged to the console. The open_logs phase is already used somewhat for this purpose by certain MPMs (winnt, prefork, worker, and event) but only by forcing their functions ahead of the core ap_open_logs() function, and since this phase runs after the ap_signal_server function during startup, it can not be used to generate messages on the console when restarting. Add the check_config phase to mod_info and mod_example. Handle relevant MPM directives during this phase and format messages for both the console and the error log, as appropriate. Bounds and sanity checks on the values of the MPM directives are handled in sequence in this phase instead of in the various directive handling functions, since those functions (e.g., set_max_clients()) may not be called at all if their directives do not appear in the configuration files, and even if they are called, there is no guarantee that this will occur in any particular order. Remove from the worker and event MPMs the code in the pre_config phase that alters the configuration node tree by re-ordering ThreadsPerChild ahead of MaxClients. This code is effective but insufficient; for example, if ServerLimit follows MaxClients, the test against server_limit in set_max_clients() is invalid. (In practice, this only results in incorrect or absent warnings on the console, because server_limit is set to its configured value when the main loop re-runs the configuration process.) Prevent ap_threads_per_child from exceeding thread_limit in the winnt, worker, and event MPMs. This situation could occur if ThreadsPerChild was not specified in the configuration files and ThreadLimit was set to a value smaller than DEFAULT_THREADS_PER_CHILD, because set_threads_per_child() would never be called and therefore its bounds check against thread_limit would not be performed. Remove from the winnt, prefork, worker, and event MPMs the changed_limit_at_restart flag. Set the first_server_limit and first_thread_limit values during the first execution of the check_config function, and use them to detect changes to ServerLimit and ThreadLimit across restarts and issue appropriately formatted warnings. Remove the comments about the error log being a "bit bucket"; this was true when the code was originally committed in r92530 but that was due to a bug fixed in r92769. Be consistent about setting all MPM configuration directive values in the pre_config phase. Rephrase and reformat the console and log file messages relating to MPM configuration directives to be consistent across all MPMs. Use briefer messages when logging to the error log than to the console. Update miscellaneous stale comments and messages (e.g., reference to daemons_min_free in worker and event MPMs, "prefork open_logs" in winnt MPM, and StartServers in netware MPM). The winnt, netware, beos, and mpmt_os2 MPMs should be tested by developers with access to those platforms, especially the winnt MPM, which has unique logic with respect to distinguishing between parent and child processes during the configuration phases. Update the English documentation for the worker MPM's ThreadsPerChild directive, which no longer needs to precede other MPM directives in the configuration files if it has a non-default value. The German (.de) and Japanese (.ja) translations should be updated by developers fluent in those languages.
update license header text
Add optional 'scheme://' prefix to ServerName directive. For
'https', mod_http returns "https" for the ap_hook_http_scheme and
DEFAULT_HTTPS_PORT for ap_hook_default_port. This fixes Redirect
responses to requests for directories without a trailing slash
when httpd runs behind a proxy or offload device that processes
SSL. It also enables support for Subversion in that
configuration. This change is completely backwards compatible
and passes the perl-framework. Minor mmn bump because I add a
field to server_rec.
Update the copyright year in all .c, .h and .xml files
No functional change: remove "internal" tab spacing/formatting.
No functional Change: Removing trailing whitespace. This also means that "blank" lines consisting of just spaces or tabs are now really blank lines
- Fix style nits in the new hash config code. No Functional changes.
- Fix graceful restarts with the new hashed configuration. The hash now allocates out of the pconf pool, instead of the process pool.
- Use a hash for the configuration command lookup implementation. Now modules can properly directives without dependence on the LoadModule order.
Add AP_INIT_TAKE_ARGV. There can be some inconsistent results because of the behavoir of ap_getword_conf. Do not rely upon any last argument that is "". If the argument is in the middle of the line, it should work correctly. This is updated from the version sent to dev@httpd to fix the behavoir with 0 arguments. * include/http_config.h: minor MMN bump for the new interface. * modules/generators/mod_autoindex.c: Migrate IndexOptions to the new ARGV command type.
* server/config.c (process_resource_config_nofnmatch): Fail with useful error message if the config file can't be opened.
"misspelled" has been "mis-spelled" for quite long enough.
Update copyright year to 2005 and standardize on current copyright owner line.
general property cleanup
Implement -t -DDUMP_MODULES using generic test_config hook rather than hooking into mod_so from main.c: * include/http_config.h, server/config.c: Declare test_config hook. * server/main.c: Drop hooks into mod_so; run test_config hooks. * modules/mappers/mod_so.h: Drop ap_dump_loaded_modules optional function. * modules/mappers/mod_so.c (dump_loaded_modules): Renamed from ap_dump_loaded_modules; only run if -DDUMP_MODULES is defined. (register_hooks): Register test_config hook instead of optional function. Reviewed by: Justin Erenkrantz, Paul Querna
Allocate memory from the temp_pool rather than the stack to avoid blowing fixed length stacks while evaluating nested includes
remove tabs from my last commit.
Added 'AllowOverride Options=Indexes,MultiViews' to give an admin better control over what options can be used in .htaccess files. PR: 29310 Submitted by: Tom Alsberg <alsbergt-apache cs.huji.ac.il>
changed the following APIs to return an error instead of hard exiting: ap_add_module, ap_add_loaded_module, ap_setup_prelinked_modules, and ap_process_resource_config
ap_add_named_module is not used and maintained anymore. Drop it.
Include directives no longer refuse to process symlinks on directories. Instead there's now a maximum nesting level of included directories (128 as distributed). This is configurable at compile time using the -DAP_MAX_INCLUDE_DIR_DEPTH switch. PR: 28492
Don't allocation large buffers on the stack to avoid over-running a fixed length stack when ap_build_cont_config() is called recursively (ie. nested <IfDefine> blocks).
fix "Expected </Foo>> but saw </Foo>" errors in nested, argumentless containers.
fix name of The Apache Software Foundation
fix copyright dates according to the first check in
apply Apache License, Version 2.0
Keep focus of ITERATE and ITERATE2 on the current module when the module chooses to return DECLINE_CMD for the directive. PR: 22299
update license to 2004.
fix the config parser to support <Foo>..</Foo> containers (no arguments in the opening tag) supported by httpd 1.3. Without this change mod_perl 2.0's <Perl> sections are broken. PR: Obtained from: Submitted by: "Philippe M. Chiasson" <gozer@cpan.org> Reviewed by: stas
switch to APR 1.0 API (which is still in flux) because of the changes to the argument lists of apr_mmap_dup and apr_socket_create, 2.1-dev won't build with apr and apr-util's 0.9 branch anymore
split ap_process_resource_config into two functions (since we don't wanna change the api). Only the first one (the ap_ entry point) now checks for fnmatch and the second one will be called for every file/directory included. This, however, avoids infinite recursions, if a filename contains wildcard characters. PR: 22194
Allow restart of httpd to occur even with syntax errors in the config file. (Out-of-date DSOs with bad MMNs will still be fatal unfortunately.) Add return parameter to ap_process_config_tree - OK on success, !OK on syntax error. We will no longer call exit() from ap_process_config_tree. The caller must exit if there is an error (makes sense anyway). This allows the initial start-up code to delay the exit until trying to let the signal_server optional function execute first. (The chances are that the syntax error isn't in the PidFile directive. If that happens, we'll try the default one. Oh, well.) PR: 16813
fill out parms->err_directive while looking for open parents.
Otherwise when trying to log the error
(a) we segfault (if the directive was in another file)
(b) we show a wrong occurrence line number (start line of the previous
container) or probably segfault, too (if no previous container exists).
PR: 17093
finished that boring job: update license to 2003. Happy New Year! ;-))
Fix a typo reported by Blair Zajac <blair@orcaware.com>
ap_server_root_relative never guarenteed that the resource exists, or isn't a file pattern. Correct the code to accept these cases (applied to both 2.0 and 2.1.)
Once again, allow <Directory "C:\Users\*\html_files"> or other wildcard patterns in Directory blocks. Note a similar problem with Includes *.conf
Tweak
AddModules does not exist anymore Submitted by: Stas Bekman
Add support for using fnmatch patterns in the final path segment of an Include statement (eg.. include /foo/bar/*.conf). and remove the noise on stderr during config dir processing. Submitted by: Joe Orton <jorton@redhat.com> Reviewed by: Ian Holsman, Brian Pane
Make module loading error messages more informative Bug #11213 Obtained from: Ian Darwin <ian779@darwinsys.com> Reviewed by: Ian Holsman
Renames Pending: This clears the list of renames pending in apr-util. Parts of this list was alreadu done, but the pending list hadn't been updated. apr_hook_debug_current from apr_current_hooking_module apr_hook_debug_show from apr_show_hook apr_hook_global_pool from apr_global_hook_pool apr_hook_sort_all from apr_sort_hooks apr_uri_port_of_scheme from apr_uri_default_port_for_scheme apr_uri_unparse from apr_uri_unparse_components apr_uri_parse from apr_uri_parse_components apr_uri_parse_hostinfo from apr_uri_parse_hostinfo_components apr_uri_t from apr_uri_components All APR_URI_* from all APU_URI_* symbols All APR_UNP_* from all UNP_* symbols PR: Obtained from: Submitted by: Thom May Reviewed by:
Add a filter_init function to the filters so that a filter can execute arbitrary code before the handlers are invoked. This resolves an issue with incorrect 304s on If-Modified-Since mod_include requests since ap_meets_conditions() is not aware that this is a dynamic request and it is not possible to satisfy 304 for these requests (unless xbithack full is on, of course). When mod_include runs as a filter, it is too late to set any flag since the handler is responsible for calling ap_meets_conditions(), which it should do before generating any data. If a module doesn't need to run such arbitrary code, it can just pass NULL as the argument and all is well. PR: 9673 Reviewed by: Ryan Bloom and others
Solve the 80/20 by initializing and storing server_rec->timeout and server_rec->keep_alive_timeout in apr_time_interval_t format (in apr units, whatever they be), as both values exist to pass into APR, and all APR timeouts are in apr_time_t. Reviewed by: Cliff Woolley
A few noops (at the moment.) Prepare for stuffing the directive into the conf tree, without reinvoking the directive, even when EXEC_ON_READ.
stop using APLOG_NOERRNO in calls to ap_log_?error()
Add a new parameter to the quick_handler hook to instruct quick handlers to optionally do a lookup rather than actually serve content. This is the first of several changes required fix several problems with how quick handlers work with subrequests.
Eliminate potential ap_server_root_relative segfaults, with the input of Jeff Trawick's style changes to the first patches. Doesn't include the fixes to ssl [more complex], and we won't trap errors that involve ap_serverroot, since we presume that was normalized on the way in. Therefore, testing ap_server_root_relative(DEFAULT_FOO) cases should never become necessary.
Since noone seemed to have a real problem with it, change !! to something that raises fewer questions.
Update our copyright for this year.
Sander's Stylistic Submission PR: Obtained from: Submitted by: Reviewed by:
The pre_config hook now takes a return value. This allows modules to cause the server to bail out under error conditions.
Making sure that the global variables have been initialized to avoid linker problems at least on NetWare Submitted by: Pavel Novy
Removed a large (8KB) buffer from the stack in ap_invoke_handler()
Move the insert_filter hook from the prepare request phase to the invoke handler phase, since it can't fail, and contributes nothing to the request 'character', but everything to it's invocation.
Clean up GNU compiler issues on NetWare Submitted by: Pavel Novy
change open_logs hook to return a value, allowing you to flag a error while opening logs Obtained from: Doug MacEachern
Modify post_config hook so that it can return a error, 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)
restructured the conditional logic in ap_merge_per_dir_configs() for faster execution
Great badness - not a good idea to return OK when you don't modify the resulting value, even if it's NULL.
AFAICT, we have never created server configs of _all_ modules for _all_ contexts, only when they come up (e.g., a directive of that particular module is provided) with the except that vhost containers complete the initialization of all modules. I haven't stepped this, but it appears to be correct. This patch assures we can merge two incomplete directory sections together. They will (obviously) need to be merged with a LHS default, e.g. a vhost's or main server's default dir config. That's fine, this just allows either the LHS or RHS value to be null, and for merging to still succeed. Reported by: Sander Striker <striker@apache.org> Additional Analysis: Doug MacEachern
Overhauled ap_server_root_relative, so that it now changes any path to canonical form through apr. Also assures that a change to the ServerRoot through a -C option takes effect before locating the httpd.conf file.
Fix the new method code. We need to cast 1 to an apr_int64_t or it will be treated as a 32-bit integer, and it will wrap after being shifted 32 times. Submitted by: Cody Sherr <csherr@covalent.net> and Ryan Morgan <rmorgan@covalent.net>
Provide an ap_set_deprecated() fn for quick-and-dirty 'we don't do this' entries in the command table. (Also fixes a nit about returning a single bit of an apr_int_64 as an int. Know how this group loves !! expresssions :)
Add the ability to extend the methods that Apache understands and have those methods <limit>able in the httpd.conf. It uses the same bit mask/shifted offset as the original HTTP methods such as M_GET or M_POST, but expands the total bits from an int to an ap_int64_t to handle more bits for new request methods than an int provides. Submitted by: Cody Sherr <csherr@covalent.net>
Having gone through and expnaded out the hook macro it seemed a waste to throw it away, so here it is added as comments for people who are in the same place I was trying to debug what was going on inside a hook.
Cleanup the reporting of incorrect end tags for container directives. PR: 7617 Submitted by: Barrie Slaymaker <barries@slaysys.com>
More changes based on Ian's patch.
Add the AP_DECLARE()/AP_CORE_DECLARE macros on the return types of functions used by mod_proxy for export in DLL Submitted by: Ian Holsman <IanH@cnet.com> Reviewed by: Chuck murcko
struct_ptr is a void*. The Windows compiler doesn't like it when you try to do pointer math on a void*.
Add ap_set_int_slot() function PR: Obtained from: Submitted by: John K. Sterling <sterling@covalent.net> Reviewed by: dougm
Add more options to the ap_mpm_query function. This also allows MPMs to report if their threads are dynamic or static. Finally, this also implements a new API, ap_show_mpm, which returns the MPM that was required into the core. We tried to make all of the MPMs report their threading capabilities correctly, but each MPM expert should double check us. Submitted by: Harrie Hazewinkel <harrie@covalent.net>
Small docco fix.
Fix segfaults for configuration file syntax errors such as "<Directory>" followed by "</Directory" and "<Directory>" followed by "</Directoryz>"
Performance: Add quick_handler hook. This hook is called at the very beginning of the request processing before location_walk, translate_name, etc. This hook is useful for URI keyed content caches like Mike Abbott's Quick Shortcut Cache.
top_module global variable renamed to ap_top_module
Report unbounded containers in the config file. Previously, a typo in the </container> directive could result in the rest of the config file being silently ignored, with undesired defaults used.
Use a proper prototype for ap_show_directives() and ap_show_modules() so that they match their prototypes in http_config.h. PR: 6980
Clean up namespace badness with s/configfile_t/ap_configfile_t/
remove ap_{post_config,child_init}_hook
replace usage with ap_run_{post_config,child_init}
PR:
Obtained from:
Submitted by:
Reviewed by:
avoid c++ keywords
- more ap_conf_vector_t fixup. - break out the cmd_parms to ap_set_config_vectors to clarify/doc what is happening in there and because the function operates independent of cmds.
*) Introduce "ap_conf_vector_t" type to assist with legibility and provide some type safety. (unfortunately, our old "void*" is type-safe with the new one, but over time we should be better) *) Propagate the new type to all appropriate functions. *) Random cleaning, whitespace, stylistic nits.
Update copyright to 2001
*) continued header revamping *) torch some headers (and some libs) from the autoconf stuff
renaming various functions for consistency sake see: http://apr.apache.org/~dougm/apr_rename.pl PR: Obtained from: Submitted by: Reviewed by:
back out recent breakage. If the lstat isn't executed, finfo isn't initialized, and the code was looking at random garbage. This gets the server a little closer to starting on apache.org. There's still an issue with mod_include not resolving apr_get_username when it's dynamically loaded. Submitted by: Jeff Trawick
Use the appropriate APR_FINFO_flags for the apr_stat/lstat/getfileinfo calls to avoid ownership and permissions on Win32 when they are not required, and until they are implemented.
Add support for type-safe optional functions.
The current hooking module is _not_ a debugging aid.
Accomodate the change to the apr_read_dir() arguments, and change all apr_dirfoo() and apr_foodir() commands to apr_dir_foo() to match the earlier-renamed apr_dir_open().
Remove AddModule and ClearModuleList. Neither directive really makes much sense anymore, since we use the hooks to order modules correctly. This also removes the possability that one module will ever register the same function for the same hook twice.
Add a call to apr_hook_deregister_all() in the clear_module_list function. The basic problem was that when we load the modules, we call the register_hooks() function from the module, but then we clear the module list for all active modules, and add them back in one at a time. When we add them back, we re-call the register_hooks() function, thus adding each function a second time. This was causing apache.org to log every request twice in the access log. By calling apr_hook_deregister_all() when we unload the module, the second call to register the hooks is the only call that matters.
The changes required for the APR_FINFO_wanted argument to apr_stat/lstat/getfileinfo. These are -NOT- optimal, they are simply the required changes to get the server working. The size of the patch is a warning about how we need to really look at what we are trying to accomplish with all of these stat/lstat calls.
The only symbol dropped, not counting regcomp regerror regexec regfree which aren't namespace protected in the first place.
The big change. This is part 3 of the apr-util symbols rename, please see the first commit of srclib/apr-util/include (cvs apr-util/include) for the quick glance at symbols changed.
Provide apr_pool_t arg to register_hooks, since anything they do in that step -must- be done with a pool that will not outlive the cmd pool, from which they may have been dynamically loaded. This needs further review, it's committed only as a stopgap for those who's builds I broke, sorry. Review tbc late this evening.
get rid of some bogus uses of perror()
adjust remaining modules to use the new handler hook method (Alan Edwards) bring back the old handler prototype by reusing r->handler (dougm) PR: Obtained from: Submitted by: Reviewed by:
Keep Greg happy.
Strip trailing stuff from mime types.
Make handlers use hooks.
add pool parameter to ap_is_directory and ap_is_rdirectory
Stop copying file names that we get from apr_file_t's and apr_dir_t's. We copy the data when we store it in the structures, we can just return a pointer from there, and use const data. This puts the onus back on Apache to copy the data if it needs to modify it.
Generic hooks (and a demo content filter module).
When we are starting the server, we have a pool that can be used to open the error log. Rather than try to log a regular error, log an error with the pool that we have, so that we can open stderr successfully.
Rename the apr_opendir symbol to apr_dir_open. This makes more sense, and the rename was proposed a while ago inside of APR.
move closer to IPv6 support by changing the server_addr_rec representation of the bound address to something which handles IPv6; this also allows us to switch to APR resolver routines in places instead of calling gethostbyname() and gethostbyaddr() directly Issues remaining with this set of changes: 1) apr_snprintf()'s %pA formatting needs to change to take apr_sockaddr_t * instead of sockaddr_in * -OR- just get rid of that type of formatting 2) apr_get_inaddr() is no longer used and should be removed
*) Compensate for recent changes in the APR headers. Specifically, some files need to specifically include stdio.h, or a particular apr_*.h header. *) Adjust callers of apr_create_process() to deal with the extra "const" *) Add "const" to args of ap_os_create_privileged_process()
Extern symbols (per the warning) belong elsewhere, since (on Win32) the http_main.c is both the startup and entry stub.
Port mod_info to 2.0. This is basically a complete re-write to use the config tree instead of re-reading the config file. As a part of this change, the config tree needs to be exposed to modules as ap_conftree. Submitted by: Ryan Morgan <rmorgan@covalent.net> Reviewed by: Ryan Bloom
Solve the os_is_absolute_path problem for the moment. This is -not- the permanent patch for 2.0, simply a placeholder till we have the canonical name implemented in APR for good.
Get Win32 building again. Submitted by: John Sterling <sterling@covalent.net> Reviewed by: wrowe
Make mod_auth_db compile cleanly in 2.0
Add back suexec support.
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.
Port over the config directory stuff...
The lots of little ones... APR_IS_STATUS_condition(rv) conditional macros replacing the majority of fallible rv == APR_condition tests. But there are lots more to fix, these are the obvious ones that already did proper canonical error conversion.
Avoid a segfault when parsing .htaccess files. An uninitialized tree pointer was passed to ap_build_config().
Fix a bug parsing configuration file containers. With a sequence
like this in the config file
<IfModule mod_kilroy.c>
any stuff
</IfModule>
<IfModule mod_lovejoy.c>
(blank line)
any stuff
</IfModule>
the second container would be terminated at the blank line due to
sediment in the buffer from reading the prior </IfModule> and an
error message would be generated for the real </IfModule> for the
second container. Also due to this problem, any two characters
could be used for "</" in the close of a container.
Remove a bunch of warnings from the server when compiled using --with-maintainer-mode
Preset the cmd_parms->limited field to the magic 'no limit active' value, and add some prototype API routines for expanding support for arbitrary extension HTTP methods.
Fix a config tree problem.
The following configuration file demonstrates the problem:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteMap quux-map prg:/tmp/apache-2.0/map.quux.pl
RewriteRule ^/~quux/(.*)$ /~quux/${quux-map:$1}
</IfModule>
After this config file is parsed, the only statement in the config
tree is the last statement in the IfModule container ("RewriteRule blah
blah").
The problem is that when ap_build_config_sub() handles this type of
construct, it moves *current to the end of the list before returning.
If this construct were the first thing in the file, the caller would
set conftree to *current, not realizing that there were list elements
before *current. The caller doesn't have addressability to those list
elements.
With this change, ap_build_config_sub() sets *conftree before
walking *current to the end of the list.
prefix libapr functions and types with apr_
Add APR_EOL_STR for a platform specific text delimiter, provided by apr.h (defined in apr.h.in and apr.hw). This is needed -only- in APR created files (true raw files) such as logs. It is not required in any splat to screen (stderr/stdout) formatting, nor any html markup. Some other modules slipped through in the prior apr_strings.h commit. Sorry 'bout that. PR: Obtained from: Submitted by: Reviewed by:
Move all APR functions related to strings to their own directory, and create a new header for those functions. This is the first step to removing the apr/lib directory completely, and moving those files/functions to descriptive directories.
Include strings.h for strcasecmp(), strncasecmp(), and bzero(). Include time.h for time(). This removes a bunch of compiler warnings with gcc -Wall on AIX. Submitted by: Jeff Trawick, Victor Orlikowski
parms needs err_directive incase execute_now() returns non-NULL (e.g. if LoadModule fails)
OS/390 needs arpa/inet.h for htonl(). Submitted by: Greg Ames
Use the new command-handler initializer macros in mod_auth; clean up the resulting warnings.
More command handlers.
More consification, correct command initialisation.
Command handler revamp. Note that this makes the code produce a LOT of warnings!
Fix segfault when reporting this type of syntax error: "</container> without matching <container> section", where container is VirtualHost or Directory or whatever. This was a path not covered by the fix in 2.0a4 to report the proper line numbers (sorry!).
Fix a couple of problems with the pre/post config processing changes: 1) symptom: on system with bad/no DNS setup, ServerName isn't processed so init fails cause: ap_fini_vhost_config() called before ap_process_config_tree(), so ServerName was never stored in the config structure 2) symptom: on system with virtual hosts configured, SIGSEGV in open_multi_logs() cause: the module configs for the virtual hosts haven't been merged in yet, and open_multi_logs() gets NULL for the mod_log_config configuration This stuff needs to be cleaned up further, exploring the use of a post-config hook for fixup_virtual_hosts(), ap_fini_vhost_config(), and ap_sort_hooks(), getting a lot of logic out of main(), and processing the config tree only once.
PR: Obtained from: Submitted by: Reviewed by: Migrate the 'real' pre_config hook update from winnt.c to mpm_winnt.c and correct newly required symbols for http_main.c
Remove some #ifdef'ed code that doesn't make much sense (what does the 2 signify?) Reviewed by: Ryan Bloom
Modify the config order so that we read the config, process all EXEC_ON_READ directives at the same time, run pre_config hook for all modules, and then walk the tree. This allows all modules to have a pre_config hook and know that it will be called at a reasonable time. I also made "Include" an EXEC_ON_READ directive so that it is included in the tree properly. This was required after the other changes that were made.
Add pre_config hooks back in for all modules. This is important for the server tokens code that is coming soon.
Forward fit a bug fix in the TAKE13 handling from 1.3 to 2.0 Submitted by: Jon Travis <jtravis@covalent.net>
We now report the correct line number for syntax errors in config files.
PR: Obtained from: Submitted by: Reviewed by: Finally a patch that can't (well, shouldn't :-) break any other platform. Open up the symbols defined for http_main.c to move main() from the core under Win32 (that's the real main(), not that apache_main() thing). Win32 Project file changes will follow in a seperate patch.
PR: Obtained from: Submitted by: Reviewed by: Reverse out additional linkage argument from DECLARE_HOOK and IMPLEMENT_HOOK macros.
PR: Obtained from: Submitted by: Reviewed by: Reverse out all _EXPORT_VAR changes back to their original _VAR_EXPORT names for linkage (API_, CORE_, and MODULE_).
A really simple change for readability:
ap_pool_t *g_pHookPool; becomes ap_global_hook_pool
int g_bDebugHooks; becomes ap_debug_module_hooks
const char *g_szCurrentHookName; becomes ap_debug_module_name
Just as a reminder, these are now declared in ap_hooks.c
This patch corrects the issues from the AP_EXPORT and linkage
specification arguments to the ap_hooks.h declarations. As with
the APR_ and AP_ patches, API_VAR_EXPORT becomes API_EXPORT_VAR,
and MODULE_VAR_EXPORT becomes MODULE_EXPORT_VAR.
I will be happy to revert the inclusion of ap_config.h from
httpd.h if this bothers anyone. More individual modules need
to be patched if we do so.
The API_EXPORTs all moved into central storage in the ap_config.h
header. Without WIN32 or API_STATIC compile time declarations,
these macros remain no-ops.
This patch also moves the following data from http_main to http_config:
const char *ap_server_argv0;
const char *ap_server_root;
ap_array_header_t *ap_server_pre_read_config;
ap_array_header_t *ap_server_post_read_config;
ap_array_header_t *ap_server_config_defines;
And the following variables had already moved into ap_hooks.c:
ap_pool_t *g_pHookPool; (initialized now in http_config)
int g_bDebugHooks; (out of http_config)
const char *g_szCurrentHookName; (out of http_config)
The changes to http_main.c are in preparation for that module to
move out to a seperate .exe for win32. Other platforms will be
unaffected, outside of these changes.
Fix the config parser so that if there is no current node, and we are evaluating an EXEC_ON_READ directive, and the directive's sub_tree is empty, we don't try to set the node's parent pointer. This stops a seg fault. Submitted by: Jeff Trawick
Fix a bug in adding EXEC_ON_READ at the top level of the tree.
Fix a bug in the EXEC_ON_READ logic. When we build a sub_tree while reading that is the first item in a container, we have to return that tree and set the parent pointers correctly. Submitted by: Jeff Trawick Reviewed by: Ryan Bloom
Commit the EXEC_ON_READ changes. This allows modules to hook into the config file read phase. Full details are in the CHANGES file blurb. Examples to see how this should be used are provided for <IfModule> <IfDefine> LoadModule, AddModule and ClearModuleList expect docs in the next day or two.
Get tree build to work correctly with config Include directive
add AP_ prefix to *HOOK* macros
drop the "container" param from ap_walk_config(). callers should simply
pass the first child, rather than expecting the walker to do it.
remove the nasty "static" variable inside ap_walk_config(). it now walks the
tree provided with no worries about bumping up/down levels.
minor refactor between ap_walk_config() and ap_walk_config_sub() to clean up
some logic and clarify the code.
clean up cmd_parms: config_file is no longer valid; end_token is bogus;
add directive.
move configfile_t and functions from httpd.h to http_config.h
new signature for ap_build_config() (since config_file removed from cmd_parms)
add "data" to ap_directive_t for future use by modules. add filename.
syntax checking for section-close directives: a section-open must exist,
the section-close must be </FOO>, and the open/close must match.
the file as a whole must be properly balanced (issue errors for each
unmatched section-open).
</FOO> command_rec structures are obsolete. Remove from http_core.c.
do not store </FOO> directives in the config tree.
clean out section-close logic from http_core.c (and old, related comments)
<Limit> and <LimitExcept> must walk their children.
new mechanism in ap_check_cmd_context() for testing enclosure in a
Directory/Location/File: find_parent()
<IfModule> and <IfDefine> must pass cmd->context when walking the children
several places: we had a walk followed by ap_get_module_config(). that
assumed the walk would create a config that we could fetch, which is not
true -- it is possible that the children are all from other modules
(e.g. the <Files> section in httpd.conf-dist has no "core" directives).
using ap_set_config_vectors() ensures we get a structure, and it returns
it to us.
[ note: when we had </Directory> (and friends) in the tree, the config
would get created; removing the directive removed the config; this
was a bitch to track down :-) ]
handle error messages during building and processing of the configuration.
add missing return statements, wrap some lines, remove unused vars.
move syntax error reporting and exit(1) back to the right place (to be
fixed in a future pass; the exit() is inappropriate for parsing
.htaccess files).
Parse the config tree, instead of the config file. This is a first step there are some big improvements to be made to this code, but this works now, and it is a first step.
Use ap_canonical_error() where appropriate.
Add back in logic to put the ending container directive in the tree. This
needs to be there until we have a validating tree. Without this, it is
possible for a config file to read:
<Ifmodule mod_foo.c>
some directive
</Limit>
and still be read correctly. When the tree building functions can validate
for us, this should be removed, and there is a comment that says so.
Change ap_context_t to ap_pool_t. This compiles, runs, and serves pages on Linux, but probably breaks somewhere.
more namespace cleanup
First step to getting configuration modules working. This step creates a tree, but does not use the tree for anything.
Update to Apache Software License version 1.1
Fix the warnings associated with the pre_config patch.
Put the pre_config hook back into the table. This solves the problem of the pre-config hook only being valid for MPM's. This patch also distinguishes between STANDARD modules and MPM's.
Remove the last piece of the layered I/O code. I don't know why this didn't get removed with the rest of it.
Enabled layered I/O. Docs are forthcoming.
Clear hook registrations between reads of the config file. When DSOs are unloaded and re-loaded the old hook pointers may no longer be valid. This fix eliminates potential segfaults.
Eliminate implicit usage of access.conf and srm.conf.
Another one in the department of fairly useless patches which
are best described as feature creep. Allows ${ENV} constructs
in the config file. This avoids the need for mod_perl or
m4 cleverness whilst mainting some of the usefullness. It
does not do (of course) multiline things or anything that clever.
Feel free to flame me.
PR:
Obtained from:
Submitted by:
Reviewed by:
Fix all the License issues. Including: s/Apache Group/Apache Software Foundation/ s/1999/2000/ s/Sascha's license/ASF license
Sort hooks after dynamically loaded modules have registered.
Include ap_config.h before httpd.h, this ensures that AP_USE_HSREGEX is defined correctly in all C files.
Finish the commits for the change in the header files. Basically, this hides all of the Apache macros that modules don't need access to. This should have been committed with the modules, but I wasn't paying attention to the directory I was in when I ran the commit. Submitted by: Manoj Kasichainula and Ryan Bloom
Separate the stat structure from the file structure and use ap_stat and ap_getfileinfo in apache.
Initialize all ap_file_t's to NULL. This allows ap_open and ap_stat to work together without causing memory leaks.
Use ap_open_stderr in http_config.c. This cleans up some non-portable code that has been bothering me.
First step in removing the fprintf(stderr problem from Apache. Basically, I defined APLOG_STARTUP, which refrains from printing the date string and the log level information in log_error_core. I then changed all the fprintf(stderr calls to ap_log_error, and used APLOG_STARTUP. log_error_core on Unix takes care of creating a log file and directing it to stderr if a log file isn't already active. I will continue to make these changes tomorrow. Currently, the main code and the dexter mpm have been modified.
Cleanup the ZZZ comments. Basically these used to mark places where APR is needed. It is much easier to do this conversion by hand than by searching for old comments, so they are going away now.
Get rid of a number of 'incompatible pointer type' warnings using
ap_os_{get,put}_file() on platforms who's ap_os_file_t is not an int.
De-errno ap_pcfg_openfile().
Add a status value to ap_log_error and ap_log_rerror. This allows us to use apr_status codes in our error logs. The main advantage of this, is portable error codes. Now, Windows will finally be able to use errno!
Typo
Well this was thought provoking. Drive out the use of malloc in two places. In listen.c, using the global process pool instead. That changes the API into listen so that a process is passed in rather than the config pool. That's all was easy. The pain is propogating a change into all N of the mpm, they are all similar but different in their use of listen.c There is a lot to dislike about similar but code scattered code. I changed the N setup_listener routines, they now take only the server since they can dig the config and global pool out of there. Free today: ap_setup_prelinked_modules now takes the process so it can allocate it's table in the process's pool rathern than use malloc.
Add process_rec to the top of {server,connection,request}_rec
hierarchy of structs that abstract server activities. Store some
stuff in process_rec (finally a place to have nearly guiltless
globals) for example the global and configuration pools. Put some
operations on process_rec in http_main, in particular the
destroy_and_exit operation, and the use it to do all the exit calls.
Change ap_read_config to operation on this "object" rather than on the
configuration pool. Modify server_rec to point to the process, so you
can get at it most all the time which should finally allow most of the
server's malloc calls to be eliminated.
There are no locks in the process struct as yet, put them in as needed.
Some of the hooks should take this rather than conf. pool.
First patch to re-order function parameters. This one gets the low hanging fruit, and moves most of the result parameters to the first argument. Future patches in this series will move the rest of the result parameters to the beginning of the list, and will move the context's to the end of the list
Remove all of the calls to functions like "ap_popenf". These functions were moved down to APR, but they are being removed. They are not portable, and were only moved down for backwards compatability. With this change, they can be safely removed, which is the next commit on it's way. Submitted by: Ryan Bloom and Paul Reder
Changed pools to contexts. Tested with prefork and pthread mpm's. I'll check this out tomorrow and make sure everything was checked in correctly.
Fix merge bug
Move "handler not found" warning message to below the check for a wildcard handler. Gee, you'd think someone would have fixed it before seven PRs. PR: 2584, 3349, 3436, 3548, 4384, 4795, 4807 Submitted by: Dirk <dirkm@teleport.com>, Roy Fielding
Reverse the errors from bad merges that were found while rebuilding the repository.
Odd comments and leftover bits from the pthreads version. The comments really should be deleted, or at least cleaned up. Submitted by: pthreads leftovers
FIXME: These changes are just errors from bad merges in the past.
Start to implement module-defined hooks that are a) fast and b) typesafe. Replace pre_connection module call with a register_hook call and implement pre_connection as a hook. The intent is that these hooks will be extended to allow Apache to be multi-protocol, and also to allow the calling order to be specified on a per-hook/per-module basis. [Ben Laurie] Port a bunch of modules to the new module structure. ["Michael H. Voase" <mvoase@midcoast.com.au>] Submitted by: Ben Laurie
Rearchitect the mess in http_main.c, http_core.c and buff.c. Basic restructuring to introduce the MPM concept; includes various changes to the module API... better described by docs/initial_blurb.txt. Created multiple process model (MPM) concept by ripping out the process guts from http_main.c and http_core.c and moving them to separate files under src/modules/mpm/ Moved socket creation stuff to listen.c. Moved connection open, maintenance and close to http_connection.c. I/O layering and BUFF revamp. Much of buff.c moved to ap_iol, iol_socket, and iol_file. See docs/buff.txt. Moved user and auth fields from connection_rec to request_rec. Removed RLIMIT stuff, supposedly to be implemented later in mod_cgi. Disabled suexec, supposedly to be reimplemented later. Submitted by: Dean Gaudet
Apache 1.3.9 baseline for the Apache 2.0 repository. Obtained from: Apache 1.3.9 (minus unused files), tag APACHE_1_3_9 Submitted by: Apache Group
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.
| apache@apache.org | ViewVC Help |
| Powered by ViewVC 1.1.2 |