diff --git a/build_num b/build_num index 86c354d21..ecd52b379 100644 --- a/build_num +++ b/build_num @@ -1 +1 @@ -#define BUILD_NUM 1504 +#define BUILD_NUM 1505 diff --git a/src/gui/pixAdvancedDialog.cpp b/src/gui/pixAdvancedDialog.cpp index 080a86edf..aa54297a7 100644 --- a/src/gui/pixAdvancedDialog.cpp +++ b/src/gui/pixAdvancedDialog.cpp @@ -55,13 +55,10 @@ #include #include #include -#include -#include #include #include -#include using namespace std; using namespace libfwbuilder; @@ -76,46 +73,6 @@ pixAdvancedDialog::pixAdvancedDialog(QWidget*, FWObject *o)//(parent) Firewall *fw=Firewall::cast(obj); FWOptions *fwopt=fw->getOptionsObject(); - string compiler=fwopt->getStr("compiler"); - if (compiler=="") - { - compiler=Resources::platform_res[fw->getStr("platform")]->getCompiler(); - } -/* - * On Unix compilers are installed in the standard place and are - * accessible via PATH. On Windows and Mac they get installed in - * unpredictable directories and need to be found - * - * first, check if user specified an absolute path for the compiler, - * then check if compiler is registsred in preferences, and if not, - * look for it in appRootDir and if it is not there, rely on PATH - */ -#if defined(Q_OS_WIN32) || defined(Q_OS_MACX) - - if ( ! QFile::exists( compiler.c_str() ) ) - { - string ts = string("Compilers/")+compiler; - QString cmppath = st->getStr( ts.c_str() ); - if (!cmppath.isEmpty()) compiler=cmppath.toLatin1().constData(); - else - { - /* try to find compiler in appRootDir. */ - string ts = getPathToBinary(compiler); - if ( QFile::exists( ts.c_str() ) ) - compiler = ts; - } - } -#endif - - fwb_pix_proc = new QProcess(); - - connect(fwb_pix_proc, SIGNAL(readyReadStandardOutput()), this, SLOT(readFromStdout() ) ); - connect(fwb_pix_proc, SIGNAL(readyReadStandardError()), this, SLOT(readFromStderr() ) ); - connect(fwb_pix_proc, SIGNAL(stateChanged( QProcess::ProcessState )), this, SLOT(fwb_pix_Finished( QProcess::ProcessState ) ) ); - connect(fwb_pix_proc, SIGNAL(bytesWritten(qint64)), this, SLOT(allXMLSent() ) ); - - compilerPath = compiler.c_str(); - argumentList << "-f" << "-" << "-I" << fw->getName().c_str(); string vers="version_"+obj->getStr("version"); string platform = obj->getStr("platform"); // could be 'pix' or 'fwsm' @@ -210,9 +167,7 @@ pixAdvancedDialog::pixAdvancedDialog(QWidget*, FWObject *o)//(parent) syslogFacilityMapping.push_back("LOCAL7"); syslogFacilityMapping.push_back("23"); - - - FWOptions *fwoptions=(Firewall::cast(obj))->getOptionsObject(); + FWOptions *fwoptions = (Firewall::cast(obj))->getOptionsObject(); assert(fwoptions!=NULL); bool f1=fwoptions->getBool("pix_acl_basic"); @@ -239,7 +194,8 @@ pixAdvancedDialog::pixAdvancedDialog(QWidget*, FWObject *o)//(parent) /* Page "Compiler Options" */ bool outboundACLSupported= (Resources::platform_res[platform]->getResourceBool( - "/FWBuilderResources/Target/options/"+vers+"/pix_outbound_acl_supported") ); + "/FWBuilderResources/Target/options/" + + vers + "/pix_outbound_acl_supported")); if (outboundACLSupported) m_dialog->pix_emulate_out_acl->hide(); @@ -247,8 +203,9 @@ pixAdvancedDialog::pixAdvancedDialog(QWidget*, FWObject *o)//(parent) m_dialog->pix_generate_out_acl->hide(); m_dialog->tabWidget->setTabEnabled(8,false); //Disable tab - data.registerOption(m_dialog->ipv4before_2, fwoptions, "ipv4_6_order", QStringList() << "IPv4 before IPv6" <<"ipv4_first" << "IPv6 before IPv4" << "ipv6_first"); - + data.registerOption(m_dialog->ipv4before_2, fwoptions, + "ipv4_6_order", + QStringList() << "IPv4 before IPv6" <<"ipv4_first" << "IPv6 before IPv4" << "ipv6_first"); data.registerOption( m_dialog->outputFileName, fwoptions, "output_file"); @@ -795,63 +752,11 @@ void pixAdvancedDialog::displayCommands() driver.setTargetId(FWObjectDatabase::getStringId(obj->getId())); string inspectors = driver.protocolInspectorCommands(); m_dialog->pix_generated_fixup->setText(inspectors.c_str()); - -#if CALL_COMPILER_AS_EXT_PROCESS - xmlChar *buffer; - int bufsize; - obj->getRoot()->saveToBuffer(&buffer, &bufsize); - proc_buffer = (char*)buffer; - FREEXMLBUFF(buffer); - - fwb_pix_proc->start(compilerPath, argumentList); - if ( !fwb_pix_proc->waitForStarted() ) - { - m_dialog->pix_generated_fixup->append( - tr("Error: Policy compiler for PIX is not installed") ); - } - - fwb_pix_proc->write(proc_buffer.toAscii()); -#endif } -void pixAdvancedDialog::allXMLSent() -{ - fwb_pix_proc->closeWriteChannel(); -} - -void pixAdvancedDialog::readFromStdout() -{ - m_dialog->pix_generated_fixup->append( QString( fwb_pix_proc->readAllStandardOutput() ) ); -} - -void pixAdvancedDialog::readFromStderr() -{ - m_dialog->pix_generated_fixup->append( QString( fwb_pix_proc->readAllStandardError() ) ); -} - -void pixAdvancedDialog::fwb_pix_Finished( QProcess::ProcessState newState ) -{ - if (newState != QProcess::NotRunning) return; - - if (fwb_pix_proc->exitStatus() != QProcess::NormalExit) - m_dialog->pix_generated_fixup->append( tr("Compiler error") ); -} - - void pixAdvancedDialog::updateFixupCommandsDisplay() { - - m_dialog->pix_generated_fixup->setText(""); - return; - - QString stdoutBuffer; - - fwb_pix_proc->start(compilerPath, argumentList); - if ( !fwb_pix_proc->waitForStarted() ) - { - m_dialog->pix_generated_fixup->append( tr("Error: Policy compiler for PIX is not installed") ); - } - return; + displayCommands(); } void pixAdvancedDialog::fixupCmdChanged() diff --git a/src/gui/pixAdvancedDialog.h b/src/gui/pixAdvancedDialog.h index 5df9815fa..9e3548caa 100644 --- a/src/gui/pixAdvancedDialog.h +++ b/src/gui/pixAdvancedDialog.h @@ -30,7 +30,6 @@ #include #include "DialogData.h" -#include #include @@ -38,7 +37,6 @@ class QWidget; class QSpinBox; class QComboBox; class QCheckBox; -class QProcess; namespace libfwbuilder { class FWObject; @@ -74,10 +72,6 @@ class pixAdvancedDialog : public QDialog DialogData data; std::list allFixups; bool syslogDeviceIdSupported; - QProcess *fwb_pix_proc; - QString proc_buffer; - QStringList argumentList; - QString compilerPath; Ui::pixAdvancedDialog_q *m_dialog; @@ -111,11 +105,6 @@ protected slots: virtual void scriptACLModeChanged(); virtual void displayCommands(); -public slots: - virtual void readFromStdout(); - virtual void readFromStderr(); - virtual void fwb_pix_Finished( QProcess::ProcessState ); - virtual void allXMLSent(); }; #endif // __PIXADVANCEDDIALOG_H diff --git a/src/gui/pixadvanceddialog_q.ui b/src/gui/pixadvanceddialog_q.ui index 62bdd84f8..a7e099e01 100644 --- a/src/gui/pixadvanceddialog_q.ui +++ b/src/gui/pixadvanceddialog_q.ui @@ -85,7 +85,7 @@ QTabWidget::Rounded - 0 + 4 true @@ -1380,7 +1380,7 @@ workstation with this address: - 20 + 6 6 @@ -1401,7 +1401,7 @@ workstation with this address: - + Qt::ScrollBarAlwaysOn @@ -1468,49 +1468,6 @@ workstation with this address: - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 170 - 20 - - - - - - - - Display generated commands - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - @@ -4406,7 +4363,6 @@ the packet should go to, and which is the next hop syslog_host syslog_queue_size syslog_facility - displayCommandsButton ipv4before_2 @@ -4571,21 +4527,5 @@ the packet should go to, and which is the next hop - - displayCommandsButton - clicked() - pixAdvancedDialog_q - displayCommands() - - - 20 - 20 - - - 20 - 20 - - -