summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/pam/hooks/session-close.d/runvirt-firewall-clear
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/pam/hooks/session-close.d/runvirt-firewall-clear')
-rw-r--r--core/modules/run-virt/data/opt/openslx/pam/hooks/session-close.d/runvirt-firewall-clear17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/pam/hooks/session-close.d/runvirt-firewall-clear b/core/modules/run-virt/data/opt/openslx/pam/hooks/session-close.d/runvirt-firewall-clear
new file mode 100644
index 00000000..4fdd88ab
--- /dev/null
+++ b/core/modules/run-virt/data/opt/openslx/pam/hooks/session-close.d/runvirt-firewall-clear
@@ -0,0 +1,17 @@
+#!/bin/ash
+
+# Sourced as session-close hook
+
+runvirt_fw_clear () {
+ iptables -w -F runvirt-INPUT
+ ip6tables -w -F runvirt-INPUT
+ iptables -w -F runvirt-OUTPUT
+ ip6tables -w -F runvirt-OUTPUT
+}
+
+if [ "x$PAM_TTY" = "x:0" ]; then
+ runvirt_fw_clear > /dev/null 2>&1
+fi
+
+true
+