From 0c4f4b3473e670556bec88bbb994ecc21e70d977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Uhliarik?= Date: Wed, 19 Nov 2025 18:59:56 +0100 Subject: [PATCH] Resolves: RHEL-114935 - Image mode: The dir /var/lib and /var/log is not created when updating system in image mode --- nginx.spec | 12 +++++++++++- nginx.tmpfiles | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 nginx.tmpfiles diff --git a/nginx.spec b/nginx.spec index 143c2ba..5ce7e22 100644 --- a/nginx.spec +++ b/nginx.spec @@ -41,7 +41,7 @@ Name: nginx Epoch: 2 Version: 1.20.1 -Release: 24%{?dist} +Release: 25%{?dist} Summary: A high performance web server and reverse proxy server # BSD License (two clause) @@ -63,6 +63,7 @@ Source14: nginx-upgrade.8 Source15: macros.nginxmods.in Source16: nginxmods.attr Source17: nginx.sysusers +Source18: nginx.tmpfiles Source102: nginx-logo.png Source103: 404.html Source104: 50x.html @@ -483,6 +484,10 @@ install -Dpm0644 -t %{buildroot}%{_fileattrsdir} %{SOURCE16} # install sysusers file install -p -D -m 0644 %{SOURCE17} %{buildroot}%{_sysusersdir}/nginx.conf +# tmpfiles.d configuration +mkdir -p %{buildroot}%{_tmpfilesdir} +install -m 644 -p %{SOURCE18} %{buildroot}%{_tmpfilesdir}/nginx.conf + %pre filesystem %sysusers_create_compat %{SOURCE17} @@ -570,6 +575,7 @@ fi %attr(770,%{nginx_user},root) %dir %{_localstatedir}/lib/nginx %attr(770,%{nginx_user},root) %dir %{_localstatedir}/lib/nginx/tmp %attr(711,root,root) %dir %{_localstatedir}/log/nginx +%{_tmpfilesdir}/nginx.conf %ghost %attr(640,%{nginx_user},root) %{_localstatedir}/log/nginx/access.log %ghost %attr(640,%{nginx_user},root) %{_localstatedir}/log/nginx/error.log %dir %{nginx_moduledir} @@ -623,6 +629,10 @@ fi %changelog +* Wed Nov 19 2025 Luboš Uhliarik - 2:1.20.1-25 +- Resolves: RHEL-114935 - Image mode: The dir /var/lib and /var/log + is not created when updating system in image mode + * Wed May 14 2025 Luboš Uhliarik - 2:1.20.1-24 - Resolves: RHEL-84477 - nginx: specially crafted MP4 file may cause denial of service (CVE-2024-7347) diff --git a/nginx.tmpfiles b/nginx.tmpfiles new file mode 100644 index 0000000..74cc467 --- /dev/null +++ b/nginx.tmpfiles @@ -0,0 +1,4 @@ +d /var/lib/nginx 770 nginx root - +d /var/lib/nginx/tmp 770 nginx root - +d /var/log/nginx 711 root root - +