Skip to content

Commit 46db0d3

Browse files
Patch nginx for work item 56114630 to enable webdav module (#12888)
1 parent 189c033 commit 46db0d3

5 files changed

Lines changed: 46 additions & 7 deletions

File tree

SPECS/nginx/nginx.signatures.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"Signatures": {
3-
"nginx-njs-0.8.3.tar.gz": "5e1341ee8c1dfce420ea6456475dafa7d5f4b9aed310faca32597cf4d221cfe0",
4-
"nginx.service": "73a1321ae35eafc4e02614cde224fc0bf20ceba97f969b3373dd73c15c22a0e1",
5-
"nginx-1.25.4.tar.gz": "760729901acbaa517996e681ee6ea259032985e37c2768beef80df3a877deed9"
6-
}
2+
"Signatures": {
3+
"nginx-1.25.4.tar.gz": "760729901acbaa517996e681ee6ea259032985e37c2768beef80df3a877deed9",
4+
"nginx-njs-0.8.3.tar.gz": "5e1341ee8c1dfce420ea6456475dafa7d5f4b9aed310faca32597cf4d221cfe0",
5+
"nginx-tests.tgz": "5847fdc454543df77e07026e7de737f9e7ff093c8ce4afcbc2093a64e570ff83",
6+
"nginx.service": "73a1321ae35eafc4e02614cde224fc0bf20ceba97f969b3373dd73c15c22a0e1"
7+
}
78
}

SPECS/nginx/nginx.spec

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Name: nginx
66
# Currently on "stable" version of nginx from https://nginx.org/en/download.html.
77
# Note: Stable versions are even (1.20), mainline versions are odd (1.21)
88
Version: 1.25.4
9-
Release: 3%{?dist}
9+
Release: 4%{?dist}
1010
License: BSD-2-Clause
1111
Vendor: Microsoft Corporation
1212
Distribution: Azure Linux
@@ -15,11 +15,24 @@ URL: https://nginx.org/
1515
Source0: https://nginx.org/download/%{name}-%{version}.tar.gz
1616
Source1: nginx.service
1717
Source2: https://github.com/nginx/njs/archive/refs/tags/%{njs_version}.tar.gz#/%{name}-njs-%{njs_version}.tar.gz
18+
19+
%if 0%{?with_check}
20+
Source3: nginx-tests.tgz
21+
%endif
22+
1823
Patch0: CVE-2024-7347.patch
1924
Patch1: CVE-2025-23419.patch
2025
BuildRequires: libxml2-devel
2126
BuildRequires: libxslt-devel
2227
BuildRequires: openssl-devel
28+
29+
%if 0%{?with_check}
30+
BuildRequires: perl-FindBin
31+
BuildRequires: perl-Test-Harness
32+
BuildRequires: perl-lib
33+
BuildRequires: perl-App-cpanminus
34+
%endif
35+
2336
BuildRequires: pcre2-devel
2437
BuildRequires: readline-devel
2538
BuildRequires: which
@@ -54,7 +67,7 @@ The OpenTelemetry module for Nginx
5467
%prep
5568
%autosetup -p1
5669
pushd ../
57-
mkdir nginx-njs
70+
mkdir -p nginx-njs
5871
tar -C nginx-njs -xf %{SOURCE2}
5972

6073
%build
@@ -71,6 +84,7 @@ sh configure \
7184
--user=%{nginx_user} \
7285
--with-stream_ssl_module \
7386
--with-http_auth_request_module \
87+
--with-http_dav_module \
7488
--with-http_gunzip_module \
7589
--with-http_gzip_static_module \
7690
--with-http_realip_module \
@@ -102,6 +116,26 @@ getent passwd %{nginx_user} > /dev/null || \
102116
-s /sbin/nologin -c "Nginx web server" %{nginx_user}
103117
exit 0
104118

119+
%if 0%{?with_check}
120+
%check
121+
cpanm Test::Simple@1.302199 --force
122+
cpanm Time::HiRes
123+
cd %{buildroot}
124+
cp -r usr/sbin/* /usr/sbin/
125+
cp -r var/opt/* /var/opt/
126+
cp -r var/log/* /var/log/
127+
cp -r usr/lib/debug/usr/sbin/* /usr/lib/debug/sbin/
128+
cp -r usr/lib/systemd/* /usr/lib/systemd/
129+
cp -r etc/* /etc/
130+
cp /etc/nginx/mime.types.default /etc/nginx/mime.types
131+
useradd -s /usr/bin/sh %{nginx_user}
132+
tar -xvf %{SOURCE3}
133+
cd nginx-tests
134+
su nginx -s /bin/sh -c 'TEST_NGINX_BINARY=%{_sbindir}/nginx prove ./*.t'
135+
cd ..
136+
rm -rf nginx-tests
137+
%endif
138+
105139
%files
106140
%defattr(-,root,root)
107141
%license LICENSE
@@ -129,6 +163,10 @@ exit 0
129163
%dir %{_sysconfdir}/%{name}
130164

131165
%changelog
166+
* Tue Mar 11 2025 Sandeep Karambelkar <skarambelkar@microsoft.com> - 1.25.4-4
167+
- Enable webdav module
168+
- Added tests to verify nginx server and its supported modules
169+
132170
* Tue Feb 10 2025 Mitch Zhu <mitchzhu@microsoft.com> - 1.25.4-3
133171
- Fix CVE-2025-234419
134172

SPECS-EXTENDED/perl-Test-Harness/Test-Harness-3.38-Remove-shell-bangs.patch renamed to SPECS/perl-Test-Harness/Test-Harness-3.38-Remove-shell-bangs.patch

File renamed without changes.

SPECS-EXTENDED/perl-Test-Harness/perl-Test-Harness.signatures.json renamed to SPECS/perl-Test-Harness/perl-Test-Harness.signatures.json

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)