Repository : http://git.fedorahosted.org/cgit/firewalld-recode.git
On branch : master
>---------------------------------------------------------------
commit 74de3683c1ab9ccb943810d6cd353e67ff5ffb64
Author: Daniel Kopecek <dkopecek(a)redhat.com>
Date: Tue Dec 9 20:57:19 2014 +0100
Fixed transaction allocation in Firewall::getWritableZone
>---------------------------------------------------------------
src/Daemon/Firewall/Firewall.cpp | 46 +++++++++++++++++++++----------------
1 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/src/Daemon/Firewall/Firewall.cpp b/src/Daemon/Firewall/Firewall.cpp
index 13864a9..5832560 100644
--- a/src/Daemon/Firewall/Firewall.cpp
+++ b/src/Daemon/Firewall/Firewall.cpp
@@ -166,26 +166,27 @@ namespace firewalld
{
Pointer<Zone> zone = PointerMapOp::findOne(_zone_map, name);
- if (zone != nullptr) {
- return zone;
- }
-
- Pointer<const Zone> zone_definition = FirewallD::instance()->lookupZone(name);
-
- if (zone_definition == nullptr) {
- throw FirewallError("INVALID_ZONE", "Zone \"" + name + "\" not defined");
- }
+ if (zone == nullptr) {
+ /*
+ * The requested zone either doesn't exist or this is the
+ * first modification request.
+ */
+ Pointer<const Zone> zone_definition = FirewallD::instance()->lookupZone(name);
- /*
- * Create a deep copy of the zone definition object and
- * add it to the internal firewall state. All runtime data
- * will be tracked in this instance.
- */
- zone = makePointer<Zone>(*zone_definition);
- _zone_map[name] = zone;
+ if (zone_definition == nullptr) {
+ throw FirewallError("INVALID_ZONE", "Zone \"" + name + "\" not defined");
+ }
- LOG(DEBUG) << "Zone \"" << name << "\" copied to the internal firewall state";
+ /*
+ * Create a deep copy of the zone definition object and
+ * add it to the internal firewall state. All runtime data
+ * will be tracked in this instance.
+ */
+ zone = makePointer<Zone>(*zone_definition);
+ _zone_map[name] = zone;
+ LOG(DEBUG) << "Zone \"" << name << "\" copied to the internal firewall state";
+ }
/*
* Since a writable zone was requested, we assume that
* modification will be made to this zone and they may
@@ -201,7 +202,12 @@ namespace firewalld
if (!zone->hasTransaction() && !without_transaction) {
Pointer<Transaction> transaction = createTransaction();
zone->setTransaction(transaction);
- LOG(DEBUG) << "Crated a new transaction for zone \"" << zone->name() << "\"";
+ LOG(DEBUG) << "Created a new transaction for zone \"" << zone->name() << "\"";
+ } else {
+ LOG(DEBUG) << "No transaction created for dirty zone \"" << zone->name() << "\"";
+ LOG(DEBUG) << "hasTransaction()=" << zone->hasTransaction()
+ << " "
+ << "without_transaction=" << without_transaction;
}
return zone;
Repository : http://git.fedorahosted.org/cgit/firewalld-recode.git
On branch : master
>---------------------------------------------------------------
commit e11ffef348aa3ce5e3394b5a456bb2c3328758ff
Author: Daniel Kopecek <dkopecek(a)redhat.com>
Date: Fri Dec 5 11:16:37 2014 +0100
Drop the string based transaction protocol
- send the firewall objects directly to the
backend and let it interpret them
- adapt the firewall objects (Daemon/Firewall/*)
to this new mechanism
- update the LinuxXTables backend
>---------------------------------------------------------------
Diff suppressed because of size. To see it, use:
git diff --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol ^e11ffef348aa3ce5e3394b5a456bb2c3328758ff~1 e11ffef348aa3ce5e3394b5a456bb2c3328758ff