return empty ruleset if firewall disabled in cluster.fw
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 4 Jun 2014 05:24:34 +0000 (07:24 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 4 Jun 2014 05:24:34 +0000 (07:24 +0200)
src/PVE/Firewall.pm
test/test-basic1/cluster.fw
test/test-default-rules1/cluster.fw
test/test-errors1/cluster.fw [new file with mode: 0644]
test/test-errors2/cluster.fw [new file with mode: 0644]
test/test-errors3/cluster.fw [new file with mode: 0644]
test/test-errors4/cluster.fw [new file with mode: 0644]
test/test-ipset1/cluster.fw
test/test-ipset2/cluster.fw [new file with mode: 0644]
test/test-unconfigured/cluster.fw
test/test-vm-aliases1/cluster.fw [new file with mode: 0644]

index 70d916c..f4f4377 100644 (file)
@@ -2781,6 +2781,8 @@ sub compile {
 
     push @{$cluster_conf->{ipset}->{management}}, { cidr => $localnet };
 
+    return ({}, {}) if !$cluster_conf->{options}->{enable};
+
     my $ruleset = {};
 
     ruleset_create_chain($ruleset, "PVEFW-INPUT");
index e69de29..6dc132a 100644 (file)
@@ -0,0 +1,3 @@
+[options]
+
+enable: 1
\ No newline at end of file
index bc72078..5ce18dd 100644 (file)
@@ -1,3 +1,4 @@
 [OPTIONS]
 
+enable: 1
 policy_out: DROP
\ No newline at end of file
diff --git a/test/test-errors1/cluster.fw b/test/test-errors1/cluster.fw
new file mode 100644 (file)
index 0000000..6dc132a
--- /dev/null
@@ -0,0 +1,3 @@
+[options]
+
+enable: 1
\ No newline at end of file
diff --git a/test/test-errors2/cluster.fw b/test/test-errors2/cluster.fw
new file mode 100644 (file)
index 0000000..6dc132a
--- /dev/null
@@ -0,0 +1,3 @@
+[options]
+
+enable: 1
\ No newline at end of file
diff --git a/test/test-errors3/cluster.fw b/test/test-errors3/cluster.fw
new file mode 100644 (file)
index 0000000..6dc132a
--- /dev/null
@@ -0,0 +1,3 @@
+[options]
+
+enable: 1
\ No newline at end of file
diff --git a/test/test-errors4/cluster.fw b/test/test-errors4/cluster.fw
new file mode 100644 (file)
index 0000000..6dc132a
--- /dev/null
@@ -0,0 +1,3 @@
+[options]
+
+enable: 1
\ No newline at end of file
index d6b9525..56ab13b 100644 (file)
@@ -1,3 +1,7 @@
+[OPTIONS]
+
+enable: 1
+
 [ALIASES]
 
 myserveralias 10.2.0.111
diff --git a/test/test-ipset2/cluster.fw b/test/test-ipset2/cluster.fw
new file mode 100644 (file)
index 0000000..6dc132a
--- /dev/null
@@ -0,0 +1,3 @@
+[options]
+
+enable: 1
\ No newline at end of file
diff --git a/test/test-vm-aliases1/cluster.fw b/test/test-vm-aliases1/cluster.fw
new file mode 100644 (file)
index 0000000..6dc132a
--- /dev/null
@@ -0,0 +1,3 @@
+[options]
+
+enable: 1
\ No newline at end of file