mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-23 19:57:21 +01:00
* configlets/linux24/check_utilities: fixes #1348 "check_tools
should check IPTABLES and IPTABLES_RESTORE as well"
This commit is contained in:
parent
30f2908b74
commit
c9cf486720
@ -1,3 +1,8 @@
|
||||
2010-03-23 vadim <vadim@vk.crocodile.org>
|
||||
|
||||
* configlets/linux24/check_utilities: fixes #1348 "check_tools
|
||||
should check IPTABLES and IPTABLES_RESTORE as well"
|
||||
|
||||
2010-03-20 vadim <vadim@vk.crocodile.org>
|
||||
|
||||
* FWWindow.cpp (FWWindow::updateGlobalToolbar): additional check
|
||||
|
||||
@ -479,7 +479,7 @@ QString CompilerDriver_ipt::run(const std::string &cluster_id,
|
||||
script_skeleton.setVariable("tools",
|
||||
oscnf->printPathForAllTools(os_variant).c_str());
|
||||
script_skeleton.setVariable("shell_functions",
|
||||
oscnf->printShellFunctions().c_str());
|
||||
oscnf->printShellFunctions(have_ipv6).c_str());
|
||||
if (supports_prolog_epilog)
|
||||
{
|
||||
//script_skeleton.setVariable("prolog_epilog",
|
||||
|
||||
@ -292,9 +292,9 @@ int OSConfigurator_linux24::prolog()
|
||||
* Print shell functions used by the script. If argument (boolean) is true,
|
||||
* do not add comments.
|
||||
*/
|
||||
string OSConfigurator_linux24::printShellFunctions()
|
||||
string OSConfigurator_linux24::printShellFunctions(bool have_ipv6)
|
||||
{
|
||||
ostringstream str;
|
||||
QStringList output;
|
||||
FWOptions* options = fw->getOptionsObject();
|
||||
|
||||
// string host_os = fw->getStr("host_OS");
|
||||
@ -302,13 +302,14 @@ string OSConfigurator_linux24::printShellFunctions()
|
||||
// getResourceStr("/FWBuilderResources/Target/family");
|
||||
|
||||
Configlet shell_functions(fw, "linux24", "shell_functions");
|
||||
str << shell_functions.expand().toStdString();
|
||||
output.push_back(shell_functions.expand());
|
||||
|
||||
/* check if package iproute2 is installed, but do this only if
|
||||
* we really need /usr/sbin/ip
|
||||
*/
|
||||
Configlet configlet(fw, "linux24", "check_utilities");
|
||||
configlet.removeComments();
|
||||
configlet.collapseEmptyStrings(true);
|
||||
|
||||
if (options->getBool("verify_interfaces") ||
|
||||
options->getBool("manage_virtual_addr") ||
|
||||
@ -321,41 +322,44 @@ string OSConfigurator_linux24::printShellFunctions()
|
||||
configlet.setVariable("need_ifenslave",
|
||||
options->getBool("configure_bonding_interfaces"));
|
||||
}
|
||||
str << configlet.expand().toStdString();
|
||||
|
||||
configlet.setVariable("need_iptables_restore",
|
||||
options->getBool("use_iptables_restore"));
|
||||
|
||||
configlet.setVariable("need_ip6tables_restore",
|
||||
have_ipv6 && options->getBool("use_iptables_restore"));
|
||||
|
||||
output.push_back(configlet.expand());
|
||||
|
||||
/*
|
||||
* Generate commands to reset all tables and chains and set
|
||||
* default policy
|
||||
*/
|
||||
Configlet reset_iptables(fw, "linux24", "reset_iptables");
|
||||
str << reset_iptables.expand().toStdString();
|
||||
output.push_back(reset_iptables.expand());
|
||||
|
||||
Configlet addr_conf(fw, "linux24", "update_addresses");
|
||||
str << addr_conf.expand().toStdString();
|
||||
str << "\n";
|
||||
output.push_back(addr_conf.expand());
|
||||
|
||||
if (options->getBool("configure_vlan_interfaces"))
|
||||
{
|
||||
Configlet conf(fw, "linux24", "update_vlans");
|
||||
str << conf.expand().toStdString();
|
||||
str << "\n";
|
||||
output.push_back(conf.expand());
|
||||
}
|
||||
|
||||
if (options->getBool("configure_bridge_interfaces"))
|
||||
{
|
||||
Configlet conf(fw, "linux24", "update_bridge");
|
||||
str << conf.expand().toStdString();
|
||||
str << "\n";
|
||||
output.push_back(conf.expand());
|
||||
}
|
||||
|
||||
if (options->getBool("configure_bonding_interfaces"))
|
||||
{
|
||||
Configlet conf(fw, "linux24", "update_bonding");
|
||||
str << conf.expand().toStdString();
|
||||
str << "\n";
|
||||
output.push_back(conf.expand());
|
||||
}
|
||||
|
||||
return str.str();
|
||||
return output.join("\n").toStdString();
|
||||
}
|
||||
|
||||
string OSConfigurator_linux24::getPathForATool(const std::string &os_variant, OSData::tools tool_name)
|
||||
@ -391,7 +395,6 @@ string OSConfigurator_linux24::printPathForAllTools(const string &os)
|
||||
|
||||
string OSConfigurator_linux24::generateCodeForProtocolHandlers()
|
||||
{
|
||||
ostringstream ostr;
|
||||
FWOptions* options = fw->getOptionsObject();
|
||||
bool nomod = Resources::os_res[fw->getStr("host_OS")]->
|
||||
Resources::getResourceBool("/FWBuilderResources/Target/options/suppress_modules");
|
||||
@ -409,9 +412,7 @@ string OSConfigurator_linux24::generateCodeForProtocolHandlers()
|
||||
/* there is no need to load modules on some platforms */
|
||||
load_modules.setVariable("load_modules", options->getBool("load_modules") && !nomod);
|
||||
load_modules.setVariable("modules_dir", modules_dir.c_str());
|
||||
ostr << load_modules.expand().toStdString();
|
||||
|
||||
return ostr.str();
|
||||
return load_modules.expand().toStdString();
|
||||
}
|
||||
|
||||
QString OSConfigurator_linux24::addressTableWrapper(FWObject *rule,
|
||||
|
||||
@ -94,7 +94,7 @@ public:
|
||||
|
||||
virtual void registerMultiAddressObject(libfwbuilder::MultiAddressRunTime *at);
|
||||
virtual void printChecksForRunTimeMultiAddress();
|
||||
virtual std::string printShellFunctions();
|
||||
virtual std::string printShellFunctions(bool have_ipv6);
|
||||
virtual std::string printPathForAllTools(const std::string &os);
|
||||
virtual std::string printIPForwardingCommands();
|
||||
virtual std::string printRunTimeWrappers(libfwbuilder::FWObject *rule,
|
||||
|
||||
@ -22,6 +22,9 @@ find_program() {
|
||||
}
|
||||
|
||||
check_tools() {
|
||||
find_program $IPTABLES
|
||||
{{if need_iptables_restore}} find_program $IPTABLES_RESTORE{{endif}}
|
||||
{{if need_ip6tables_restore}} find_program $IP6TABLES_RESTORE{{endif}}
|
||||
find_program $MODPROBE
|
||||
find_program $IP
|
||||
{{if need_vconfig}} find_program $VCONFIG {{endif}}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user