mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-21 02:37:16 +01:00
see #2176 autodetect pf.conf format in importer
This commit is contained in:
parent
d82b81682e
commit
7d962bb1ce
@ -86,6 +86,11 @@ void IC_PlatformWarningPage::initializePage()
|
||||
<< QRegExp("^\\[\\d+:\\d+\\] -A OUTPUT ")
|
||||
<< QRegExp("^\\[\\d+:\\d+\\] -A FORWARD ");
|
||||
|
||||
QList<QRegExp> pf_conf_re;
|
||||
pf_conf_re << QRegExp("^scrub\\s+\\S+")
|
||||
<< QRegExp("^set\\s+timeout\\s+\\S+")
|
||||
<< QRegExp("");
|
||||
|
||||
m_dialog->configFileBrowser->clear();
|
||||
m_dialog->platform->setText(tr("Unknown"));
|
||||
|
||||
@ -143,6 +148,15 @@ void IC_PlatformWarningPage::initializePage()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (QRegExp re, pf_conf_re)
|
||||
{
|
||||
if (re.indexIn(line) > -1)
|
||||
{
|
||||
detectedPlatform = "pf";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (detectedPlatform == "iptables")
|
||||
@ -250,6 +264,14 @@ void IC_PlatformWarningPage::initializePage()
|
||||
platformOk = false;
|
||||
}
|
||||
|
||||
if (detectedPlatform == "pf")
|
||||
{
|
||||
m_dialog->platform->setText(tr("iptables"));
|
||||
m_dialog->platformSpecificWarning->setText(
|
||||
tr("Import of PF rules is not supported"));
|
||||
platformOk = false;
|
||||
}
|
||||
|
||||
dynamic_cast<ImportFirewallConfigurationWizard*>(wizard())->
|
||||
setPlatform(detectedPlatform);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user