Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PCRE2 #2719

Merged
merged 1 commit into from
Apr 21, 2022
Merged

Support PCRE2 #2719

merged 1 commit into from
Apr 21, 2022

Conversation

martinhsv
Copy link
Contributor

@martinhsv martinhsv commented Apr 20, 2022

This pull request provides initial support for PCRE2 on an experimental basis. (Closes #2668 )

To use PCRE2 with nginx and ModSecurity you need to:

  • use a version of nginx that supports it (e.g. nginx v1.21.5 or 1.21.6)
  • use a version of the connector (ModSecurity-nginx) at or later than owasp-modsecurity/ModSecurity-nginx@1c32794
  • include the --with-pcre2 option when running ModSecurity's ./configure

@martinhsv martinhsv merged commit ced56c5 into v3/master Apr 21, 2022
@martinhsv martinhsv added this to Done in v3.0.7 Apr 21, 2022
@istiak101
Copy link

istiak101 commented May 31, 2022

Do I need to pass the PCRE2 path too? Explicit --with-pcre2=yes didn't work.

checking for libpcre config script... no
configure: *** pcre library not found.
configure: error: pcre library is required

I don't know it's using build/pcre.m4 instead of build/pcre2.m4

Compiling with PCRE1 works.

@istiak101
Copy link

So PCRE1 config binary location is /usr/bin/pcre-config and PCRE2 config binary /usr/bin/pcre2-config.
In PCRE1 the config script is detected correctly but not with PCRE2.

@dvershinin
Copy link
Contributor

@istiak101 @martinhsv apparently there's a bug somewhere.

--with-pcre2 only compiles fine if both pcre1 and pcre2 devel libs installed. And the resulting binary links with both, which is incorrect, of course.

If only pcre2 devel is installed on the system, the error message during configure is always configure: error: pcre library is required.

See filed new bug #2750

@martinhsv
Copy link
Contributor Author

martinhsv commented May 31, 2022

Hello @istiak101 ,

As @dvershinin has noted, the dependency on pcre1 has not been removed even if you specifically want to use pcre2. But beyond that, does it work if you just use (although =yes should work too):

./configure --with-pcre2

@istiak101
Copy link

Hello @martinhsv,

Yes if install both pcre-devel and pcre2-devel it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Add support for PCRE2
3 participants