From 589b20473cc6b8fbe21d3cd5e2f7d80a405b44b4 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 14 May 2007 16:09:08 +0000 Subject: [PATCH] Safer caching of OS --- webmin/webmin-lib.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webmin/webmin-lib.pl b/webmin/webmin-lib.pl index 862282c0d..52767ab5b 100644 --- a/webmin/webmin-lib.pl +++ b/webmin/webmin-lib.pl @@ -790,7 +790,9 @@ if ($cache) { local %cache; local $uptime = &get_system_uptime(); local $lastreboot = $uptime ? time()-$uptime : undef; - if (&read_file($detect_operating_system_cache, \%cache)) { + if (&read_file($detect_operating_system_cache, \%cache) && + $cache{'os_type'} && $cache{'os_version'} && + $cache{'real_os_type'} && $cache{'real_os_version'}) { if ($cache{'time'} > time()-24*60*60 && $cache{'time'} > $lastreboot) { return %cache;