use PVE::ProcFSTools::write_proc_entry instead of system("echo ...")
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 4 Mar 2014 08:27:26 +0000 (09:27 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 4 Mar 2014 08:27:26 +0000 (09:27 +0100)
src/PVE/Firewall.pm

index 5e73d2b..3a4f2f4 100644 (file)
@@ -4,6 +4,7 @@ use warnings;
 use strict;
 use Data::Dumper;
 use Digest::SHA;
+use PVE::ProcFSTools;
 use PVE::Tools;
 use PVE::QemuServer;
 use File::Basename;
@@ -623,8 +624,8 @@ sub enable_bridge_firewall {
 
     return if $bridge_firewall_enabled; # only once
 
-    system("echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables");
-    system("echo 1 > /proc/sys/net/bridge/bridge-nf-call-ip6tables");
+    PVE::ProcFSTools::write_proc_entry("/proc/sys/net/bridge/bridge-nf-call-iptables", "1");
+    PVE::ProcFSTools::write_proc_entry("/proc/sys/net/bridge/bridge-nf-call-ip6tables", "1");
 
     $bridge_firewall_enabled = 1;
 }