diff --git a/VERSION b/VERSION index 143ea50c4..c37337446 100644 --- a/VERSION +++ b/VERSION @@ -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="3466" +BUILD_NUM="3467" VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM" diff --git a/VERSION.h b/VERSION.h index f04ac3d58..e9f27c308 100644 --- a/VERSION.h +++ b/VERSION.h @@ -1,2 +1,2 @@ -#define VERSION "4.2.0.3466" +#define VERSION "4.2.0.3467" #define GENERATION "4.2" diff --git a/doc/ChangeLog b/doc/ChangeLog index 03c2f16b1..6cf1eb539 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,17 @@ 2011-02-08 vadim + * SSHUnx.cpp (SSHUnx): fixes #2061 "Installer shows success for + failed installed on FreeBSD due to corrupt script file". Added + bunch of common shell error messages to make sure installer + recognizes them and mark install as a failure even if ssh fails + to pass termination code. + + * instDialog.cpp (showPage): fixes #2037 "If there is an error + when compiling firewall then installer should be + aborted". Compile/install wizard should disable "Next" button + after compile phase is done if all firewalls failed to compile + with no errors. + * configlets/bsd/update_bridge: fixes #2042 "add configlet and shell functions to manage bridge interfaces via shell script on OpenBSD and FreeBSD". Bridge interfaces are managed incrementally, diff --git a/packaging/fwbuilder-static-qt.spec b/packaging/fwbuilder-static-qt.spec index 50245ab41..a331087f9 100644 --- a/packaging/fwbuilder-static-qt.spec +++ b/packaging/fwbuilder-static-qt.spec @@ -3,7 +3,7 @@ %define name fwbuilder -%define version 4.2.0.3466 +%define version 4.2.0.3467 %define release 1 %if "%_vendor" == "MandrakeSoft" diff --git a/packaging/fwbuilder.control b/packaging/fwbuilder.control index 8a0c7f844..edd755ce7 100644 --- a/packaging/fwbuilder.control +++ b/packaging/fwbuilder.control @@ -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.3466-1 +Version: 4.2.0.3467-1 Depends: libqt4-gui (>= 4.3.0), libxml2, libxslt1.1, libsnmp | libsnmp15 Description: Firewall Builder GUI and policy compilers diff --git a/packaging/fwbuilder.spec b/packaging/fwbuilder.spec index ae64ca6aa..4d3844616 100644 --- a/packaging/fwbuilder.spec +++ b/packaging/fwbuilder.spec @@ -1,6 +1,6 @@ %define name fwbuilder -%define version 4.2.0.3466 +%define version 4.2.0.3467 %define release 1 %if "%_vendor" == "MandrakeSoft" diff --git a/src/compiler_lib/CompilerDriver_compile.cpp b/src/compiler_lib/CompilerDriver_compile.cpp index d072afe47..0a3185d3b 100644 --- a/src/compiler_lib/CompilerDriver_compile.cpp +++ b/src/compiler_lib/CompilerDriver_compile.cpp @@ -92,7 +92,8 @@ void CompilerDriver::compile() for (list::iterator it=members.begin(); it!=members.end(); ++it) { info("\n"); - info(" Firewall " + (*it)->getName() + " member of cluster " + fw->getName()); + info(" Firewall " + (*it)->getName() + + " member of cluster " + fw->getName()); CompilerDriver *cl_driver = clone(); cl_driver->configure(args); @@ -100,6 +101,8 @@ void CompilerDriver::compile() cl_driver->run(objdb->getStringId(fw->getId()), objdb->getStringId((*it)->getId()), ""); + if (cl_driver->status == BaseCompiler::FWCOMPILER_ERROR) + status = cl_driver->status; delete cl_driver; } } diff --git a/src/ipt/ipt.cpp b/src/ipt/ipt.cpp index 2ebbe8631..34fee9ae5 100644 --- a/src/ipt/ipt.cpp +++ b/src/ipt/ipt.cpp @@ -152,6 +152,7 @@ int main(int argc, char **argv) } driver.compile(); delete objdb; + return (driver.getStatus() == BaseCompiler::FWCOMPILER_SUCCESS) ? 0 : 1; } catch(const FWException &ex) diff --git a/src/libgui/SSHUnx.cpp b/src/libgui/SSHUnx.cpp index 0ed3ff0e1..520639635 100644 --- a/src/libgui/SSHUnx.cpp +++ b/src/libgui/SSHUnx.cpp @@ -72,6 +72,12 @@ SSHUnx::SSHUnx(QWidget *_par, errorsLoggedin << "No such file or directory"; errorsLoggedin << "Cannot allocate memory"; + shell_errors << "Syntax error:"; + shell_errors << "No command .* found"; + shell_errors << "Command not found"; + shell_errors << "[fF]ile .* does not exist"; + shell_errors << "[iI]nterface .* does not exist"; + iptables_errors << "'iptables --help' for more information."; iptables_errors << "'iptables-restore --help' for more information."; iptables_errors << "iptables-restore: line .* failed"; diff --git a/src/libgui/SSHUnx.h b/src/libgui/SSHUnx.h index df3e0ee84..8e5dd2304 100644 --- a/src/libgui/SSHUnx.h +++ b/src/libgui/SSHUnx.h @@ -38,8 +38,9 @@ class SSHUnx : public SSHSession { - Q_OBJECT + Q_OBJECT; + QStringList shell_errors; QStringList iptables_errors; QStringList pfctl_errors; QStringList route_add_errors; diff --git a/src/libgui/instDialog.cpp b/src/libgui/instDialog.cpp index f8a4ada10..cc0b23f73 100644 --- a/src/libgui/instDialog.cpp +++ b/src/libgui/instDialog.cpp @@ -461,9 +461,24 @@ void instDialog::showPage(const int page) // Flag compile_complete is set in instDialog::mainLoopCompile() if (compile_complete) { - setNextEnabled(page, true); + // See #2037: enable "Next" button only if there is at + // least one firewall that was successfully compiled. + bool can_install = false; + list::iterator i; + for(i=install_fw_list.begin(); i!=install_fw_list.end(); ++i) + { + Firewall *fw = *i; + if (compile_status[fw] == + fwcompiler::BaseCompiler::FWCOMPILER_SUCCESS) + { + setNextEnabled(page, true); + m_dialog->nextButton->setDefault(true); + can_install = true; + break; + } + } + if (!can_install) setFinishEnabled(page, true); setBackEnabled(page, true); - m_dialog->nextButton->setDefault(true); } else { mw->fileSave(); diff --git a/src/libgui/instDialog.h b/src/libgui/instDialog.h index 520bc50f5..d44979b99 100644 --- a/src/libgui/instDialog.h +++ b/src/libgui/instDialog.h @@ -49,6 +49,7 @@ #include #include "fwbuilder/FWObjectDatabase.h" +#include "fwcompiler/BaseCompiler.h" class FirewallInstaller; class instBatchOptionsDialog; @@ -113,7 +114,9 @@ class instDialog : public QDialog, public FakeWizard std::map opListMapping; std::list error_re; std::list warning_re; - + std::map + compile_status; + QString path; //path of the program to execute // QStringList args; //arguments for that program diff --git a/src/libgui/instDialog_ui_ops.cpp b/src/libgui/instDialog_ui_ops.cpp index db0b6c317..42c15ba51 100644 --- a/src/libgui/instDialog_ui_ops.cpp +++ b/src/libgui/instDialog_ui_ops.cpp @@ -359,6 +359,7 @@ void instDialog::setInProcessState(QTreeWidgetItem *item) void instDialog::opSuccess(Firewall *fw) { + compile_status[fw] = fwcompiler::BaseCompiler::FWCOMPILER_SUCCESS; QTreeWidgetItem* itm = opListMapping[(fw)->getId()]; if (itm) { @@ -373,6 +374,7 @@ void instDialog::opSuccess(Firewall *fw) void instDialog::opError(Firewall *fw) { + compile_status[fw] = fwcompiler::BaseCompiler::FWCOMPILER_ERROR; QTreeWidgetItem* itm = opListMapping[(fw)->getId()]; if (itm) { @@ -384,6 +386,7 @@ void instDialog::opError(Firewall *fw) void instDialog::opCancelled(Firewall *fw) { + compile_status[fw] = fwcompiler::BaseCompiler::FWCOMPILER_ERROR; QTreeWidgetItem* itm = opListMapping[(fw)->getId()]; // itm can be NULL, for example when we install to PIX cluster // where we skip one of the members @@ -988,7 +991,7 @@ void instDialog::fillInstallUIList() list::iterator i; for(i=install_fw_list.begin(); i!=install_fw_list.end(); ++i) { - f=(*i); + f = (*i); item = new InstallFirewallViewItem( NULL, QString::fromUtf8(f->getName().c_str()),