185 Commits

Author SHA1 Message Date
e6647e0dcb Include header file for the explicit regex.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909136 13f79535-47bb-0310-9956-ffa450edef68
2023-04-14 14:03:03 +00:00
669bdbb45b Resolves BZ65861 - clarify post_config api doc
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898347 13f79535-47bb-0310-9956-ffa450edef68
2022-02-23 14:38:20 +00:00
2517583a44 Define ap_method_mask_t (typedef for apr_uint64_t) and use for method
bitmasks rather than apr_int64_t.  Fixes UBSan errors shifting to the
top bit of a signed integer.

* include/httpd.h: Add ap_method_mask_t, use it for AP_METHOD_BIT.
  (struct ap_method_mask_t): Likewise for method_mask field.
  (struct request_rec): Likewise for allowed field.

* include/http_config.h (struct cmd_parms): Likewise for limited field.

* include/ap_mmn.h: Bump MMN major.

* modules/*/*.c: Adjust all method masks to use ap_method_mask_t.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874114 13f79535-47bb-0310-9956-ffa450edef68
2020-02-17 10:11:56 +00:00
85760859ca Fix spelling errors found by codespell. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
2020-02-13 18:15:57 +00:00
b1e34549c1 core: Split out the ability to parse wildcard files and directories
from the Include/IncludeOptional directives into a generic set of
functions ap_dir_nofnmatch() and ap_dir_fnmatch().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1847430 13f79535-47bb-0310-9956-ffa450edef68
2018-11-25 21:15:21 +00:00
0507bb7e88 Define "state directory" for storing persistent child-writable state,
with default from config.layout, configurable via DefaultStateDir.

* server/core.c (set_state_dir, ap_state_dir_relative):
  New functions.
  
* config.layout, acinclude.m4, Makefile.in, configure.in: Define
  statedir variables, drop davlockdb.

* include/ap_config_layout.h.in: Define DEFAULT_REL_STATEDIR,
  DEFAULT_EXP_STATEDIR in place of _DAVLOCKDB.

* include/ap_mmn.h: Bump MMN minor.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1842929 13f79535-47bb-0310-9956-ffa450edef68
2018-10-05 15:25:04 +00:00
3e56c5b221 Fix some typos reported in PR 59998
Most add already been fixed when PR 59990 had been applied on trunk. 

Thx klemens

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827669 13f79535-47bb-0310-9956-ffa450edef68
2018-03-24 20:05:19 +00:00
1ee7b9348b Follow up to r1740928: including NOT_IN_PROXY in NOT_IN_DIR_LOC_FILE is both
incomplete and not backportable, fix it by introducing NOT_IN_DIR_CONTEXT and
restoring NOT_IN_DIR_LOC_FILE to its previous value.

Per ap_check_cmd_context(), NOT_IN_DIR_LOC_FILE actually/really means "not in
any directory context", while the definition itself does not include all the
existing directory contexts (e.g. <Limit>, or <Proxy> before r1740928).

This is a bit of a misnomer, at least, so instead of (ab)using it by adding the
missing contexts (in an incompatible way), let's define NOT_IN_DIR_CONTEXT to
really exclude all directory context (i.e. NOT_IN_DIR_LOC_FILE + NOT_IN_LIMIT +
NOT_IN_PROXY) and use it wherever NOT_IN_DIR_LOC_FILE was used.

This is by itself a major MMN bump (modules not compiled with this commit and
having directives checked against NOT_IN_DIR_LOC_FILE won't be caught the same
way by NOT_IN_DIR_CONTEXT in the new ap_check_cmd_context() code), but with the
below change, 2.4.x should work as before:

-   if ((forbidden & NOT_IN_DIR_CONTEXT) == NOT_IN_DIR_CONTEXT) {
+   if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) {
        if (cmd->path != NULL) {
            return apr_pstrcat(cmd->pool, cmd->cmd->name, gt,
-                           " cannot occur within directory context", NULL);
+                           " cannot occur within <Directory/Location/Files/Proxy> "
+                           "section", NULL);
        }
        ...
    }



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1812193 13f79535-47bb-0310-9956-ffa450edef68
2017-10-14 16:27:14 +00:00
9156671542 config: follow up to r1809302.
Provide a convenient function to get module flags, and remove useless
AP_MODULE_HAS_FLAGS checks in the core, core's version is at current MMN.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809311 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 13:13:44 +00:00
22b024abd8 config: follow up to r1809302.
We need to check that the module itself is at the right version.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809305 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 12:31:54 +00:00
e18300e525 config: allow to specify flags when registering modules.
First one is AP_MODULE_FLAG_ALWAYS_MERGE.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1809302 13f79535-47bb-0310-9956-ffa450edef68
2017-09-22 11:58:53 +00:00
f843f6fd07 * server/config.c, include/http_config.h (ap_build_cont_config,
ap_soak_end_container): Constify directive arguments - existing
  callers pass string literals.

* server/core.c (start_cond_section): Remove casts needed for above.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1786120 13f79535-47bb-0310-9956-ffa450edef68
2017-03-09 09:48:24 +00:00
ec40c3c197 Add <IfDirective> and <IfSection>:
* server/core.c
  (test_ifdirective_section, test_ifsection_section): New callbacks.
  (core_cmds): Define new directives.

* include/http_config.h, server/config.c (ap_exists_directive):
  New function.

* include/ap_mmn.h: Bump MMN minor for above.

* docs/manual/mod/core.xml: Add docs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1786110 13f79535-47bb-0310-9956-ffa450edef68
2017-03-09 08:39:56 +00:00
8b562b9331 http_config: follow up to r1702948: maybe unused, yet maybe usefull too.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1759415 13f79535-47bb-0310-9956-ffa450edef68
2016-09-06 12:07:39 +00:00
d79b514c4b Fix spelling in comments and text files.
No functional change.
PR 59990


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1756038 13f79535-47bb-0310-9956-ffa450edef68
2016-08-11 19:50:02 +00:00
f9ad2754f7 mod_proxy, mod_ssl: Handle SSLProxy* directives in <Proxy> sections,
allowing per backend TLS configuration.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1740928 13f79535-47bb-0310-9956-ffa450edef68
2016-04-26 00:04:57 +00:00
ea390af213 httpd compiles warning free on gcc and every new warning will be treated as an error, standard c-89 is enforced
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1702948 13f79535-47bb-0310-9956-ffa450edef68
2015-09-14 13:29:35 +00:00
d5227d2da4 expand comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1656062 13f79535-47bb-0310-9956-ffa450edef68
2015-01-30 17:15:02 +00:00
2154a9de68 Provide a way for EXEC_ON_READ directives to see their context
(parent directive).

Usually, this context is not also EXEC_ON_READ so it's not fully processed, so
e.g cmd->path is not fluffed up yet because the closing tag
of the section is not read yet and ap_check_cmd_context()
doesn't work)




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1656058 13f79535-47bb-0310-9956-ffa450edef68
2015-01-30 16:58:20 +00:00
a77068dd87 AP_INIT_NO_ARGS mishandled in macro
Submitted by: Joachim Zobel <jzobel heute-morgen.de>, covener
Committed by: covener




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1655146 13f79535-47bb-0310-9956-ffa450edef68
2015-01-27 20:21:48 +00:00
3508158873 doxygen improvements
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1560482 13f79535-47bb-0310-9956-ffa450edef68
2014-01-22 19:15:14 +00:00
cf212a0867 fix a couple of grammar problems
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1509341 13f79535-47bb-0310-9956-ffa450edef68
2013-08-01 17:36:11 +00:00
a011e2a43f Replace pre_htaccess hook with more flexible open_htaccess hook
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1498880 13f79535-47bb-0310-9956-ffa450edef68
2013-07-02 11:26:41 +00:00
289ead8ef7 Make ap_check_cmd_context() treat <If> sections like <File> sections.
This is necessary to properly disallow directives that don't work in
<If>.
    
A separate NOT_IN_IF flag may be nicer, but would create much more
hassle when being backported to 2.4.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1406495 13f79535-47bb-0310-9956-ffa450edef68
2012-11-07 08:33:05 +00:00
dfc4862f0e add pre_htaccess hook; in conjunction with earlier dirwalk_stat
and post_perdir_config hooks, this should allow mpm-itk to be
used without patches to httpd core



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1389339 13f79535-47bb-0310-9956-ffa450edef68
2012-09-24 12:42:32 +00:00
25c27c59dd Docs (and minor comment change) for DefaultRuntimeDir directive
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1297959 13f79535-47bb-0310-9956-ffa450edef68
2012-03-07 12:51:04 +00:00
fc1b444d2e Fold on Jeff's DefaultRuntimeDir impl... docs on the way
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1297955 13f79535-47bb-0310-9956-ffa450edef68
2012-03-07 12:31:58 +00:00
e0ddfe0fdf Core configuration: add AllowOverride option to treat syntax
errors in .htaccess as non-fatal.
PR 52439



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1229021 13f79535-47bb-0310-9956-ffa450edef68
2012-01-09 04:01:06 +00:00
2aa21a62b1 Clean up size_t abuse, part 2. ap_malloc/calloc/realloc are explicitly
excluded from this cleanup as they must be signature identical to the
clib functions, and although the definition of size_t has been flakey,
the definition of those functions appears to be generally clean since
ANSI C.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1228323 13f79535-47bb-0310-9956-ffa450edef68
2012-01-06 18:15:08 +00:00
91ce790cd3 Limit length of lines in .htaccess to 8K again, to reduce DoS potential.
Make ap_varbuf_cfg_getline() strictly enforce the max_len parameter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1213338 13f79535-47bb-0310-9956-ffa450edef68
2011-12-12 17:50:33 +00:00
cd17cd2c10 Consistenly use apr_file_* API instead of libc when dumping config because
mixing the two can give strange results due to buffering.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180671 13f79535-47bb-0310-9956-ffa450edef68
2011-10-09 17:55:06 +00:00
9d2ca013b6 cleanups related to new AllowOverrideList functionality:
- add new NOT_IN_HTACCESS flag for ap_check_cmd_context() 
- describe the need for this in new_api_2_4.xml
- forbid Define and UnDefine in .htaccess


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1153676 13f79535-47bb-0310-9956-ffa450edef68
2011-08-03 21:36:18 +00:00
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
ec8235ddbf Document the weird semantics of ap_find_command_in_modules()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151045 13f79535-47bb-0310-9956-ffa450edef68
2011-07-26 09:47:51 +00:00
ccdc32e52d dox fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1139540 13f79535-47bb-0310-9956-ffa450edef68
2011-06-25 12:44:08 +00:00
2aef21903c Cleanup... most don't need apr_hooks.h at all...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101067 13f79535-47bb-0310-9956-ffa450edef68
2011-05-09 15:36:32 +00:00
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
065710a4a3 clarify comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1094127 13f79535-47bb-0310-9956-ffa450edef68
2011-04-17 10:17:37 +00:00
f93cae2d6d Axed tabs and trailing spaces.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1091621 13f79535-47bb-0310-9956-ffa450edef68
2011-04-13 01:29:02 +00:00
d49ccfd744 Add CHANGES entry for r1086756 / ap_cfg_* change
Update docs for ap_cfg_getc


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086761 13f79535-47bb-0310-9956-ffa450edef68
2011-03-29 21:38:03 +00:00
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
bc956c30c3 fix doxygen warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1086071 13f79535-47bb-0310-9956-ffa450edef68
2011-03-27 23:36:03 +00:00
4598f1a7d4 fix some grammar mistakes, mostly in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080821 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 00:35:39 +00:00
cf0e2c3a46 Fix some Windows build issues
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1039204 13f79535-47bb-0310-9956-ffa450edef68
2010-11-25 22:27:17 +00:00
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
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
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
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
ca8ee159b0 - add more comments explaining the logging macros
- make the documentation more doxygen friendly, as suggested by Justin
  Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@989377 13f79535-47bb-0310-9956-ffa450edef68
2010-08-25 21:29:41 +00:00
e9f4f3fd81 Trivial spelling fix so I can close
PR 44195


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965712 13f79535-47bb-0310-9956-ffa450edef68
2010-07-20 01:55:18 +00:00