1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

249 Commits

Author SHA1 Message Date
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Stefan Fritsch
01ed21af9d Add wrappers for malloc, calloc, realloc that check for out of memory
situations.  Use them in most places where malloc, and friends are used.
This results in clean error messages in an out of memory situation instead of
segfaulting or silently malfunctioning. In some places, it just allows to
remove some logging code.

PR 51568, PR 51569, PR 51571.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172686 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 16:25:42 +00:00
Stefan Fritsch
84a104bb22 Add ap_varbuf API for resizable buffers.
Increase length limit of lines in the configuration file to 16MB.
Increase length limit of lines in the group file to 16MB.

PR: 45888, 50824, 43084

Windows and Netware build changes are untested.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157354 13f79535-47bb-0310-9956-ffa450edef68
2011-08-13 09:06:35 +00:00
Stefan Fritsch
c1f50be04f Adjust some messages for <If> blocks and remove some dead code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1153674 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 21:28:42 +00:00
Stefan Fritsch
77bd4820bc use temp pool for temp string
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1153653 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 20:35:03 +00:00
Daniel Ruggeri
0d69087127 Add AllowOverrideList directive and documentation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151654 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 22:24:14 +00:00
Stefan Fritsch
527d18b6ca Use APR_UNSPEC to allow startup on IP6-only systems.
PR: 50592
Submitted by: Joe Orton, 2510 <root linkage white-void net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1146256 13f79535-47bb-0310-9956-ffa450edef68
2011-07-13 19:21:11 +00:00
Stefan Fritsch
4bc8885d8d Fix "statement not reached" warnings with sun cc
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1139391 13f79535-47bb-0310-9956-ffa450edef68
2011-06-24 17:59:44 +00:00
Stefan Fritsch
c9fd2623da Introduce ap_(get|set)_core_module_config() functions/macros and use them
everywhere.

We know that the core module has module_index 0. Therefore we can save
some pointer operations in ap_get_module_config(cv, &core_module) and
ap_set_module_config(cv, &core_module, val). As these are called rather often,
this may actually have some (small) measurable effect.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
Jeff Trawick
7eb4cae399 disable hook probes for our two hooks which have no args
Reviewed by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101671 13f79535-47bb-0310-9956-ffa450edef68
2011-05-10 22:52:45 +00:00
Stefan Fritsch
bf07c1867c Add new ap_reserve_module_slots/ap_reserve_module_slots_directive API,
necessary if a module (like mod_perl) registers additional modules later than the
EXEC_ON_READ phase.

Tested by: Torsten Foertsch <torsten foertsch gmx net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096569 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 19:22:04 +00:00
Stefan Fritsch
e77a332640 Prevent segfault if DYNAMIC_MODULE_LIMIT is reached
PR: 51072
Submitted by: Torsten Förtsch <torsten foertsch gmx net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1092787 13f79535-47bb-0310-9956-ffa450edef68
2011-04-15 19:04:29 +00:00
Stefan Fritsch
7b61bedb2f Change the ap_cfg_getline() and ap_cfg_getc() to return an error code.
Also:
- Make ap_cfg_getline() return APR_ENOSPC if a config line is too long.
- Add ap_pcfg_strerror() function to convert ap_cfg_getline's return value
  into a nice message.
- Adjust definition of ap_configfile_t accordingly.

Not bumping MMN because it has already been bumped today.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086756 13f79535-47bb-0310-9956-ffa450edef68
2011-03-29 21:29:34 +00:00
Eric Covener
c329a283e3 typo in format string for 1070660
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070663 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 20:51:42 +00:00
Eric Covener
071085f420 Log a hint about the directory needing to be executable
when we hit EACCESS searching for htaccess files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070660 13f79535-47bb-0310-9956-ffa450edef68
2011-02-14 20:49:56 +00:00
Stefan Fritsch
74d4b6625d Optimize memory access pattern of ap_merge_per_dir_configs()
According to Linux perf, this is twice as fast as the old loop.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1066869 13f79535-47bb-0310-9956-ffa450edef68
2011-02-03 17:02:38 +00:00
Nick Kew
eb8657d216 config: report error and exit cleanly if getaddrinfo fails at startup
PR: 50592


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059472 13f79535-47bb-0310-9956-ffa450edef68
2011-01-16 04:22:25 +00:00
Stefan Fritsch
39db8e5413 mod_proxy: Fix ProxyPassInterpolateEnv directive.
PR: 50292


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1036602 13f79535-47bb-0310-9956-ffa450edef68
2010-11-18 20:15:24 +00:00
Ruediger Pluem
38064564e9 * Fix parameter name as new is a reserved word in C++ which makes compiling
of http_config.h with C++ impossible.

PR: 50243


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1033427 13f79535-47bb-0310-9956-ffa450edef68
2010-11-10 12:09:27 +00:00
Stefan Fritsch
286c8622b6 Add a generic pool cleanup function that sets a pointer to NULL and use
it to replace various pool cleanup functions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032167 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 22:12:41 +00:00
Stefan Fritsch
00cdb469d7 use temp pool in some more places
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026657 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 18:06:49 +00:00
Stefan Fritsch
1a54421be0 Set the LogLevel of a newly initialized virtual hosts to UNSET. Otherwise
it will not be correctly merged in ap_fixup_virtual_hosts().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024427 13f79535-47bb-0310-9956-ffa450edef68
2010-10-19 21:53:38 +00:00
Stefan Fritsch
5507079237 merge if blocks
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003816 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 15:32:51 +00:00
Stefan Fritsch
10e73f91c7 Use ptemp in some places to save some memory when parsing included config
files


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003809 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 15:04:08 +00:00
Stefan Fritsch
049ba34b53 core: Speed up config parsing if using a very large number of config
files

PR: 50002
Submitted by: andrew cloudaccess net


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003808 13f79535-47bb-0310-9956-ffa450edef68
2010-10-02 14:44:20 +00:00
Stefan Fritsch
70be0f7a07 Add ErrorLogFormat directive for configuring the error log format, including
additional information that is logged once per connection or request.

Add error log IDs for connections and request to allow correlating error log
lines and the corresponding access log entry.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992806 13f79535-47bb-0310-9956-ffa450edef68
2010-09-05 15:44:19 +00:00
Stefan Fritsch
8f840cb763 core: Abort with sensible error message if no or more than one MPM is
loaded.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987806 13f79535-47bb-0310-9956-ffa450edef68
2010-08-21 18:06:41 +00:00
Jeff Trawick
105ce3617b follow up r987629 with another similar issue
curr_parent can't be NULL (or we segfault elsewhere), so 
don't check for NULL


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987631 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 20:47:35 +00:00
Jeff Trawick
43ca6cc239 remove useless check for current == NULL; if it is NULL, a
segfault will occur right before the function returns anyway
(IOW, caller must not pass in NULL for that arg)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@987629 13f79535-47bb-0310-9956-ffa450edef68
2010-08-20 20:39:02 +00:00
Stefan Fritsch
ae5ef058ac Add ap_find_module_short_name() to quickly get the module short name
(i.e. symbol name with trailing "_module" removed) from the module_index.
To be used for logging.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965408 13f79535-47bb-0310-9956-ffa450edef68
2010-07-19 10:06:15 +00:00
Stefan Fritsch
ed451e94d1 re-order many struct members for better alignment on 64bit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959464 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 22:34:05 +00:00
Stefan Fritsch
cd6924b086 To save memory, make module_levels a vector of chars instead of ints.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959392 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 18:09:06 +00:00
Jeff Trawick
f9828853b0 spelling fix for a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959031 13f79535-47bb-0310-9956-ffa450edef68
2010-06-29 17:00:23 +00:00
Stefan Fritsch
37ab7c96a6 Save some memory by allocating only the required length for conf_vectors.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@958285 13f79535-47bb-0310-9956-ffa450edef68
2010-06-26 21:28:36 +00:00
Joe Orton
7189b776db Run filter "init" functions exactly once per request. No longer run
init functions for connection filters (doing an "init" once per
handler invocation makes no sense for a connection filter).  No longer 
run init functions multiple times per request if a subrequest is used.

* include/util_filter.h (ap_filter_rec_t): Clarify use of the init
  function pointer.

* server/config.c (invoke_filter_init): Drop ap_ prefix for private
  function; take a request_rec pointer and only invoke filters with
  matching request.
  (ap_invoke_handler): Adjust accordingly.

PR: 49328
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@953311 13f79535-47bb-0310-9956-ffa450edef68
2010-06-10 12:52:49 +00:00
Stefan Fritsch
2334a1ea4f - Add loglevels to request_rec and conn_rec
- Introduce per-directory loglevel configuration


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951897 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:04:40 +00:00
Stefan Fritsch
98a1e93dca - Introduce log levels trace1/.../trace8
- Add macro wrappers for ap_log_*error. On C99, this will save argument
  preparation and function call overhead when a message is not logged
  because of the configured loglevel.
- Introduce per-module loglevel configuration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951893 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:54:51 +00:00
William A. Rowe Jr
1108773c08 First order simplification; Add IncludeOptional for introducing
wildcard pattern matches or specific includes which may be omitted.
Refactors ap_process_resource_config() to deal efficiently with 
a single file, and renames the new _ex() flavor per list discussion
to  ap_process_fnmatch_configs() for wildcard processing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@931435 13f79535-47bb-0310-9956-ffa450edef68
2010-04-07 04:51:46 +00:00
Graham Leggett
3915fb380b Retract veto over inconsistent behaviour between directory and file wildcards,
implement wrowe's missing directory wilcard must fail / missing file wildcard
must pass requirement. Introduce 'optional' and 'strict' modifiers to the
Include directive for the end user to express their desired behaviour.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@929318 13f79535-47bb-0310-9956-ffa450edef68
2010-03-30 22:14:24 +00:00
Graham Leggett
ea767fff9d core: Introduce the IncludeStrict directive, which explicitly fails
server startup if no files or directories match a wildcard path.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@928916 13f79535-47bb-0310-9956-ffa450edef68
2010-03-29 22:09:35 +00:00
Graham Leggett
64913f1880 Make sure we request the APR_FINFO_TYPE on the apr_dir_read() for wildcard
configuration.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@917759 13f79535-47bb-0310-9956-ffa450edef68
2010-03-01 22:19:33 +00:00
Graham Leggett
3ffe82f249 When loading wildcards that are part of a path, only consider directories
and ignore other files. [Dan Poirier, Graham Leggett]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@917735 13f79535-47bb-0310-9956-ffa450edef68
2010-03-01 21:34:51 +00:00
Daniel Earl Poirier
266104e13f More correct fix for compile warning about discarding constness
of fname.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@910717 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 22:00:13 +00:00
Daniel Earl Poirier
b132661947 Fix compile warning (discarding constness of fname)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@910673 13f79535-47bb-0310-9956-ffa450edef68
2010-02-16 20:24:33 +00:00
Graham Leggett
17e9e4bb15 Support wildcards in both the directory and file components of
the path specified by the Include directive.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@909878 13f79535-47bb-0310-9956-ffa450edef68
2010-02-13 19:48:04 +00:00
Joe Orton
489bc420dd 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>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@772997 13f79535-47bb-0310-9956-ffa450edef68
2009-05-08 14:13:15 +00:00
Jeff Trawick
fb6a306876 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759924 13f79535-47bb-0310-9956-ffa450edef68
2009-03-30 11:27:53 +00:00
Jeff Trawick
9db133b4a8 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).)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758173 13f79535-47bb-0310-9956-ffa450edef68
2009-03-25 08:30:18 +00:00
Jeff Trawick
e0eb7d1eef 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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757853 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 15:43:59 +00:00
Ruediger Pluem
3a067320e4 * Prevent segfaults in handlers by ensuring that r->handler != NULL.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@739598 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 20:35:03 +00:00