diff options
author | Colin Smith <colin@pfsense.org> | 2005-03-13 21:54:12 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-03-13 21:54:12 +0000 |
commit | a1f1ebb44a5fc2d0fff1149f831e0071ad7a3cc9 (patch) | |
tree | b3c7de9fdcae5b2ffa7135a9c97a9560a3527ca8 /etc | |
parent | 713abf3454caa9d98f10546f7aabbb44f70bfbf2 (diff) | |
download | pfsense-a1f1ebb44a5fc2d0fff1149f831e0071ad7a3cc9.zip pfsense-a1f1ebb44a5fc2d0fff1149f831e0071ad7a3cc9.tar.gz |
resync_package_configs_bootup(): Check code syntax with eval before syncing.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index eba68c0..5b3bf7b 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -576,10 +576,20 @@ function resync_all_package_configs_bootup($show_message) { $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $package['configurationfile'], "packagegui"); if(isset($pkg_config['nosync'])) continue; if($show_message == true) print " " . $package['name']; - if($pkg_config['custom_php_command_before_form'] <> "") - eval($pkg_config['custom_php_command_before_form']); - if($pkg_config['custom_php_resync_config_command'] <> "") - eval($pkg_config['custom_php_resync_config_command']); + if($pkg_config['custom_php_command_before_form'] <> "") { + if(php_check_syntax($pkg_config['custom_php_command_before_form'])) { + eval($pkg_config['custom_php_command_before_form']); + } else { + print "(!)"; + } + } + if($pkg_config['custom_php_resync_config_command'] <> "") { + if(php_check_syntax($pkg_config['custom_php_resync_config_command'])) { + eval($pkg_config['custom_php_resync_config_command']); + } else { + print "(!)"; + } + } $depends = get_pkg_depends($package['name'], ".xml", "files", 0); // Call dependency handler and do a little more error checking. if(is_array($depends)) foreach($depends as $item) { @@ -847,4 +857,4 @@ if (!function_exists('php_check_filename_syntax')){ } } -?>
\ No newline at end of file +?> |