aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-11-12 15:18:57 +0100
committerdoktornotor <notordoktor@gmail.com>2015-11-12 15:18:57 +0100
commita2f7948e8f4baacb7a631ade67c1a9a83b38ed5b (patch)
tree4e91e9fccf9e59313cbeeadca8528200f400bbd0 /config
parent6a9837c9abd3011d22eccb31175e56fc02b9f286 (diff)
downloadpfsense-packages-a2f7948e8f4baacb7a631ade67c1a9a83b38ed5b.tar.gz
pfsense-packages-a2f7948e8f4baacb7a631ade67c1a9a83b38ed5b.tar.bz2
pfsense-packages-a2f7948e8f4baacb7a631ade67c1a9a83b38ed5b.zip
Add privileges configuration to netio package; sanitize input
Diffstat (limited to 'config')
-rw-r--r--config/netio/netio.xml28
1 files changed, 19 insertions, 9 deletions
diff --git a/config/netio/netio.xml b/config/netio/netio.xml
index 34f188c2..0c66f5e2 100644
--- a/config/netio/netio.xml
+++ b/config/netio/netio.xml
@@ -42,16 +42,21 @@
]]>
</copyright>
<name>netio</name>
- <version>1.27</version>
- <title>netio: Client</title>
+ <version>1.28</version>
+ <title>Diagnostics: netio: Client</title>
+ <savetext>Run netio client</savetext>
<preoutput>yes</preoutput>
<donotsave>true</donotsave>
<menu>
<name>netio</name>
- <tooltiptext>Run netio in client or server mode.</tooltiptext>
<section>Diagnostics</section>
- <configfile>netio.xml</configfile>
+ <url>/pkg_edit.php?xml=netio.xml</url>
</menu>
+ <service>
+ <name>netio</name>
+ <executable>netio</executable>
+ <description>netio Network Throughput Benchmark Server/Client</description>
+ </service>
<tabs>
<tab>
<text>Client</text>
@@ -64,6 +69,11 @@
</tab>
</tabs>
<additional_files_needed>
+ <prefix>/etc/inc/priv/</prefix>
+ <item>https://packages.pfsense.org/packages/config/netio/netio.priv.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
<item>https://packages.pfsense.org/packages/config/netio/netioserver.xml</item>
</additional_files_needed>
<fields>
@@ -83,11 +93,11 @@
<custom_add_php_command>
<![CDATA[
mwexec("/usr/bin/killall netio");
- $netio_options = "";
- if ($_POST['port'] != "") {
- $netio_options .= " -p {$_POST['port']}";
- $netio_options .= $_POST['hostname'];
- system("/usr/local/bin/netio " . $netio_options);
+ if ($_POST['port'] != "" && $_POST['hostname'] != "") {
+ $port = escapeshellarg($_POST['port']);
+ $hostname = escapeshellarg($_POST['hostname']);
+ $netio_options = "-p {$port} {$hostname}";
+ system("/usr/local/bin/netio {$netio_options}");
}
]]>
</custom_add_php_command>