Do not start pftpx with address any.

This commit is contained in:
Scott Ullrich 2006-07-11 00:53:05 +00:00
parent 9d44f462bc
commit fae3e0f6d7

View File

@ -790,22 +790,26 @@ function filter_nat_rules_generate() {
if($target <> "") {
log_error("target <> ''");
if($extport[0] == "21" and !isset($config['interfaces'][strtolower($rule['interface'])]['disableftpproxy'])) {
log_error("Testing for /bin/ps awux | grep \"{$target} -b {$external_address}\" | grep -v grep");
$helpers = exec("/bin/ps awux | grep \"{$target} -b {$external_address}\" | grep -v grep");
if($extaddr == "any") {
$external_address_text = "";
} else {
$external_address_text = " -b {$extaddr}";
}
$helpers = exec("/bin/ps awux | grep \"{$target}{$external_address_text}\" | grep -v grep");
if(!$helpers) {
log_error("no helper detected");
$external_address = $rule['external-address'];
if($external_address == "")
$external_address = find_interface_ip(get_real_wan_interface());
/* install a pftpx helper, do not set a rule. also use the delay filter configure run
* routines because if this is the first bootup the filter is not completely configured
* and thus pf is not fully running. otherwise we end up with: pftpx: pf is disabled
*/
if($rule['force_ftp_source_ip'])
$force_ftp_source_ip = $rule['force_ftp_source_ip'];
else
$force_ftp_source_ip = "";
$after_filter_configure_run[] = "/usr/local/sbin/pftpx -f {$target} -b {$external_address} -c 21 -g 21 {$force_ftp_source_ip} 2>>/tmp/pftpx_errors";
/* install a pftpx helper, do not set a rule. also use the delay filter configure run
* routines because if this is the first bootup the filter is not completely configured
* and thus pf is not fully running. otherwise we end up with: pftpx: pf is disabled
*/
if($rule['force_ftp_source_ip'])
$force_ftp_source_ip = $rule['force_ftp_source_ip'];
else
$force_ftp_source_ip = "";
$after_filter_configure_run[] = "/usr/local/sbin/pftpx -f {$target} -b {$external_address} -c 21 -g 21 {$force_ftp_source_ip} 2>>/tmp/pftpx_errors";
}
$dontinstallrdr = true;
}