Repository navigation
docs/mod_sed: document that a/c/i cannot be used from httpd.conf - #1154
arturobernalg wants to merge 1 commit into
Conversation
The multi-line form these commands require is a backslash immediately followed by a newline, which the config file parser always collapses as a line continuation before mod_sed ever parses the command. Confirmed against a real build: both the standard multi-line form and a single-backslash one-line form fail with "command garbled". PR 70389. [Arturo Bernal]
|
If it's impossible to use those commands could we delete the code implementing them as well (or at least ifdef it out)? |
|
Turns out it's not quite impossible — a/c/i can't be written in the config file itself (httpd.conf/Include/mod_macro all collapse the backslash-newline before mod_sed sees it, and there's no escape for a literal LF in substring_conf), but they do work via ${ENVVAR} substitution (ap_resolve_env runs after the continuation collapse) or via -c/-C on the command line with a raw LF in the argv string. So removing the code would be a real, if obscure, behavior change for anyone using either route. libsed itself isn't used anywhere else in the tree, for what that's worth. I'll tighten the PR wording to "cannot be written in a configuration file" rather than "impossible". |
The a, c and i commands need their text after a backslash-newline, which httpd.conf's parser always collapses as a line continuation before mod_sed sees the command. Confirmed against a real build: both the standard multi-line form and a single-backslash one-line form fail with "command garbled". Documents the limitation and points to s as the workaround.
PR 70389.
[x] This PR does not report or address a security vulnerability.
[x] Code follows the httpd style guide.
[ ] New log messages (n/a, docs only)
[ ] changes-entries (n/a, docs only)
[ ] pyhttpd tests (n/a, docs only)