Project

General

Profile

Actions

Bug #1273

closed

bugs if pfs_version_compare

Added by Thomas NOEL almost 14 years ago. Updated almost 14 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
Plus Target Version:
Release Notes:
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.


Files

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

Updated by Jim Pingle almost 14 years ago

Committed, thanks!

Actions #2

Updated by Jim Pingle almost 14 years ago

  • Status changed from New to Feedback
  • % Done changed from 30 to 100
Actions #3

Updated by Ermal Luçi almost 14 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF