mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kfirewall: do not generate duplicate rules for non-port rules
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
1e3d07c334
commit
cb997a19f7
1 changed files with 7 additions and 0 deletions
|
@ -27,6 +27,11 @@ static QByteArray ruleForSettings(const QByteArray &uservalue, const QByteArray
|
|||
const QByteArray &addressvalue, const uint portvalue,
|
||||
const QByteArray &actionvalue, const bool appendrules, const bool tcprule)
|
||||
{
|
||||
if (!tcprule && portvalue <= 0) {
|
||||
// no port specified
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QByteArray iptablesruledata;
|
||||
bool isinbound = false;
|
||||
QByteArray iptablestraffic = trafficvalue.toUpper();
|
||||
|
@ -152,6 +157,8 @@ ActionReply KFirewallHelper::apply(const QVariantMap ¶meters)
|
|||
|
||||
ActionReply KFirewallHelper::revert(const QVariantMap ¶meters)
|
||||
{
|
||||
//qDebug() << Q_FUNC_INFO << parameters;
|
||||
|
||||
if (parameters.isEmpty()) {
|
||||
KAuth::ActionReply errorreply(KAuth::ActionReply::HelperError);
|
||||
errorreply.setErrorDescription("Empty rules");
|
||||
|
|
Loading…
Add table
Reference in a new issue