mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-19 01:37:17 +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:
parent
59562d852c
commit
1258c4580e
2
VERSION
2
VERSION
@ -7,7 +7,7 @@ FWB_MICRO_VERSION=0
|
|||||||
# build number is like "nano" version number. I am incrementing build
|
# build number is like "nano" version number. I am incrementing build
|
||||||
# number during development cycle
|
# number during development cycle
|
||||||
#
|
#
|
||||||
BUILD_NUM="3487"
|
BUILD_NUM="3488"
|
||||||
|
|
||||||
VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM"
|
VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM"
|
||||||
|
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
#define VERSION "4.2.0.3487"
|
#define VERSION "4.2.0.3488"
|
||||||
#define GENERATION "4.2"
|
#define GENERATION "4.2"
|
||||||
|
|||||||
@ -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>
|
2011-02-25 vadim <vadim@netcitadel.com>
|
||||||
|
|
||||||
* parsers/pix.g (intf_address): see #87 "Import of PIX
|
* parsers/pix.g (intf_address): see #87 "Import of PIX
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
%define name fwbuilder
|
%define name fwbuilder
|
||||||
%define version 4.2.0.3487
|
%define version 4.2.0.3488
|
||||||
%define release 1
|
%define release 1
|
||||||
|
|
||||||
%if "%_vendor" == "MandrakeSoft"
|
%if "%_vendor" == "MandrakeSoft"
|
||||||
|
|||||||
@ -4,6 +4,6 @@ Replaces: fwbuilder (<=4.1.1-1), fwbuilder-common, fwbuilder-bsd, fwbuilder-linu
|
|||||||
Priority: extra
|
Priority: extra
|
||||||
Section: checkinstall
|
Section: checkinstall
|
||||||
Maintainer: vadim@fwbuilder.org
|
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
|
Depends: libqt4-gui (>= 4.3.0), libxml2, libxslt1.1, libsnmp | libsnmp15
|
||||||
Description: Firewall Builder GUI and policy compilers
|
Description: Firewall Builder GUI and policy compilers
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
%define name fwbuilder
|
%define name fwbuilder
|
||||||
%define version 4.2.0.3487
|
%define version 4.2.0.3488
|
||||||
%define release 1
|
%define release 1
|
||||||
|
|
||||||
%if "%_vendor" == "MandrakeSoft"
|
%if "%_vendor" == "MandrakeSoft"
|
||||||
|
|||||||
@ -81,7 +81,11 @@ Firewall* PIXImporter::finalize()
|
|||||||
Firewall *fw = Firewall::cast(getFirewallObject());
|
Firewall *fw = Firewall::cast(getFirewallObject());
|
||||||
fw->setStr("host_OS", "pix");
|
fw->setStr("host_OS", "pix");
|
||||||
Resources::setDefaultTargetOptions("pix" , fw);
|
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);
|
FWObject *policy = getFirewallObject()->getFirstByType(Policy::TYPENAME);
|
||||||
assert( policy!=NULL );
|
assert( policy!=NULL );
|
||||||
|
|||||||
@ -1211,7 +1211,7 @@ void guessOSAndPlatformFromSysDescr(
|
|||||||
<< "sysdescr=" << sysDescr;
|
<< "sysdescr=" << sysDescr;
|
||||||
|
|
||||||
list<QStringPair> allowed_versions;
|
list<QStringPair> allowed_versions;
|
||||||
string version_from_sysdescr;
|
QString version_from_sysdescr;
|
||||||
|
|
||||||
foreach (QRegExp re, pix_re)
|
foreach (QRegExp re, pix_re)
|
||||||
{
|
{
|
||||||
@ -1219,7 +1219,7 @@ void guessOSAndPlatformFromSysDescr(
|
|||||||
{
|
{
|
||||||
platform = "pix";
|
platform = "pix";
|
||||||
hostOS = "pix_os";
|
hostOS = "pix_os";
|
||||||
version_from_sysdescr = re.cap(1).toStdString();
|
version_from_sysdescr = re.cap(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1230,7 +1230,7 @@ void guessOSAndPlatformFromSysDescr(
|
|||||||
{
|
{
|
||||||
platform = "iosacl";
|
platform = "iosacl";
|
||||||
hostOS = "ios";
|
hostOS = "ios";
|
||||||
version_from_sysdescr = re.cap(1).toStdString();
|
version_from_sysdescr = re.cap(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1238,25 +1238,35 @@ void guessOSAndPlatformFromSysDescr(
|
|||||||
qDebug() << "guessOSAndPlatformFromSysDescr:"
|
qDebug() << "guessOSAndPlatformFromSysDescr:"
|
||||||
<< "platform=" << platform
|
<< "platform=" << platform
|
||||||
<< "hostOS=" << hostOS
|
<< "hostOS=" << hostOS
|
||||||
<< "version=" << version_from_sysdescr.c_str();
|
<< "version=" << version_from_sysdescr;
|
||||||
|
|
||||||
if ( ! platform.isEmpty())
|
if ( ! platform.isEmpty())
|
||||||
{
|
version = findBestVersionMatch(platform, version_from_sysdescr);
|
||||||
getVersionsForPlatform(platform, allowed_versions);
|
|
||||||
|
|
||||||
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;
|
QString vers = p.first;
|
||||||
list<QStringPair>::iterator it;
|
if (XMLTools::version_compare(vers.toStdString(),
|
||||||
foreach (QStringPair p, allowed_versions)
|
discovered_version.toStdString())>0)
|
||||||
{
|
break;
|
||||||
string vers = p.first.toStdString();
|
version_fit = vers;
|
||||||
if (XMLTools::version_compare(vers, version_from_sysdescr)>0) break;
|
|
||||||
version_fit = vers;
|
|
||||||
}
|
|
||||||
version = version_fit.c_str();
|
|
||||||
}
|
}
|
||||||
|
return version_fit;
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -187,6 +187,9 @@ void setHostOS(QComboBox *hostOS, const QString &platform, const QString &os);
|
|||||||
void guessOSAndPlatformFromSysDescr(const QString &sysDescr,
|
void guessOSAndPlatformFromSysDescr(const QString &sysDescr,
|
||||||
QString &platform, QString &hostOS, QString &version);
|
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
|
* Internal: Auxiliary function that copies elements from the list returned by
|
||||||
* Resources::getResourceStrList() to the list of string pairs
|
* Resources::getResourceStrList() to the list of string pairs
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user