1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-18 17:27:20 +01:00

new build 3488; see #2147 "ASA Import - some versions are not detected correctly". SEtting version in the created firewall object to the best match of the version found in imported config

This commit is contained in:
Vadim Kurland 2011-02-26 10:45:40 -08:00
parent 59562d852c
commit 1258c4580e
9 changed files with 51 additions and 22 deletions

View File

@ -7,7 +7,7 @@ FWB_MICRO_VERSION=0
# build number is like "nano" version number. I am incrementing build
# number during development cycle
#
BUILD_NUM="3487"
BUILD_NUM="3488"
VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM"

View File

@ -1,2 +1,2 @@
#define VERSION "4.2.0.3487"
#define VERSION "4.2.0.3488"
#define GENERATION "4.2"

View File

@ -1,3 +1,15 @@
2011-02-26 vadim <vadim@netcitadel.com>
* platforms.cpp (findBestVersionMatch): fixes #2147 "ASA Import -
some versions are not detected correctly". when user imports
PIX/ASA configuration, firewall object will automatically be
configured with the version setting that best fits version
indicated in the imported configuration. Note that fwbuilder does
not provide the list of version numbers that match PIX/ASA
versions exactly, for example we do not have settings "7.1" and
"7.2". Devices running these versions of PIX/ASA software should
be configured with version "7.0" in fwbuilder.
2011-02-25 vadim <vadim@netcitadel.com>
* parsers/pix.g (intf_address): see #87 "Import of PIX

View File

@ -3,7 +3,7 @@
%define name fwbuilder
%define version 4.2.0.3487
%define version 4.2.0.3488
%define release 1
%if "%_vendor" == "MandrakeSoft"

View File

@ -4,6 +4,6 @@ Replaces: fwbuilder (<=4.1.1-1), fwbuilder-common, fwbuilder-bsd, fwbuilder-linu
Priority: extra
Section: checkinstall
Maintainer: vadim@fwbuilder.org
Version: 4.2.0.3487-1
Version: 4.2.0.3488-1
Depends: libqt4-gui (>= 4.3.0), libxml2, libxslt1.1, libsnmp | libsnmp15
Description: Firewall Builder GUI and policy compilers

View File

@ -1,6 +1,6 @@
%define name fwbuilder
%define version 4.2.0.3487
%define version 4.2.0.3488
%define release 1
%if "%_vendor" == "MandrakeSoft"

View File

@ -81,7 +81,11 @@ Firewall* PIXImporter::finalize()
Firewall *fw = Firewall::cast(getFirewallObject());
fw->setStr("host_OS", "pix");
Resources::setDefaultTargetOptions("pix" , fw);
fw->setStr("version", discovered_version);
string version = findBestVersionMatch(
"pix", discovered_version.c_str()).toStdString();
if ( ! version.empty())
fw->setStr("version", version);
FWObject *policy = getFirewallObject()->getFirstByType(Policy::TYPENAME);
assert( policy!=NULL );

View File

@ -1211,7 +1211,7 @@ void guessOSAndPlatformFromSysDescr(
<< "sysdescr=" << sysDescr;
list<QStringPair> allowed_versions;
string version_from_sysdescr;
QString version_from_sysdescr;
foreach (QRegExp re, pix_re)
{
@ -1219,7 +1219,7 @@ void guessOSAndPlatformFromSysDescr(
{
platform = "pix";
hostOS = "pix_os";
version_from_sysdescr = re.cap(1).toStdString();
version_from_sysdescr = re.cap(1);
}
}
@ -1230,7 +1230,7 @@ void guessOSAndPlatformFromSysDescr(
{
platform = "iosacl";
hostOS = "ios";
version_from_sysdescr = re.cap(1).toStdString();
version_from_sysdescr = re.cap(1);
}
}
@ -1238,25 +1238,35 @@ void guessOSAndPlatformFromSysDescr(
qDebug() << "guessOSAndPlatformFromSysDescr:"
<< "platform=" << platform
<< "hostOS=" << hostOS
<< "version=" << version_from_sysdescr.c_str();
<< "version=" << version_from_sysdescr;
if ( ! platform.isEmpty())
{
getVersionsForPlatform(platform, allowed_versions);
version = findBestVersionMatch(platform, version_from_sysdescr);
if ( ! version_from_sysdescr.empty())
}
QString findBestVersionMatch(const QString &platform,
const QString &discovered_version)
{
list<QStringPair> allowed_versions;
getVersionsForPlatform(platform, allowed_versions);
if ( ! discovered_version.isEmpty())
{
QString version_fit;
list<QStringPair>::iterator it;
foreach (QStringPair p, allowed_versions)
{
string version_fit;
list<QStringPair>::iterator it;
foreach (QStringPair p, allowed_versions)
{
string vers = p.first.toStdString();
if (XMLTools::version_compare(vers, version_from_sysdescr)>0) break;
version_fit = vers;
}
version = version_fit.c_str();
QString vers = p.first;
if (XMLTools::version_compare(vers.toStdString(),
discovered_version.toStdString())>0)
break;
version_fit = vers;
}
return version_fit;
}
return "";
}

View File

@ -187,6 +187,9 @@ void setHostOS(QComboBox *hostOS, const QString &platform, const QString &os);
void guessOSAndPlatformFromSysDescr(const QString &sysDescr,
QString &platform, QString &hostOS, QString &version);
QString findBestVersionMatch(const QString &platform,
const QString &discovered_version);
/*
* Internal: Auxiliary function that copies elements from the list returned by
* Resources::getResourceStrList() to the list of string pairs