[packages/nagios] Rel 3; refresh evern on google chrome error page

arekm arekm at pld-linux.org
Tue Mar 17 00:38:24 CET 2026


commit 06edcbae5012935fc04a7417f03deabe626701c6
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Mar 17 00:38:14 2026 +0100

    Rel 3; refresh evern on google chrome error page

 nagios-resilient-refresh.patch | 24 +++++++++++++++++-------
 nagios.spec                    |  2 +-
 2 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/nagios.spec b/nagios.spec
index 258e149..62be271 100644
--- a/nagios.spec
+++ b/nagios.spec
@@ -13,7 +13,7 @@ Summary(pl.UTF-8):	Program do monitorowania serwerów/usług/sieci
 Summary(pt_BR.UTF-8):	Programa para monitoração de máquinas e serviços
 Name:		nagios
 Version:	4.5.11
-Release:	2
+Release:	3
 License:	GPL v2+
 Group:		Networking
 # https://www.nagios.org/downloads/nagios-core/thanks/?product_download=nagioscore-source
diff --git a/nagios-resilient-refresh.patch b/nagios-resilient-refresh.patch
index a02b2b5..11543f6 100644
--- a/nagios-resilient-refresh.patch
+++ b/nagios-resilient-refresh.patch
@@ -2,7 +2,9 @@ Resilient refresh for main content iframe.
 
 CGI pages use the HTTP Refresh header to auto-reload, but when a reload
 fails due to a network outage the browser displays an error page that
-lacks the header, permanently breaking the refresh cycle.
+lacks the header, permanently breaking the refresh cycle. Browser error
+pages (e.g. chrome-error://chromewebdata/) also make the iframe
+cross-origin, blocking both reload() and src assignment from the parent.
 
 The fix has two parts:
 1. index.php (parent frame, never reloads) exposes a nagiosSetRefresh()
@@ -14,11 +16,12 @@ The fix has two parts:
 The fallback timer fires at 2x the refresh interval, so it only acts
 when the CGI's own Refresh header has failed. On success, the reloaded
 page calls nagiosSetRefresh() again, resetting the cycle. On failure,
-the timer retries at the normal interval until the server is reachable.
+the iframe element is replaced entirely to bypass cross-origin
+restrictions on browser error pages, then retries at the normal interval.
 
 --- nagios-4.5.11.orig/html/index.php.in	2026-01-14 17:37:45.000000000 +0100
-+++ nagios-4.5.11/html/index.php.in	2026-03-14 13:13:54.586581151 +0100
-@@ -45,6 +45,37 @@
++++ nagios-4.5.11/html/index.php.in	2026-03-17 00:33:38.626558380 +0100
+@@ -45,6 +45,44 @@ if ($theme != 'dark' && $theme != 'light
  	<script LANGUAGE="javascript">
  		var n = Math.round(Math.random() * 10000000000);
  		document.cookie = "NagFormId=" + n.toString(16);
@@ -46,8 +49,15 @@ the timer retries at the normal interval until the server is reachable.
 +						if (f && f.contentWindow)
 +							f.contentWindow.location.reload();
 +					} catch(e) {
-+						if (f && _nagiosRefreshUrl)
-+							f.src = _nagiosRefreshUrl;
++						// Browser error pages (e.g. chrome-error://) make
++						// the iframe cross-origin, blocking reload() and
++						// src assignment. Replace the element entirely.
++						if (f && _nagiosRefreshUrl) {
++							var nf = document.createElement('iframe');
++							nf.name = 'main';
++							nf.src = _nagiosRefreshUrl;
++							f.parentNode.replaceChild(nf, f);
++						}
 +					}
 +					_nagiosRefreshTimer = setTimeout(doRefresh, rate * 1000);
 +				}, rate * 2 * 1000);
@@ -57,7 +67,7 @@ the timer retries at the normal interval until the server is reachable.
 
  	<style>
 --- nagios-4.5.11.orig/cgi/cgiutils.c	2026-01-14 17:37:45.000000000 +0100
-+++ nagios-4.5.11/cgi/cgiutils.c	2026-03-14 13:17:09.096581142 +0100
++++ nagios-4.5.11/cgi/cgiutils.c	2026-03-17 00:33:55.000000000 +0100
 @@ -1658,6 +1658,8 @@
  	printf("Last Updated: %s<BR>\n", date_time);
  	if(refresh == TRUE)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios.git/commitdiff/06edcbae5012935fc04a7417f03deabe626701c6



More information about the pld-cvs-commit mailing list