commit:     e98d8ef5572fae7d42e80acbb2464e70eb0ab5e7
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Fri Aug 30 09:19:56 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep  2 02:54:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e98d8ef5

www-servers/nginx: add patch for http_security from upstream

see 
https://github.com/owasp-modsecurity/ModSecurity-nginx/commit/7d37ace7431ea9704faa98f29876bcd72ef4b1ff

Closes: https://bugs.gentoo.org/933598
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/38343
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../nginx/files/http_security-nginx-1.26.2.patch   | 26 ++++++++++++++++++++++
 ...inx-1.26.2-r1.ebuild => nginx-1.26.2-r2.ebuild} |  6 +++++
 ...inx-1.27.1-r1.ebuild => nginx-1.27.1-r2.ebuild} |  6 +++++
 3 files changed, 38 insertions(+)

diff --git a/www-servers/nginx/files/http_security-nginx-1.26.2.patch 
b/www-servers/nginx/files/http_security-nginx-1.26.2.patch
new file mode 100644
index 000000000000..26e3ea6046f0
--- /dev/null
+++ b/www-servers/nginx/files/http_security-nginx-1.26.2.patch
@@ -0,0 +1,26 @@
+From 7d37ace7431ea9704faa98f29876bcd72ef4b1ff Mon Sep 17 00:00:00 2001
+From: Ervin Hegedus <[email protected]>
+Date: Tue, 23 Apr 2024 21:42:02 +0200
+Subject: [PATCH] fix: Added missing header for conftest
+
+---
+ config | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/config b/config
+index c6e7467..3bf06a8 100644
+--- a/config
++++ b/config
+@@ -10,7 +10,8 @@
+ 
+ ngx_feature_name=
+ ngx_feature_run=no
+-ngx_feature_incs="#include <modsecurity/modsecurity.h>"
++ngx_feature_incs="#include <modsecurity/modsecurity.h>
++#include <stdio.h>"
+ ngx_feature_libs="-lmodsecurity"
+ ngx_feature_test='printf("hello");'
+ ngx_modsecurity_opt_I=
+-- 
+2.26.2
+

diff --git a/www-servers/nginx/nginx-1.26.2-r1.ebuild 
b/www-servers/nginx/nginx-1.26.2-r2.ebuild
similarity index 99%
rename from www-servers/nginx/nginx-1.26.2-r1.ebuild
rename to www-servers/nginx/nginx-1.26.2-r2.ebuild
index 1971e684ca8a..fe6db3b44206 100644
--- a/www-servers/nginx/nginx-1.26.2-r1.ebuild
+++ b/www-servers/nginx/nginx-1.26.2-r2.ebuild
@@ -459,6 +459,12 @@ src_prepare() {
                cd "${S}" || die
        fi
 
+       if use nginx_modules_http_security ; then
+               cd "${HTTP_SECURITY_MODULE_WD}" || die
+               eapply "${FILESDIR}/http_security-nginx-1.26.2.patch"
+               cd "${S}" || die
+       fi
+
        find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& 
\\$(MAKE):' || die
        # We have config protection, don't rename etc files
        sed -i 's:.default::' auto/install || die

diff --git a/www-servers/nginx/nginx-1.27.1-r1.ebuild 
b/www-servers/nginx/nginx-1.27.1-r2.ebuild
similarity index 99%
rename from www-servers/nginx/nginx-1.27.1-r1.ebuild
rename to www-servers/nginx/nginx-1.27.1-r2.ebuild
index 34de22d938e8..bfc1a4a791b6 100644
--- a/www-servers/nginx/nginx-1.27.1-r1.ebuild
+++ b/www-servers/nginx/nginx-1.27.1-r2.ebuild
@@ -459,6 +459,12 @@ src_prepare() {
                cd "${S}" || die
        fi
 
+       if use nginx_modules_http_security ; then
+               cd "${HTTP_SECURITY_MODULE_WD}" || die
+               eapply "${FILESDIR}/http_security-nginx-1.26.2.patch"
+               cd "${S}" || die
+       fi
+
        find auto/ -type f -print0 | xargs -0 sed -i 's:\&\& make:\&\& 
\\$(MAKE):' || die
        # We have config protection, don't rename etc files
        sed -i 's:.default::' auto/install || die

Reply via email to