Skip to content

fix: provide ap_map_http_request_error for the standalone build - #3674

Open
fzipi wants to merge 1 commit into
owasp-modsecurity:v2/masterfrom
fzipi:v2/issue-3451-standalone-link
Open

fzipi wants to merge 1 commit into
owasp-modsecurity:v2/masterfrom
fzipi:v2/issue-3451-standalone-link

Conversation

@fzipi

@fzipi fzipi commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

What

apache2/apache2_io.c gets a local copy of httpd's ap_map_http_request_error() (from modules/http/http_filters.c) for builds that define VERSION_STANDALONE, VERSION_IIS or VERSION_NGINX, exposed under the same name through a macro so the call site in read_request_body() stays unchanged for the Apache module.

Why

ap_map_http_request_error() is a symbol of httpd itself, not of APR, so the standalone library (and everything built on it) carried an undefined reference since that call was introduced and could not be linked into a host program (#3451). This is @airween's patch from the issue thread; the macro choice follows his note: VERSION_STANDALONE is what standalone/Makefile.am actually defines, the other two are kept for the IIS and nginx flavours that reuse the same sources.

Tests

Verified in a Debian bookworm container with ./configure --enable-standalone-module --disable-apache2-module:

  • untouched v2/master: nm -D standalone/.libs/standalone.so shows U ap_map_http_request_error;
  • this branch: no undefined reference, msc_ap_map_http_request_error is a local symbol.

The Apache module build is unaffected (the block is compiled out).

References

Fixes #3451

🤖 Generated with Claude Code

read_request_body() calls ap_map_http_request_error(), which is a
symbol of httpd itself (modules/http/http_filters.c), not of APR, so
the standalone module (and the IIS/nginx flavours built on it) failed
to link since that call was introduced.

Builds that define VERSION_STANDALONE, VERSION_IIS or VERSION_NGINX now
carry a local copy of the function, taken from httpd, under the same
name through a macro so the call site stays identical for the Apache
module.

Fixes owasp-modsecurity#3451

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0181jBv5JdNQviwDzfnkf1Gy
@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 00e19016-b882-46b6-87ff-31629c68fcd4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant