diff options
author | jim-p <jimp@pfsense.org> | 2016-12-15 11:47:03 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2016-12-15 11:47:42 -0500 |
commit | 7f3974479a1a991fe93bcf317538a933394c8c93 (patch) | |
tree | a937fe6e9829ff6acddf0a2ed59d30c6d406df8e | |
parent | 157c9f135581d3714d54f4e19064482a3e133003 (diff) | |
download | pfsense-7f3974479a1a991fe93bcf317538a933394c8c93.zip pfsense-7f3974479a1a991fe93bcf317538a933394c8c93.tar.gz |
If nothing is enabled that requires xinetd, do not run xinetd. Fixes #6308
-rw-r--r-- | src/etc/inc/filter.inc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index d6dee4a..903726a 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -2151,17 +2151,19 @@ function filter_nat_rules_generate() { // Open xinetd.conf write handle $xinetd_fd = fopen("{$g['varetc_path']}/xinetd.conf", "w"); - /* add tftp protocol helper */ - $ftp_proxy_entry = array( - 'port' => 6969, - 'socket_type' => 'dgram', - 'protocol' => 'udp', - 'wait' => 'yes', - 'user' => 'root', - 'server' => '/usr/libexec/tftp-proxy', - 'server_args' => '-v' - ); - fwrite($xinetd_fd, xinetd_service_entry($ftp_proxy_entry)); + if (!empty($config['system']['tftpinterface'])) { + /* add tftp protocol helper */ + $ftp_proxy_entry = array( + 'port' => 6969, + 'socket_type' => 'dgram', + 'protocol' => 'udp', + 'wait' => 'yes', + 'user' => 'root', + 'server' => '/usr/libexec/tftp-proxy', + 'server_args' => '-v' + ); + fwrite($xinetd_fd, xinetd_service_entry($ftp_proxy_entry)); + } if (isset($config['nat']['rule'])) { /* start reflection redirects on port 19000 of localhost */ @@ -2380,7 +2382,7 @@ function filter_nat_rules_generate() { } // Check if xinetd is running, if not start it. If so, restart it gracefully. - if (file_exists("{$g['varetc_path']}/xinetd.conf")) { + if (file_exists("{$g['varetc_path']}/xinetd.conf") && (filesize("{$g['varetc_path']}/xinetd.conf") > 0)) { if (isvalidpid("{$g['varrun_path']}/xinetd.pid")) { sigkillbypid("{$g['varrun_path']}/xinetd.pid", "HUP"); } else { @@ -2389,6 +2391,8 @@ function filter_nat_rules_generate() { "-f {$g['varetc_path']}/xinetd.conf " . "-pidfile {$g['varrun_path']}/xinetd.pid"); } + } elseif (isvalidpid("{$g['varrun_path']}/xinetd.pid")) { + killbypid("{$g['varrun_path']}/xinetd.pid"); } return $natrules; |