1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-20 02:07:23 +01:00

* PolicyCompiler_PrintRule.cpp (PrintRule::_printTarget): fixed

bug #2141911: "no ULOG for ip6tables". ULOG target has not been
implemented for ip6tables yet, so the compiler should fall back to
LOG target while compiling ipv6 policy.
This commit is contained in:
Vadim Kurland 2008-10-02 11:31:03 +00:00
parent 72e78a89bb
commit 42de6ff13e
5 changed files with 39 additions and 28 deletions

View File

@ -1 +1 @@
#define BUILD_NUM 558
#define BUILD_NUM 560

View File

@ -1,5 +1,10 @@
2008-10-02 Vadim Kurland <vadim@vk.crocodile.org>
* PolicyCompiler_PrintRule.cpp (PrintRule::_printTarget): fixed
bug #2141911: "no ULOG for ip6tables". ULOG target has not been
implemented for ip6tables yet, so the compiler should fall back to
LOG target while compiling ipv6 policy.
* RuleSetView.cpp (RuleSetView::updateGeometries): fixed crash
that happened on Ubuntu with QT 4.3.x because of recursive call to
updateGeometries()

View File

@ -11,15 +11,15 @@ SO_VERSION = @LIBFWBUILDER_SOLIB_VERSION@
DEFINES += $$(DEFINES)
LANGUAGE = C++
UI_DIR = ui
MANDIR = /Users/vadim/src/fwb3-branch-v3/install_root/share/man/
DOCDIR = /Users/vadim/src/fwb3-branch-v3/install_root/share/doc/fwbuilder-3.0.1
MANDIR = /home/vadim/src/fwb3-branch-v3/install_root/share/man/
DOCDIR = /home/vadim/src/fwb3-branch-v3/install_root/share/doc/fwbuilder-3.0.1
HAVE_ANTLR_RUNTIME = 1
HAVE_EXTERNAL_ANTLR = 0
unix {
ANTLR_INCLUDEPATH = /Users/vadim/src/fwb3-branch-v3/source/fwbuilder/src/
ANTLR_LIBS = /Users/vadim/src/fwb3-branch-v3/source/fwbuilder/src/antlr/libantlr.a
ANTLR_INCLUDEPATH = /home/vadim/src/fwb3-branch-v3/source/fwbuilder/src/
ANTLR_LIBS = /home/vadim/src/fwb3-branch-v3/source/fwbuilder/src/antlr/libantlr.a
FWBPARSER_LIB = ../parsers/libfwbparser.a
}
@ -30,38 +30,38 @@ unix {
MOC_DIR = .moc
OBJECTS_DIR = .obj
PREFIX = /Users/vadim/src/fwb3-branch-v3/install_root
PREFIX = /home/vadim/src/fwb3-branch-v3/install_root
exec_prefix = @EXEC_PREFIX@
DESTDIR =
ICONSDIR =
ICONSDIR = /home/vadim/src/fwb3-branch-v3/install_root/share//icons/hicolor/
INCLUDEPATH += .. ../.. $$(INCLUDEPATH) /Users/vadim/src/fwb3-branch-v3/install_root/include/ /Users/vadim/src/fwb3-branch-v3/install_root/include/fwb-3 /usr/include/libxml2
INCLUDEPATH += .. ../.. $$(INCLUDEPATH) /home/vadim/src/fwb3-branch-v3/install_root/include/ /home/vadim/src/fwb3-branch-v3/install_root/include/fwb-3 /usr/include/libxml2
LIBS_FWCOMPILER = -L/Users/vadim/src/fwb3-branch-v3/install_root/lib -lfwcompiler -lfwbuilder -lxslt -lxml2 -lz -lpthread -licucore -lm -lnetsnmp
LIBS_FWBUILDER = -L/Users/vadim/src/fwb3-branch-v3/install_root/lib -lfwbuilder -lxslt -lxml2 -lz -lpthread -licucore -lm -lnetsnmp
LIBS_FWCOMPILER = -L/home/vadim/src/fwb3-branch-v3/install_root/lib -pthread -lfwcompiler -lfwbuilder -lxslt -lxml2 -lnetsnmp -lm -lwrap
LIBS_FWBUILDER = -L/home/vadim/src/fwb3-branch-v3/install_root/lib -pthread -lfwbuilder -lxslt -lxml2 -lnetsnmp -lm -lwrap
target.path = $$PREFIX/bin
dtd.path = @TEMPLATE_DIR@/
migration.path = @TEMPLATE_DIR@/migration
doc.path = /Users/vadim/src/fwb3-branch-v3/install_root/share/doc/fwbuilder-3.0.1
datadir.path = /Users/vadim/src/fwb3-branch-v3/install_root/share/
doc.path = /home/vadim/src/fwb3-branch-v3/install_root/share/doc/fwbuilder-3.0.1
datadir.path = /home/vadim/src/fwb3-branch-v3/install_root/share/
# win32:target.path = $$PREFIX/
# unix:target.path = $$PREFIX/share/fwbuilder/
# macx:target.path = $$PREFIX/
res.path = ../Resources
res_os.path = ../Resources/os/
res_platform.path = ../Resources/platform/
res_help.path = ../Resources/help/
res_desktop.path = /Users/vadim/src/fwb3-branch-v3/install_root/share//applications/
res.path = /home/vadim/src/fwb3-branch-v3/install_root/share/fwbuilder-3.0.1
res_os.path = /home/vadim/src/fwb3-branch-v3/install_root/share/fwbuilder-3.0.1/os/
res_platform.path = /home/vadim/src/fwb3-branch-v3/install_root/share/fwbuilder-3.0.1/platform/
res_help.path = /home/vadim/src/fwb3-branch-v3/install_root/share/fwbuilder-3.0.1/help/
res_desktop.path = /home/vadim/src/fwb3-branch-v3/install_root/share//applications/
INSTALLS += res
INSTALLS += res_os
INSTALLS += res_platform
# INSTALLS += icns
LIBS += $$LIBS_FWBUILDER -L/sw/lib -lpoll
LIBS += $$LIBS_FWBUILDER -lutil
PKGLOCALEDIR = $$res.path/locale

View File

@ -313,6 +313,7 @@ string PolicyCompiler_ipt::PrintRule::_printModules(PolicyRule *rule)
string PolicyCompiler_ipt::PrintRule::_printTarget(PolicyRule *rule)
{
PolicyCompiler_ipt *ipt_comp = dynamic_cast<PolicyCompiler_ipt*>(compiler);
std::ostringstream ostr;
string target=rule->getStr("ipt_target");
@ -326,7 +327,8 @@ string PolicyCompiler_ipt::PrintRule::_printTarget(PolicyRule *rule)
return ostr.str();
}
if ( compiler->getCachedFwOpt()->getBool("use_ULOG") &&
// there is no ULOG for ip6tables yet
if (!ipt_comp->ipv6 && compiler->getCachedFwOpt()->getBool("use_ULOG") &&
target=="LOG") target="ULOG";
ostr << " -j " << target << " ";
@ -566,14 +568,17 @@ string PolicyCompiler_ipt::PrintRule::_printLogPrefix(PolicyRule *rule,
prefix);
}
string PolicyCompiler_ipt::PrintRule::_printLogParameters(libfwbuilder::PolicyRule *rule)
string PolicyCompiler_ipt::PrintRule::_printLogParameters(PolicyRule *rule)
{
PolicyCompiler_ipt *ipt_comp = dynamic_cast<PolicyCompiler_ipt*>(compiler);
std::ostringstream str;
string s;
// int l;
FWOptions *ruleopt =(rule!=NULL)?rule->getOptionsObject():compiler->getCachedFwOpt();
FWOptions *ruleopt = (rule!=NULL) ?
rule->getOptionsObject() : compiler->getCachedFwOpt();
bool use_ulog=compiler->getCachedFwOpt()->getBool("use_ULOG");
// there is no ULOG for ip6tables yet
bool use_ulog = (!ipt_comp->ipv6 &&
compiler->getCachedFwOpt()->getBool("use_ULOG"));
if (use_ulog)
{
@ -1653,7 +1658,8 @@ string PolicyCompiler_ipt::PrintRule::_printOptionalGlobalRules()
res << _startRuleLine();
if (compiler->getCachedFwOpt()->getBool("use_ULOG"))
// Note: there is no ULOG for ip6tables yet
if (!isIPv6 && compiler->getCachedFwOpt()->getBool("use_ULOG"))
{
string s = compiler->getCachedFwOpt()->getStr("ulog_nlgroup");

View File

@ -25594,7 +25594,7 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
<Option name="verify_interfaces">False</Option>
</FirewallOptions>
</Firewall>
<Firewall id="id4833F62B6131" host_OS="linux24" inactive="False" lastCompiled="1219115207" lastInstalled="0" lastModified="1219116070" platform="iptables" version="" name="firewall-ipv6-1" comment="" ro="False">
<Firewall id="id4833F62B6131" host_OS="linux24" inactive="False" lastCompiled="1219115207" lastInstalled="0" lastModified="1222946501" platform="iptables" version="" name="firewall-ipv6-1" comment="Using ULOG globally, but ipv6 rules&#10;should fall back to LOG because&#10;there is no ULOG for ip6tables yet&#10;Bug 2141911&#10;" ro="False">
<NAT id="id4833F62F6131" name="NAT" comment="" ro="False" ipv6_rule_set="False" top_rule_set="True"/>
<Policy id="id483F5B7623190" name="Policy_ipv6" comment="" ro="False" ipv6_rule_set="True" top_rule_set="True">
<PolicyRule id="id30141X31704" action="Accept" direction="Outbound" disabled="False" log="False" position="0" comment="for bug 2047082&#10;&#10;">
@ -26187,7 +26187,7 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
<Option name="compiler"></Option>
<Option name="configure_interfaces">True</Option>
<Option name="debug">False</Option>
<Option name="drop_invalid">False</Option>
<Option name="drop_invalid">True</Option>
<Option name="eliminate_duplicates">true</Option>
<Option name="enable_ipv6">True</Option>
<Option name="epilog_script"></Option>
@ -26231,7 +26231,7 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
<Option name="load_modules">True</Option>
<Option name="local_nat">False</Option>
<Option name="log_all">False</Option>
<Option name="log_invalid">False</Option>
<Option name="log_invalid">True</Option>
<Option name="log_ip_opt">False</Option>
<Option name="log_level">info</Option>
<Option name="log_prefix">RULE %N -- %A </Option>
@ -26272,7 +26272,7 @@ echo '%FWBPROMPT%'; sh /tmp/%FWSCRIPT%
<Option name="ulog_cprange">0</Option>
<Option name="ulog_nlgroup">1</Option>
<Option name="ulog_qthreshold">1</Option>
<Option name="use_ULOG">False</Option>
<Option name="use_ULOG">True</Option>
<Option name="use_iptables_restore">False</Option>
<Option name="use_numeric_log_levels">False</Option>
<Option name="verify_interfaces">True</Option>