diff options
-rw-r--r-- | config/arping/arping.inc | 37 | ||||
-rw-r--r-- | config/arping/arping.xml | 112 | ||||
-rw-r--r-- | config/blinkled/blinkled.inc | 61 | ||||
-rw-r--r-- | config/blinkled/blinkled.xml | 47 | ||||
-rw-r--r-- | config/filer/filer.inc | 240 | ||||
-rw-r--r-- | config/filer/filer.xml | 111 | ||||
-rw-r--r-- | config/filer/filer_sync.xml | 89 | ||||
-rw-r--r-- | config/ftpproxy/ftpproxy.inc | 32 | ||||
-rw-r--r-- | config/ftpproxy/ftpproxy.xml | 46 | ||||
-rw-r--r-- | config/ntopng/ntopng.xml | 30 | ||||
-rw-r--r-- | config/rrd-summary/rrd-summary.xml | 84 | ||||
-rw-r--r-- | config/rrd-summary/status_rrd_summary.php | 24 | ||||
-rw-r--r-- | config/sudo/sudo.inc | 30 | ||||
-rw-r--r-- | config/sudo/sudo.xml | 42 | ||||
-rw-r--r-- | config/syslog-ng/syslog-ng.inc | 4 | ||||
-rw-r--r-- | config/tinydns/tinydns.inc | 47 | ||||
-rw-r--r-- | config/tinydns/tinydns.xml | 124 | ||||
-rw-r--r-- | pkg_config.10.xml | 18 |
18 files changed, 701 insertions, 477 deletions
diff --git a/config/arping/arping.inc b/config/arping/arping.inc index 0054adf0..996fddf3 100644 --- a/config/arping/arping.inc +++ b/config/arping/arping.inc @@ -1,9 +1,9 @@ <?php -/* $Id$ */ /* arping.inc + part of pfSense (https://www.pfSense.org/) Copyright (C) 2006 Scott Ullrich - part of pfSense + Copyright (C) 2009-2015 ESF, LLC All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,22 +28,25 @@ POSSIBILITY OF SUCH DAMAGE. */ -function arping_deinstall() { -} - -function arping_package_reinstall() { -} - function arping_package_php_command() { require_once("util.inc"); - if (is_ipaddr($_POST['hostip']) || is_hostname($_POST['hostip']) || is_macaddr($_POST['hostip'])) - system("arping -c3 " . escapeshellarg($_POST['hostip'])); - else - echo "Invalid input. Supplied address must be a valid IP or MAC address."; + + $button = "<br /><br /><input class=\"formbtn\" type=\"button\" value=\"Back to ARPing\" onclick=\"history.back()\" />"; + $int_count = (is_numeric($_POST['count']) ? (abs(intval($_POST['count']))) : 3); + $arping_options = " -v -c {$int_count}"; + if (!empty($_POST['interface'])) { + $iface = convert_friendly_interface_to_real_interface_name($_POST['interface']); + $arping_options .= " -i {$iface}"; + } + if (is_ipaddr($_POST['pinghost']) || is_hostname($_POST['pinghost']) || is_macaddr($_POST['pinghost'])) { + $arping_options .= " " . $_POST['pinghost']; + echo "<strong>arping {$arping_options} output:</strong><br /><br />"; + system("/usr/local/sbin/arping {$arping_options}"); + echo "{$button}"; + } else { + echo "<div class=\"errmsg\">ERROR: Invalid input. Supplied address must be a valid hostname, IP or MAC address.</div>"; + echo "{$button}"; + } exit; } - -function arping_package_resync() { -} - -?>
\ No newline at end of file +?> diff --git a/config/arping/arping.xml b/config/arping/arping.xml index c8ab9931..59da6db1 100644 --- a/config/arping/arping.xml +++ b/config/arping/arping.xml @@ -2,83 +2,85 @@ <!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ + <copyright> + <![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - authng.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2007 to whom it may belong - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>. - All rights reserved. - */ -/* ========================================================================== */ + arping.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009-2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ -/* ========================================================================== */ - ]]> - </copyright> - <description>Describe your package here</description> - <requirements>Describe your package requirements here</requirements> - <faq>Currently there are no FAQ items provided.</faq> + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>arping</name> - <version>2.6.0.2</version> + <version>1.2</version> <title>Diagnostics: ARPing</title> - <savetext>ARPing</savetext> + <savetext>Run ARPing</savetext> <preoutput>yes</preoutput> <donotsave>true</donotsave> <include_file>/usr/local/pkg/arping.inc</include_file> <menu> - <name>Arping</name> - <tooltiptext>Host to arp ping</tooltiptext> + <name>ARPing</name> + <tooltiptext>The arping utility sends ARP and/or ICMP requests to the specified host and displays the replies.</tooltiptext> <section>Diagnostics</section> - <url><![CDATA[/pkg_edit.php?xml=arping.xml&id=0]]></url> + <url>/pkg_edit.php?xml=arping.xml&id=0</url> </menu> - <tabs> - <tab> - <text>arping Settings</text> - <url><![CDATA[/pkg_edit.php?xml=arping.xml&id=0]]></url> - <active/> - </tab> - </tabs> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/arping/arping.inc</item> </additional_files_needed> <fields> <field> - <fielddescr>Host IP or MAC</fielddescr> - <fieldname>hostip</fieldname> - <description>Enter the host IP or MAC address to ARP ping</description> + <fielddescr>IP, Hostname or MAC</fielddescr> + <fieldname>pinghost</fieldname> + <description>Enter the hostname, IP or MAC address to ARPing.</description> + <type>input</type> + <required>true</required> + </field> + <field> + <fielddescr>Count</fielddescr> + <fieldname>count</fieldname> + <description>This is the number of ARP pings to send.</description> <type>input</type> + <typehint>(Defaults to 3.)</typehint> + </field> + <field> + <fielddescr>Interface</fielddescr> + <fieldname>interface</fieldname> + <description>Use the specified interface.</description> + <type>interfaces_selection</type> + <hideinterfaceregex>loopback</hideinterfaceregex> </field> - </fields> + </fields> <custom_add_php_command> - arping_package_php_command(); + arping_package_php_command(); </custom_add_php_command> </packagegui> diff --git a/config/blinkled/blinkled.inc b/config/blinkled/blinkled.inc index ffbc79b2..ef2b6db8 100644 --- a/config/blinkled/blinkled.inc +++ b/config/blinkled/blinkled.inc @@ -1,20 +1,45 @@ <?php +/* + blinkled.inc + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 Jim Pingle + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + require_once("config.inc"); require_once("functions.inc"); -function blinkled_running () { - return ((int)exec('pgrep blinkled | wc -l') > 0); -} - function sync_package_blinkled() { global $config; $blinkled_config = $config['installedpackages']['blinkled']['config'][0]; - /* kill all instances of blinkled */ - if(blinkled_running()) { - blinkled_stop(); + /* Kill all instances of blinkled */ + if (is_process_running("blinkled")) { + mwexec("/usr/bin/killall -9 blinkled"); } - /* if blinkled not running start it */ - if(!blinkled_running()) { + /* If blinkled is not running, start it */ + if (!is_process_running("blinkled")) { blinkled_start(); } } @@ -26,25 +51,25 @@ function blinkled_launch($int, $led) { function blinkled_start() { global $config; $blinkled_config = $config['installedpackages']['blinkled']['config'][0]; - if (!($blinkled_config['enable'])) + if (!($blinkled_config['enable'])) { return; + } - if (($blinkled_config['enable_led2']) && ($blinkled_config['iface_led2'])) + if (($blinkled_config['enable_led2']) && ($blinkled_config['iface_led2'])) { blinkled_launch(convert_friendly_interface_to_real_interface_name($blinkled_config['iface_led2']), 2); - if (($blinkled_config['enable_led3']) && ($blinkled_config['iface_led3'])) + } + if (($blinkled_config['enable_led3']) && ($blinkled_config['iface_led3'])) { blinkled_launch(convert_friendly_interface_to_real_interface_name($blinkled_config['iface_led3']), 3); -} - -function blinkled_stop() { - mwexec("/usr/bin/killall -9 blinkled"); + } } function validate_form_blinkled($post, &$input_errors) { /* Make sure both aren't using the same interface */ - if (($post['iface_led2']) && ($post['iface_led3']) && + if (($post['iface_led2']) && ($post['iface_led3']) && (($post['enable_led2']) && ($post['enable_led3'])) && - ($post['iface_led2'] == $post['iface_led3'])) + ($post['iface_led2'] == $post['iface_led3'])) { $input_errors[] = 'You cannot set two LEDs for a single interface. Please choose seperate interfaces.'; + } } ?> diff --git a/config/blinkled/blinkled.xml b/config/blinkled/blinkled.xml index aa0c53e8..65a574af 100644 --- a/config/blinkled/blinkled.xml +++ b/config/blinkled/blinkled.xml @@ -1,8 +1,49 @@ <?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> +<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> + <copyright> + <![CDATA[ +/* $Id$ */ +/* ====================================================================================== */ +/* + blinkled.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009-2012 Jim Pingle + Copyright (C) 2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <title>Interfaces: Assign LEDs</title> <name>blinkled</name> - <version>20090710</version> + <version>0.4.4</version> <savetext>Save</savetext> <include_file>/usr/local/pkg/blinkled.inc</include_file> <menu> @@ -14,13 +55,13 @@ <additional_files_needed> <item>https://packages.pfsense.org/packages/config/blinkled/blinkled.inc</item> <prefix>/usr/local/pkg/</prefix> - <chmod>0755</chmod> </additional_files_needed> + <!-- TODO: Make the blinkled.sh script really usable for start/stop/restart --> <service> <name>blinkled</name> <rcfile>blinkled.sh</rcfile> <executable>blinkled</executable> - <description>Blinks LEDs to indicate network activity</description> + <description>Network Activity LED Indicator Daemon</description> </service> <fields> <field> diff --git a/config/filer/filer.inc b/config/filer/filer.inc index b89553e4..3a012dd2 100644 --- a/config/filer/filer.inc +++ b/config/filer/filer.inc @@ -1,194 +1,191 @@ <?php -/* ========================================================================== */ -/* - filerinc - part of pfSense (http://www.pfSense.com) - Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com> - Copyright (C) 2012 Marcello Coutinho - Copyright (C) 2012 Brian Scholer - All rights reserved. - */ -/* ========================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ + filer.inc + part of pfSense (https://www.pfsense.org/) + Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com> + Copyright (C) 2012 Marcello Coutinho + Copyright (C) 2012 Brian Scholer + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ /* ========================================================================== */ - - -function filer_install() { - // reserved +function filer_text_area_decode($text) { + return preg_replace('/\r\n/', "\n", base64_decode($text)); } -function filer_deinstall() { - // reserved -} - -function filer_start() { - global $g, $config; - - // reserved -} - -function filer_text_area_decode($text){ - return preg_replace('/\r\n/', "\n",base64_decode($text)); -} function sync_package_filer() { global $config, $g; - $update_conf=0; - #mount filesystem writeable + $update_conf = 0; + conf_mount_rw(); - - #loop on configured files - if($config['installedpackages']['filer']['config']!="") { - $count=0; - foreach($config['installedpackages']['filer']['config'] as $file) { - if ($file['filedata']=="" && file_exists($file['fullfile'])){ - $config['installedpackages']['filer']['config'][$count]['filedata']=base64_encode(file_get_contents($file['fullfile'])); - $file['filedata']=base64_encode(file_get_contents($file['fullfile'])); + + /* Loop on configured files. */ + if ($config['installedpackages']['filer']['config'] != "") { + $count = 0; + foreach ($config['installedpackages']['filer']['config'] as $file) { + if ($file['filedata']=="" && file_exists($file['fullfile'])) { + $config['installedpackages']['filer']['config'][$count]['filedata'] = base64_encode(file_get_contents($file['fullfile'])); + $file['filedata'] = base64_encode(file_get_contents($file['fullfile'])); $update_conf++; - } + } $count++; - if(preg_match("/0?[0-7]{3}/", $file['mod'])) + if (preg_match("/0?[0-7]{3}/", $file['mod'])) { $mod = octdec($file['mod']); - else - $mod = 0700; - - #write file - file_put_contents($file['fullfile'], filer_text_area_decode($file['filedata']),LOCK_EX); + } else { + $mod = 0644; + } + + /* Write file. */ + file_put_contents($file['fullfile'], filer_text_area_decode($file['filedata']), LOCK_EX); chmod($file['fullfile'], $mod); - - #check if there is a script to run after file save - if($file['cmd']!= "") - switch ($file['background']){ + + /* Check if there is a script to run after file save. */ + if ($file['cmd'] != "") { + switch ($file['background']) { case "background": mwexec_bg($file['cmd']); break; case "foreground": mwexec($file['cmd']); - break; + break; } - + } } - #Write config if any file from filesystem was loaded - if ($update_conf > 0) - write_config(); + /* Write config if any file from filesystem was loaded. */ + if ($update_conf > 0) { + write_config(); + } } - #mount filesystem readonly + conf_mount_ro(); - + filer_sync_on_changes(); } function filer_validate_input($post, &$input_errors) { foreach ($post as $key => $value) { - if (empty($value)) + if (empty($value)) { continue; - if (substr($key, 0, 3) == "mod" && !preg_match("/^0?[0-7]{3}$/", $value)) - $input_errors[] = "{$value} is valid permission number"; - if (substr($key, 0, 11) == "description" && !preg_match("@^[a-zA-Z0-9 _/.-]+$@", $value)) - $input_errors[] = "Do not use special characters on description"; - if (substr($key, 0, 8) == "fullfile" && !preg_match("@^[a-zA-Z0-9_/.-]+$@", $value)) - $input_errors[] = "Do not use special characters on filename"; - + } + if (substr($key, 0, 3) == "mod" && !preg_match("/^0?[0-7]{3}$/", $value)) { + $input_errors[] = "{$value} is not valid permissions mode number."; + } + if (substr($key, 0, 11) == "description" && !preg_match("@^[a-zA-Z0-9 _/.-]+$@", $value)) { + $input_errors[] = "Do not use special characters in description."; + } + if (substr($key, 0, 8) == "fullfile" && !preg_match("@^[a-zA-Z0-9_/.-]+$@", $value)) { + $input_errors[] = "Do not use special characters in filename."; + } } } -/* Uses XMLRPC to synchronize the changes to a remote node */ +/* Uses XMLRPC to synchronize the changes to a remote node. */ function filer_sync_on_changes() { global $config, $g; - + log_error("[filer] filer_xmlrpc_sync.php is starting."); - $synconchanges = $config['installedpackages']['filersync']['config'][0]['synconchanges']; - if(!$synconchanges) + $synconchanges = $config['installedpackages']['filersync']['config'][0]['synconchanges']; + if (!$synconchanges) { return; - foreach ($config['installedpackages']['filersync']['config'] as $rs ){ - foreach($rs['row'] as $sh){ + } + foreach ($config['installedpackages']['filersync']['config'] as $rs) { + foreach ($rs['row'] as $sh) { $sync_to_ip = $sh['ipaddress']; $password = $sh['password']; - if($sh['username']) + if ($sh['username']) { $username = $sh['username']; - else + } else { $username = 'admin'; - if($password && $sync_to_ip) + } + if ($password && $sync_to_ip) { filer_do_xmlrpc_sync($sync_to_ip, $username, $password); } + } } log_error("[filer] filer_xmlrpc_sync.php is ending."); } -/* Do the actual XMLRPC sync */ + +/* Do the actual XMLRPC sync. */ function filer_do_xmlrpc_sync($sync_to_ip, $username, $password) { global $config, $g; - if(!$username) + if (!$username) { return; - - if(!$password) + } + + if (!$password) { return; + } - if(!$sync_to_ip) + if (!$sync_to_ip) { return; + } $xmlrpc_sync_neighbor = $sync_to_ip; - if($config['system']['webgui']['protocol'] != "") { + if ($config['system']['webgui']['protocol'] != "") { $synchronizetoip = $config['system']['webgui']['protocol']; $synchronizetoip .= "://"; - } - $port = $config['system']['webgui']['port']; - /* if port is empty lets rely on the protocol selection */ - if($port == "") { - if($config['system']['webgui']['protocol'] == "http") + } + $port = $config['system']['webgui']['port']; + /* If port is empty, let's rely on the protocol selection. */ + if ($port == "") { + if ($config['system']['webgui']['protocol'] == "http") { $port = "80"; - else + } else { $port = "443"; - } + } + } $synchronizetoip .= $sync_to_ip; - /* xml will hold the sections to sync */ + /* xml will hold the sections to sync. */ $xml = array(); $xml['filer'] = $config['installedpackages']['filer']; - - /* assemble xmlrpc payload */ + + /* Assemble XMLRPC payload. */ $params = array( XML_RPC_encode($password), XML_RPC_encode($xml) ); - /* set a few variables needed for sync code borrowed from filter.inc */ + /* Set a few variables needed for sync; code borrowed from filter.inc. */ $url = $synchronizetoip; log_error("Beginning Filer XMLRPC sync to {$url}:{$port}."); $method = 'pfsense.merge_installedpackages_section_xmlrpc'; $msg = new XML_RPC_Message($method, $params); $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port); $cli->setCredentials($username, $password); - if($g['debug']) + if ($g['debug']) { $cli->setDebug(1); - /* send our XMLRPC message and timeout after 250 seconds */ + } + /* Send our XMLRPC message and timeout after 250 seconds. */ $resp = $cli->send($msg, "250"); - if(!$resp) { + if (!$resp) { $error = "A communications error occurred while attempting filer XMLRPC sync with {$url}:{$port}."; log_error($error); file_notice("sync_settings", $error, "filer Settings Sync", ""); - } elseif($resp->faultCode()) { + } elseif ($resp->faultCode()) { $cli->setDebug(1); $resp = $cli->send($msg, "250"); $error = "An error code was received while attempting filer XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString(); @@ -197,27 +194,27 @@ function filer_do_xmlrpc_sync($sync_to_ip, $username, $password) { } else { log_error("filer XMLRPC sync successfully completed with {$url}:{$port}."); } - - /* tell filer to reload our settings on the destionation sync host. */ + + /* Tell filer to reload our settings on the destination sync host. */ $method = 'pfsense.exec_php'; - $execcmd = "require_once('/usr/local/pkg/filer.inc');\n"; + $execcmd = "require_once('/usr/local/pkg/filer.inc');\n"; $execcmd .= "sync_package_filer();"; - /* assemble xmlrpc payload */ + /* Assemble XMLRPC payload. */ $params = array( XML_RPC_encode($password), XML_RPC_encode($execcmd) ); - + log_error("filer XMLRPC reload data {$url}:{$port}."); $msg = new XML_RPC_Message($method, $params); $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port); $cli->setCredentials($username, $password); $resp = $cli->send($msg, "250"); - if(!$resp) { + if (!$resp) { $error = "A communications error occurred while attempting filer XMLRPC sync with {$url}:{$port} (pfsense.exec_php)."; log_error($error); file_notice("sync_settings", $error, "filer Settings Sync", ""); - } elseif($resp->faultCode()) { + } elseif ($resp->faultCode()) { $cli->setDebug(1); $resp = $cli->send($msg, "250"); $error = "An error code was received while attempting filer XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString(); @@ -226,7 +223,6 @@ function filer_do_xmlrpc_sync($sync_to_ip, $username, $password) { } else { log_error("filer XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php)."); } - } ?> diff --git a/config/filer/filer.xml b/config/filer/filer.xml index 71821067..98eb4bd8 100644 --- a/config/filer/filer.xml +++ b/config/filer/filer.xml @@ -1,59 +1,58 @@ <?xml version="1.0" encoding="utf-8" ?> -<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd"> -<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?> +<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> +<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ -/* ========================================================================== */ + <copyright> + <![CDATA[ +/* $Id$ */ +/* ====================================================================================== */ /* - filer.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com> - Copyright (C) 2011 Brian Scholer - Copyright (C) 2012 Marcello Coutinho - All rights reserved. + filer.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com> + Copyright (C) 2011 Brian Scholer + Copyright (C) 2012 Marcello Coutinho + Copyright (C) 2015 ESF, LLC + All rights reserved. */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ -/* ========================================================================== */ - ]]> - </copyright> - <description>Describe your package here</description> - <requirements>Describe your package requirements here</requirements> - <faq>Currently there are no FAQ items provided.</faq> + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>filer</name> - <version>0.60.1</version> + <version>0.60.2</version> <title>Filer</title> <include_file>/usr/local/pkg/filer.inc</include_file> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>0755</chmod> <item>https://packages.pfsense.org/packages/config/filer/filer.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>0755</chmod> <item>https://packages.pfsense.org/packages/config/filer/filer_sync.xml</item> </additional_files_needed> <menu> @@ -73,7 +72,6 @@ <url>/pkg_edit.php?xml=filer_sync.xml</url> </tab> </tabs> - <adddeleteeditpagefields> <columnitem> <fielddescr>File</fielddescr> @@ -99,7 +97,7 @@ <fieldname>fullfile</fieldname> <type>input</type> <size>60</size> - <description>Enter Full file path</description> + <description>Enter full file path.</description> <required/> </field> <field> @@ -107,6 +105,7 @@ <fieldname>description</fieldname> <description>Enter a description for this file.</description> <type>input</type> + <typehint>(Not parsed -- this is for your reference only.)</typehint> <size>60</size> </field> <field> @@ -114,7 +113,7 @@ <fieldname>mod</fieldname> <type>input</type> <size>10</size> - <description><![CDATA[Enter file permission you want on this file<br>Blank leaves the permissions alone.]]></description> + <description><![CDATA[Enter file permission you want on this file<br />If left blank, default file permissions (0644) will be used.]]></description> </field> <field> <fielddescr>File Contents</fielddescr> @@ -129,23 +128,33 @@ <field> <type>listtopic</type> <fieldname>temp</fieldname> - <name>cmd to run after file save/sync</name> + <name>Command to run after file save/sync.</name> </field> <field> - <fielddescr>script</fielddescr> + <fielddescr>Script/Command</fielddescr> <fieldname>cmd</fieldname> - <description>Enter script or cmd to run after file save/sync</description> + <description>Enter script or command to run after file save/sync.</description> <type>input</type> + <typehint>(Optional. If using a custom script, it must have executable bit set.)</typehint> <size>60</size> </field> <field> - <fielddescr>execute mode</fielddescr> + <fielddescr>Execute mode</fielddescr> <fieldname>background</fieldname> <type>select</type> <options> - <option><name>Background (default)</name><value>background</value></option> - <option><name>Foreground</name><value>foreground</value></option> - <option><name>Do not run this script</name><value>disabled</value></option> + <option> + <name>Background (default)</name> + <value>background</value> + </option> + <option> + <name>Foreground</name> + <value>foreground</value> + </option> + <option> + <name>Do not run this script</name> + <value>disabled</value> + </option> </options> <description>Choose the way script will run.</description> </field> @@ -153,8 +162,6 @@ <custom_php_install_command> filer_install(); </custom_php_install_command> - <custom_php_command_before_form> - </custom_php_command_before_form> <custom_php_validation_command> filer_validate_input($_POST, $input_errors); </custom_php_validation_command> @@ -164,4 +171,4 @@ <custom_php_resync_config_command> sync_package_filer(); </custom_php_resync_config_command> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/filer/filer_sync.xml b/config/filer/filer_sync.xml index c51bae86..0b4124ce 100644 --- a/config/filer/filer_sync.xml +++ b/config/filer/filer_sync.xml @@ -2,48 +2,49 @@ <!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ -/* ========================================================================== */ + <copyright> + <![CDATA[ +/* $Id$ */ +/* ====================================================================================== */ /* - filer_sync.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2008 Scott Ullrich <sullrich@gmail.com> - Copyright (C) 2011 Brian Scholer - Copyright (C) 2012 Marcello Coutinho - All rights reserved. - */ -/* ========================================================================== */ + filer_sync.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2010 Scott Ullrich <sullrich@gmail.com> + Copyright (C) 2011 Brian Scholer + Copyright (C) 2012 Marcello Coutinho + Copyright (C) 2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ -/* ========================================================================== */ - ]]> - </copyright> - <description>Describe your package here</description> - <requirements>Describe your package requirements here</requirements> - <faq>Currently there are no FAQ items provided.</faq> + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>filersync</name> - <version>1.1</version> + <version>1.2</version> <title>Filer: Sync</title> <include_file>/usr/local/pkg/filer.inc</include_file> <tabs> @@ -62,11 +63,11 @@ <type>listtopic</type> <fieldname>temp</fieldname> <name>Enable Filer configuration sync</name> - </field> + </field> <field> - <fielddescr>Automatically sync Filer configuration changes</fielddescr> + <fielddescr>Automatically sync Filer configuration changes.</fielddescr> <fieldname>synconchanges</fieldname> - <description>pfSense will automatically sync changes to the hosts defined below. Blank user assumes 'admin'.</description> + <description>pfSense will automatically sync changes to the hosts defined below. (Leave blank to use 'admin'.)</description> <type>checkbox</type> </field> <field> @@ -77,7 +78,7 @@ <rowhelperfield> <fielddescr>IP Address</fielddescr> <fieldname>ipaddress</fieldname> - <description>IP Address of remote server</description> + <description>IP Address of remote server.</description> <type>input</type> <size>20</size> <required/> @@ -85,7 +86,7 @@ <rowhelperfield> <fielddescr>User Name</fielddescr> <fieldname>username</fieldname> - <description>user name of remote server</description> + <description>user name of remote server.</description> <type>input</type> <size>20</size> </rowhelperfield> @@ -101,9 +102,9 @@ </field> </fields> <custom_php_resync_config_command> - filer_sync_on_changes(); + filer_sync_on_changes(); </custom_php_resync_config_command> - <custom_php_command_before_form> + <custom_php_command_before_form> unset($_POST['temp']); </custom_php_command_before_form> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/ftpproxy/ftpproxy.inc b/config/ftpproxy/ftpproxy.inc index 7fc54775..ece580c2 100644 --- a/config/ftpproxy/ftpproxy.inc +++ b/config/ftpproxy/ftpproxy.inc @@ -1,4 +1,34 @@ <?php +/* + ftpproxy.inc + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2015 ESF, LLC + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +*/ function sync_package_ftpproxy() { conf_mount_rw(); config_lock(); @@ -144,4 +174,4 @@ function ftpproxy_generate_rules($type) { } return $rules; } -?>
\ No newline at end of file +?> diff --git a/config/ftpproxy/ftpproxy.xml b/config/ftpproxy/ftpproxy.xml index 5bd123dc..eb2af370 100644 --- a/config/ftpproxy/ftpproxy.xml +++ b/config/ftpproxy/ftpproxy.xml @@ -1,12 +1,52 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd"> +<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?> <packagegui> + <copyright> + <![CDATA[ +/* $Id$ */ +/* ====================================================================================== */ +/* + ftpproxy.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>FTP Client Proxy</name> - <version>0.2</version> + <version>0.2.1</version> <title>FTP Client Proxy</title> <aftersaveredirect>pkg_edit.php?xml=ftpproxy.xml</aftersaveredirect> <include_file>/usr/local/pkg/ftpproxy.inc</include_file> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/ftpproxy/ftpproxy.inc</item> </additional_files_needed> <menu> @@ -95,7 +135,7 @@ <field> <fielddescr>Idle Timeout (Default: 86400)</fielddescr> <fieldname>idletimeout</fieldname> - <description>(Seconds) Number of seconds that the control connection can be idle, before the proxy will disconnect. The maximum is 86400 seconds. Do not set this too low, because the control connection is usually idle when large data transfers are taking place.</description> + <description>(Seconds) Number of seconds that the control connection can be idle, before the proxy will disconnect. The maximum is 86400 seconds. Do not set this too low, because the control connection is usually idle when large data transfers are taking place.</description> <type>input</type> </field> <field> diff --git a/config/ntopng/ntopng.xml b/config/ntopng/ntopng.xml index dcb3f2b7..3d07b064 100644 --- a/config/ntopng/ntopng.xml +++ b/config/ntopng/ntopng.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> -<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd"> -<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?> +<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> +<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> <copyright> <![CDATA[ @@ -8,7 +8,7 @@ /* ========================================================================== */ /* ntopng.xml - part of pfSense (http://www.pfSense.com) + part of pfSense (https://www.pfSense.org/) Copyright (C) 2014 ESF, LLC All rights reserved. */ @@ -39,7 +39,7 @@ ]]> </copyright> <name>ntopng</name> - <version>1.2 v0.5</version> + <version>0.7.2</version> <title>Diagnostics: ntopng Settings</title> <savetext>Change</savetext> <aftersaveredirect>pkg_edit.php?xml=ntopng.xml</aftersaveredirect> @@ -146,6 +146,8 @@ config_lock(); global $config; global $input_errors; + global $pf_version, $scripts_path, $fonts_path; + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); if ($_POST) { $config['installedpackages']['ntopng']['config'] = array(); $config['installedpackages']['ntopng']['config'][0] = $_POST; @@ -156,15 +158,26 @@ safe_mkdir("/var/db/ntopng/rrd/graphics", 0755, true); system("/bin/chmod -R 755 /var/db/ntopng"); system("/usr/sbin/chown -R nobody:nobody /var/db/ntopng"); - $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version == "2.2") { $fonts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/local/lib/X11/fonts"; + $scripts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/local/share/ntopng/scripts"; } else if ($pf_version == "2.1") { $fonts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/lib/X11/fonts"; + $scripts_path = "/usr/pbi/ntopng-" . php_uname("m") . "/share/ntopng/scripts"; } else { $fonts_path = "/usr/local/lib/X11/fonts"; } + if ($pf_version == "2.1" || $pf_version == "2.2") { + $ntopng_share_path = "/usr/local/share/ntopng"; + $scripts_link_path = $ntopng_share_path . "/scripts"; + safe_mkdir("$ntopng_share_path", 0755, true); + if (!file_exists($scripts_link_path)) { + symlink($scripts_path, $scripts_link_path); + } + } system("/bin/cp -Rp {$fonts_path}/webfonts/ {$fonts_path}/TTF/"); + $first = 0; foreach($ntopng_config['interface_array'] as $iface) { $if = convert_friendly_interface_to_real_interface_name($iface); @@ -211,7 +224,6 @@ $disable_alerts = "-H"; } - $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); if ($pf_version == "2.2") { $redis_path = "/usr/pbi/ntopng-" . php_uname("m") . "/local/bin"; } else if ($pf_version == "2.1") { @@ -318,6 +330,12 @@ </custom_php_install_command> <custom_php_deinstall_command> exec("rm /usr/local/etc/rc.d/ntopng*"); + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version == "2.1" || $pf_version == "2.2") { + if (is_dir("/usr/local/share/ntopng/")) { + exec("rm -rf /usr/local/share/ntopng/"); + } + } </custom_php_deinstall_command> <custom_php_validation_command> <![CDATA[ diff --git a/config/rrd-summary/rrd-summary.xml b/config/rrd-summary/rrd-summary.xml index 4b62272d..67c20937 100644 --- a/config/rrd-summary/rrd-summary.xml +++ b/config/rrd-summary/rrd-summary.xml @@ -2,69 +2,57 @@ <!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ + <copyright> + <![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - rrd-summary.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2010 to whom it may belong - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>. - All rights reserved. - */ -/* ========================================================================== */ + rrd-summary.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2010 Jim Pingle + Copyright (C) 2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ -/* ========================================================================== */ - ]]> - </copyright> + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <description>RRD Summary Page</description> - <requirements>None</requirements> - <faq>Currently there are no FAQ items provided.</faq> <name>RRD Summary</name> - <version>1.1</version> + <version>1.2</version> <title>Status: RRD Summary</title> <menu> <name>RRD Summary</name> - <tooltiptext></tooltiptext> + <tooltiptext>Display total amount of traffic passed In/Out during this and the previous month.</tooltiptext> <section>Status</section> <url>/status_rrd_summary.php</url> </menu> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/rrd-summary/status_rrd_summary.php</item> </additional_files_needed> - <custom_php_deinstall_command> - <![CDATA[ - $version = file_get_contents("/etc/version"); - if ($version[0] < 2) { - unlink_if_exists("/usr/local/www/status_rrd_summary.php"); - } - ]]> - </custom_php_deinstall_command> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/rrd-summary/status_rrd_summary.php b/config/rrd-summary/status_rrd_summary.php index 0e43d95c..27a6f069 100644 --- a/config/rrd-summary/status_rrd_summary.php +++ b/config/rrd-summary/status_rrd_summary.php @@ -1,7 +1,10 @@ <?php /* rrd_summary.php + part of pfSense (https://www.pfsense.org/) Copyright (C) 2010 Jim Pingle + Copyright (C) 2015 ESF, LLC + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -37,9 +40,9 @@ $lastmonth = fetch_rrd_summary($rrd, $lastmonth, $start, 720*60); function fetch_rrd_summary($rrd, $start, $end, $resolution=3600) { $traffic = array(); - $rrd = escapeshellarg("/var/db/rrd/{$rrd}"); + $rrd = escapeshellarg("/var/db/rrd/{$rrd}"); $start = escapeshellarg($start); - $end = escapeshellarg($end); + $end = escapeshellarg($end); exec("/usr/local/bin/rrdtool fetch {$rrd} AVERAGE -r {$resolution} -s {$start} -e {$end} | grep -v nan | awk '{ sum1 += $2/(1024*1024); sum2 += $3/(1024*1024) } END { printf \"%u|%u\", sum1*{$resolution}, sum2*{$resolution}; }'", $traffic); return explode('|', trim($traffic[0])); } @@ -55,19 +58,20 @@ function print_rrd_summary_table($data) { ?> } $pgtitle = "Status: RRD Summary"; -include("head.inc"); -include("fbegin.inc"); +include_once("head.inc"); +echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">"; +include_once("fbegin.inc"); $rrds = glob("/var/db/rrd/*-traffic.rrd"); ?> -<form name="form1" action="status_rrd_summary.php" method="POST"> - RRD Database: +<form name="form1" action="status_rrd_summary.php" method="post"> + RRD Database: <select name="rrd" class="formselect" onchange="document.form1.submit()"> <?php foreach ($rrds as $r) { $r = basename($r); - $selected = ($r == $rrd) ? " selected" : ""; + $selected = ($r == $rrd) ? ' selected="selected"' : ''; print "<option value=\"{$r}\"{$selected}>{$r}</option>"; } ?> </select> @@ -75,7 +79,7 @@ $rrds = glob("/var/db/rrd/*-traffic.rrd"); <select name="startday" class="formselect" onchange="document.form1.submit()"> <?php for ($day=1; $day < 29; $day++) { - $selected = ($day == $startday) ? " selected" : ""; + $selected = ($day == $startday) ? ' selected="selected"' : ""; print "<option value=\"{$day}\"{$selected}>{$day}</option>"; } ?> </select> @@ -87,4 +91,6 @@ This Month (to date, does not include this hour, starting at day <?php echo $sta Last Month: <?php print_rrd_summary_table($lastmonth); ?> -<?php include("fend.inc"); ?> +<?php include_once("fend.inc"); ?> +</body> +</html> diff --git a/config/sudo/sudo.inc b/config/sudo/sudo.inc index 1c07984d..ed0feb9c 100644 --- a/config/sudo/sudo.inc +++ b/config/sudo/sudo.inc @@ -1,8 +1,9 @@ <?php /* sudo.inc - + part of pfSense (https://www.pfSense.org/) Copyright (C) 2013 Jim Pingle (jpingle@gmail.com) + Copyright (C) 2015 ESF, LLC All rights reserved. Redistribution and use in source and binary forms, with or without @@ -32,7 +33,7 @@ global $pfs_version; $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); switch ($pfs_version) { case "2.1": - // Hackish way to detect if someone manually did pkg_add rather than use pbi. + /* Hackish way to detect if someone manually did pkg_add rather than use pbi. */ if (is_dir('/usr/pbi/sudo-' . php_uname("m"))) { define('SUDO_BASE', '/usr/pbi/sudo-' . php_uname("m")); define('SUDO_LIBEXEC_DIR', '/usr/local/libexec/'); @@ -43,7 +44,7 @@ switch ($pfs_version) { break; case "2.2": define('SUDO_BASE','/usr/local'); - // Hackish way to detect if someone manually did pkg_add rather than use pbi. + /* Hackish way to detect if someone manually did pkg_add rather than use pbi. */ if (is_dir('/usr/pbi/sudo-' . php_uname("m"))) { define('SUDO_LIBEXEC_DIR', '/usr/pbi/sudo-' . php_uname("m") . '/local/libexec/sudo'); } else { @@ -132,16 +133,19 @@ function sudo_write_config() { conf_mount_ro(); } -/* Get a list of users and groups in a format we can use to make proper sudoers entries. +/* +Get a list of users and groups in a format we can use to make proper sudoers entries. Optionally include "ALL" as a user (for use by the Run As list) */ function sudo_get_users($list_all_user = false) { global $config; - if (!is_array($config['system']['user'])) + if (!is_array($config['system']['user'])) { $config['system']['user'] = array(); + } $a_user = &$config['system']['user']; - if (!is_array($config['system']['group'])) + if (!is_array($config['system']['group'])) { $config['system']['group'] = array(); + } $a_group = &$config['system']['group']; $users = array(); @@ -174,8 +178,9 @@ function sudo_get_users($list_all_user = false) { foreach ($a_group as $group) { /* The "all" group is internal and doesn't make sense to use here. */ - if ($group['name'] == "all") + if ($group['name'] == "all") { continue; + } $tmpgroup = array(); $tmpgroup["name"] = "group:{$group['name']}"; $tmpgroup["descr"] = "Group: {$group['name']}"; @@ -185,20 +190,23 @@ function sudo_get_users($list_all_user = false) { return $users; } -/* Make sure commands passed in are valid executables to help ensure a valid sudoers file and expected behavior. - This also forces the user to give full paths to executables, which they should be doing anyhow. +/* +Make sure commands passed in are valid executables to help ensure a valid sudoers file and expected behavior. +This also forces the user to give full paths to executables, which they should be doing anyhow. */ function sudo_validate_commands(&$input_errors) { $idx = 0; while(isset($_POST["cmdlist{$idx}"])) { $commands = $_POST["cmdlist" . $idx++]; - if (strtoupper($commands) == "ALL") + if (strtoupper($commands) == "ALL") { continue; + } $commands = explode(",", $commands); foreach ($commands as $command) { list($cmd, $params) = explode(" ", trim($command), 2); - if (!is_executable($cmd)) + if (!is_executable($cmd)) { $input_errors[] = htmlspecialchars($cmd) . " is not an executable command."; + } } } } diff --git a/config/sudo/sudo.xml b/config/sudo/sudo.xml index 069606ba..e9b4dcbb 100644 --- a/config/sudo/sudo.xml +++ b/config/sudo/sudo.xml @@ -1,9 +1,48 @@ <?xml version="1.0" encoding="utf-8" ?> <packagegui> + <copyright> + <![CDATA[ +/* $Id$ */ +/* ====================================================================================== */ +/* + sudo.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2013 Jim Pingle + Copyright (C) 2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ +/* + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <description>Sudo Command Control</description> <requirements>None</requirements> <name>sudo</name> - <version>0.2.5</version> + <version>0.2.6</version> <title>Sudo - Shell Command Privilege Delegation Utility</title> <include_file>/usr/local/pkg/sudo.inc</include_file> <menu> @@ -15,7 +54,6 @@ <configpath>installedpackages->package->sudo</configpath> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/sudo/sudo.inc</item> </additional_files_needed> <fields> diff --git a/config/syslog-ng/syslog-ng.inc b/config/syslog-ng/syslog-ng.inc index bbec3a7c..56decfad 100644 --- a/config/syslog-ng/syslog-ng.inc +++ b/config/syslog-ng/syslog-ng.inc @@ -69,6 +69,8 @@ function syslogng_deinstall_command() { if (is_link("/usr/local/lib/syslog-ng")) unlink_if_exists("/usr/local/lib/syslog-ng"); syslogng_install_cron(false); + unlink_if_exists("/usr/local/etc/logrotate.conf"); + unlink_if_exists("/usr/local/etc/syslog-ng.conf"); conf_mount_ro(); filter_configure(); } @@ -165,7 +167,7 @@ function syslogng_install_cron($should_install) { $cron_item['month'] = "*"; $cron_item['wday'] = "*"; $cron_item['who'] = "root"; - $cron_item['command'] = "/usr/bin/nice -n20 /usr/local/sbin/logrotate /usr/local/etc/logrotate.conf"; + $cron_item['command'] = "/usr/bin/nice -n20 " . SYSLOGNG_BASEDIR . "local/sbin/logrotate /usr/local/etc/logrotate.conf"; $config['cron']['item'][] = $cron_item; $need_write = true; } diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index 5effa10c..f2bda436 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -63,6 +63,21 @@ function tinydns_custom_php_install_command() { if($config['installedpackages']['tinydns']['config'][0]['refreshinterval']) $refreshinterval = $config['installedpackages']['tinydns']['config'][0]['refreshinterval']; + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version == "2.2") { + $svscan_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svscan"; + $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svc"; + $tinydns_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin"; + } else if ($pf_version == "2.1") { + $svscan_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svscan"; + $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svc"; + $tinydns_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin"; + } else { + $svscan_path = "/usr/local/bin/svscan"; + $svc_path = "/usr/local/bin/svc"; + $tinydns_path = "/usr/local/bin"; + } + $svscan = <<<EOD #!/bin/sh @@ -74,7 +89,7 @@ function tinydns_custom_php_install_command() { name="svscan" rcvar="\${name}_enable" -command="/usr/local/bin/svscan" +command="{$svscan_path}" svscan_enable=\${svscan_enable-"YES"} svscan_servicedir=\${svscan_servicedir-"{$g['varrun_path']}/service"} logdir="/var/log/svscan" @@ -90,7 +105,7 @@ svscan_start () { echo "Starting svscan." mkdir -p \$logdir /usr/bin/env \ - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + PATH={$tinydns_path}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ /usr/sbin/daemon -f /bin/sh -c "\$command \$svscan_servicedir 2>&1 | /usr/local/bin/multilog t \$logdir" > /dev/null EOD; @@ -105,7 +120,7 @@ $svscan .= <<<EOD svscan_stop_post () { echo "Stopping svscan." - find -L "\$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d \( \! -path "\$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 /usr/local/bin/svc -dx + find -L "\$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d \( \! -path "\$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 {$svc_path} -dx /bin/pkill -F /var/run/ping_hosts.pid } @@ -132,11 +147,11 @@ ENDPHP\n"; $stop = ""; $interfaces = explode(",", $config['installedpackages']['tinydns']['config'][0]['interface']); foreach ($interfaces as $dnsidx => $dnsif) - $stop .= "\t/usr/local/bin/svc -dx {$g['varrun_path']}/service/dnscache{$dnsidx}\n"; + $stop .= "\t{$svc_path} -dx {$g['varrun_path']}/service/dnscache{$dnsidx}\n"; $stop .= <<<ENDSH - /usr/local/bin/svc -dx {$g['varrun_path']}/service/tinydns - /usr/local/bin/svc -dx {$g['varrun_path']}/service/axfrdns + {$svc_path} -dx {$g['varrun_path']}/service/tinydns + {$svc_path} -dx {$g['varrun_path']}/service/axfrdns /bin/rm -rf {$g['varrun_path']}/service/tinydns 2>/dev/null /bin/rm -rf {$g['varetc_path']}/tinydns 2>/dev/null /bin/rm -rf {$g['varrun_path']}/dnscache* 2>/dev/null @@ -161,9 +176,19 @@ function tinydns_custom_php_deinstall_command() { global $g, $config; conf_mount_rw(); + + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version == "2.2") { + $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svc"; + } else if ($pf_version == "2.1") { + $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svc"; + } else { + $svc_path = "/usr/local/bin/svc"; + } + /* destroy all daemontools items */ - exec("/usr/local/bin/svc -xk {$g['varetc_path']}/tinydns*"); - exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache*"); + exec("{$svc_path} -xk {$g['varetc_path']}/tinydns*"); + exec("{$svc_path} -xk {$g['varetc_path']}/dnscache*"); exec("/usr/local/etc/rc.d/tinydns.sh stop"); exec("/usr/local/etc/rc.d/svscan.sh stop"); exec("/usr/bin/killall supervise"); @@ -225,7 +250,7 @@ function tinydns_custom_php_changeip_command() { } exec("echo {$dnsserverip} > {$g['varetc_path']}/tinydns/env/IP"); - exec("/usr/local/bin/svc -xk {$g['varrun_path']}/service/tinydns"); + exec("{$svc_path} -xk {$g['varrun_path']}/service/tinydns"); if(!empty($config['installedpackages']['tinydns']['config'][0]['enableforwarding'])) { @@ -277,7 +302,7 @@ function tinydns_custom_php_changeip_command() { /* setup symlink to start dnscache */ exec("/bin/ln -s {$g['varetc_path']}/dnscache{$dnsidx} {$g['varrun_path']}/service/"); - exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache{$dnsidx}"); + exec("{$svc_path} -xk {$g['varetc_path']}/dnscache{$dnsidx}"); } } else { $interfaces = explode(",", $$config['installedpackages']['tinydns']['config'][0]['interface']); @@ -285,7 +310,7 @@ function tinydns_custom_php_changeip_command() { if(is_dir("{$g['varetc_path']}/dnscache{$dnsidx}")) dnscache_use_root_servers($dnsidx); } - exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache*"); + exec("{$svc_path} -xk {$g['varetc_path']}/dnscache*"); } /* a wee bit of magic - something seems to start up a broken dnscache, the below kills it, and svc restarts it correctly. */ diff --git a/config/tinydns/tinydns.xml b/config/tinydns/tinydns.xml index fa80953c..55ee3269 100644 --- a/config/tinydns/tinydns.xml +++ b/config/tinydns/tinydns.xml @@ -2,45 +2,47 @@ <!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ + <copyright> + <![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - tinydns.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2007 to whom it may belong - All rights reserved. - */ -/* ========================================================================== */ + tinydns.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 Bill Marquette + Copyright (C) 2010 Ermal Luçi + Copyright (C) 2010-2011 Scott Ullrich + Copyright (C) 2012-2015 ESF, LLC + All rights reserved. +*/ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - */ -/* ========================================================================== */ - ]]> - </copyright> - <description>Describe your package here</description> - <requirements>Describe your package requirements here</requirements> - <faq>Currently there are no FAQ items provided.</faq> + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>tinydns</name> <version>1.0</version> <title>DNS Server: Settings</title> @@ -94,62 +96,53 @@ <configpath>installedpackages->package->tinydns</configpath> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/pf/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_xmlrpc_sync.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_domains.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_status.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_dhcp_filter.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_filter.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> + <chmod>0775</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_down.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> + <chmod>0775</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_up.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> + <chmod>0775</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_parse_logs.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_view_logs.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/tinydns_sync.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/wizards/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/tinydns/new_zone_wizard.xml</item> </additional_files_needed> <fields> @@ -237,23 +230,23 @@ <field> <fielddescr>Hosts allowed to perform DNS Zone Transfers - Note: this requires TCP port 53 firewall permit rule!</fielddescr> <fieldname>none</fieldname> - <type>rowhelper</type> - <rowhelper> - <rowhelperfield> - <fielddescr>IP Address</fielddescr> - <fieldname>ztipaddress</fieldname> - <description>Enter the IP Address that is allowed to transfer zone records (ex: 4.2.2.1)</description> - <type>input</type> - <size>20</size> - </rowhelperfield> - <rowhelperfield> - <fielddescr>DNS Zone - Use * for all Zones</fielddescr> - <fieldname>dnszone</fieldname> - <description>Enter the DNS zone that this IP address is allowed to transfer (ex: domain.com)</description> - <type>input</type> - <size>20</size> - </rowhelperfield> - </rowhelper> + <type>rowhelper</type> + <rowhelper> + <rowhelperfield> + <fielddescr>IP Address</fielddescr> + <fieldname>ztipaddress</fieldname> + <description>Enter the IP Address that is allowed to transfer zone records (ex: 4.2.2.1)</description> + <type>input</type> + <size>20</size> + </rowhelperfield> + <rowhelperfield> + <fielddescr>DNS Zone - Use * for all Zones</fielddescr> + <fieldname>dnszone</fieldname> + <description>Enter the DNS zone that this IP address is allowed to transfer (ex: domain.com)</description> + <type>input</type> + <size>20</size> + </rowhelperfield> + </rowhelper> </field> </fields> <custom_delete_php_command> @@ -290,9 +283,10 @@ </custom_php_deinstall_command> <custom_php_command_before_form> <![CDATA[ - unset($_POST['temp']); - if(!is_process_running("svscan")) - $savemsg = "NOTE: svscan is not running. Please <a href='/status_services.php?mode=restartservice&service=svscan'>start svscan</a> to bring up the DNS Server"; + unset($_POST['temp']); + if (!is_process_running("svscan")) { + $savemsg = "NOTE: svscan is not running. Please <a href='/status_services.php?mode=restartservice&service=svscan'>start svscan</a> to bring up the DNS Server"; + } ]]> </custom_php_command_before_form> </packagegui> diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 9362740f..60883e9c 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -79,7 +79,7 @@ <category>File Management</category> <pkginfolink>https://doc.pfsense.org/index.php/Filer_package</pkginfolink> <config_file>https://packages.pfsense.org/packages/config/filer/filer.xml</config_file> - <version>0.60.1</version> + <version>0.60.2</version> <status>Beta</status> <required_version>2.2</required_version> <maintainer>bscholer@cshl.edu</maintainer> @@ -301,7 +301,7 @@ <ports_before>databases/redis databases/gdbm net/GeoIP x11-fonts/font-util x11-fonts/webfonts graphics/graphviz</ports_before> <port>net/ntopng</port> </build_pbi> - <version>0.7.1</version> + <version>0.7.2</version> <status>ALPHA</status> <required_version>2.2</required_version> <config_file>https://packages.pfsense.org/packages/config/ntopng/ntopng.xml</config_file> @@ -687,7 +687,7 @@ <descr>pfSense version of TinyDNS which features failover host support</descr> <website>http://cr.yp.to/djbdns.html</website> <category>Services</category> - <version>1.0.6.22</version> + <version>1.0.6.23</version> <status>Beta</status> <pkginfolink>https://doc.pfsense.org/index.php/Tinydns_package</pkginfolink> <required_version>2.2</required_version> @@ -739,7 +739,7 @@ <descr>Broadcasts a who-has ARP packet on the network and prints answers. </descr> <website>http://www.habets.pp.se/synscan/programs.php?prog=arping</website> <category>Services</category> - <version>1.1</version> + <version>1.2</version> <status>Stable</status> <required_version>2.2</required_version> <config_file>https://packages.pfsense.org/packages/config/arping/arping.xml</config_file> @@ -1191,7 +1191,7 @@ <name>blinkled</name> <descr>Allows you to use LEDs for network activity on supported platforms (ALIX, WRAP, Soekris, etc)</descr> <category>System</category> - <version>0.4.3</version> + <version>0.4.4</version> <status>Beta</status> <maintainer>jimp@pfsense.org</maintainer> <required_version>2.2</required_version> @@ -1245,7 +1245,7 @@ <internal_name>RRD_Summary</internal_name> <descr>RRD Summary Page, which will give a total amount of traffic passed In/Out during this and the previous month.</descr> <category>System</category> - <version>1.1</version> + <version>1.2</version> <status>Beta</status> <maintainer>jimp@pfsense.org</maintainer> <port_category>sysutils</port_category> @@ -1463,7 +1463,7 @@ <website>http://www.balabit.com/network-security/syslog-ng/</website> <descr>Syslog-ng syslog server. This service is not intended to replace the default pfSense syslog server but rather acts as an independent syslog server.</descr> <category>Services</category> - <version>1.0.6</version> + <version>1.0.7</version> <status>ALPHA</status> <required_version>2.2</required_version> <depends_on_package_pbi>syslog-ng-3.6.2_3-##ARCH##.pbi</depends_on_package_pbi> @@ -1570,7 +1570,7 @@ <pkginfolink>https://doc.pfsense.org/index.php/Sudo_Package</pkginfolink> <descr><![CDATA[sudo allows delegation of privileges to users in the shell so commands can be run as other users, such as root.]]></descr> <category>Security</category> - <version>0.2.5</version> + <version>0.2.6</version> <status>Beta</status> <required_version>2.2</required_version> <config_file>https://packages.pfsense.org/packages/config/sudo/sudo.xml</config_file> @@ -1674,7 +1674,7 @@ <internal_name>FTP_Client_Proxy</internal_name> <descr><![CDATA[Basic FTP Client Proxy using ftp-proxy from FreeBSD]]></descr> <maintainer>jimp@pfsense.org</maintainer> - <version>0.2</version> + <version>0.2.1</version> <category>Services</category> <status>Beta</status> <port_category>ftp</port_category> |