Project

General

Profile

Bug #1273

bugs if pfs_version_compare

Added by Thomas NOEL over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Upgrade
Target version:
Start date:
02/10/2011
Due date:
% Done:

100%

Estimated time:
0.20 h
Affected Version:
2.0
Affected Architecture:
All

Description

There are two bugs in functions which compare pfSense versions.
It doesn't work when update version is older than the installed one...

Here is a patch against /etc/inc/pfsense-utils.inc (also attached) :

--- pfsense-utils.inc.orig    2011-02-10 14:19:31.669065996 +0100
+++ pfsense-utils.inc    2011-02-10 14:19:05.809065993 +0100
@@ -1674,9 +1674,9 @@
     if ((!$a_time) || (!$b_time)) {
         return FALSE;
     } else {
-        if ($a < $b)
+        if ($a_time < $b_time)
             return -1;
-        elseif ($a == $b)
+        elseif ($a_time == $b_time)
             return 0;
         else
             return 1;
@@ -1735,7 +1735,7 @@
 }
 function pfs_version_compare($cur_time, $cur_text, $remote) {
     // First try date compare
-    $v = version_compare_dates($cur_time, $b);
+    $v = version_compare_dates($cur_time, $remote);
     if ($v === FALSE) {
         // If that fails, try to compare by string
         // Before anything else, simply test if the strings are equal

Thanks.

pfsense-utils.inc.diff (694 Bytes) pfsense-utils.inc.diff Thomas NOEL, 02/10/2011 08:21 AM

Associated revisions

Revision bda131b2 (diff)
Added by Jim Pingle over 8 years ago

Fix a date compare bug, resolves #1273

History

#1 Updated by Jim Pingle over 8 years ago

Committed, thanks!

#2 Updated by Jim Pingle over 8 years ago

  • Status changed from New to Feedback
  • % Done changed from 30 to 100

#3 Updated by Ermal Lu├ži over 8 years ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF