diff options
author | bmeeks8 <bmeeks8@bellsouth.net> | 2014-10-03 22:40:17 -0400 |
---|---|---|
committer | bmeeks8 <bmeeks8@bellsouth.net> | 2014-12-15 12:04:39 -0500 |
commit | b1f3a863bdb6fbfc252c542a81f567b070282b1e (patch) | |
tree | e52a6aacccc675cb02ce91fc1400530d10d6f185 /config/suricata/suricata_check_for_rule_updates.php | |
parent | 23933b62da3f2f0cf3c3cd3cca815a3ee31cc748 (diff) | |
download | pfsense-packages-b1f3a863bdb6fbfc252c542a81f567b070282b1e.tar.gz pfsense-packages-b1f3a863bdb6fbfc252c542a81f567b070282b1e.tar.bz2 pfsense-packages-b1f3a863bdb6fbfc252c542a81f567b070282b1e.zip |
Replace exec() calls with PHP native functions where possible.
Diffstat (limited to 'config/suricata/suricata_check_for_rule_updates.php')
-rw-r--r-- | config/suricata/suricata_check_for_rule_updates.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/config/suricata/suricata_check_for_rule_updates.php b/config/suricata/suricata_check_for_rule_updates.php index a7afafee..21808f97 100644 --- a/config/suricata/suricata_check_for_rule_updates.php +++ b/config/suricata/suricata_check_for_rule_updates.php @@ -408,9 +408,9 @@ if (is_dir("{$tmpfname}")) rmdir_recursive("{$tmpfname}"); /* Make sure required suricatadirs exsist */ -exec("/bin/mkdir -p {$suricatadir}rules"); -exec("/bin/mkdir -p {$tmpfname}"); -exec("/bin/mkdir -p {$suricatalogdir}"); +safe_mkdir("{$suricatadir}rules"); +safe_mkdir("{$tmpfname}"); +safe_mkdir("{$suricatalogdir}"); /* See if we need to automatically clear the Update Log based on 1024K size limit */ if (file_exists($suricata_rules_upd_log)) { @@ -531,7 +531,7 @@ if ($emergingthreats == 'on') { update_output_window(gettext("Installation of {$et_name} rules completed...")); } error_log(gettext("\tInstallation of {$et_name} rules completed.\n"), 3, $suricata_rules_upd_log); - exec("rm -r {$tmpfname}/emerging"); + rmdir_recursive("{$tmpfname}/emerging"); } } @@ -563,7 +563,7 @@ if ($snortdownload == 'on') { $newfile = basename($file); @copy($file, "{$suricatadir}rules/{$newfile}"); } - exec("rm -r {$tmpfname}/snortrules"); + rmdir_recursive("{$tmpfname}/snortrules"); /* extract base etc files */ if ($pkg_interface <> "console") { @@ -575,7 +575,7 @@ if ($snortdownload == 'on') { if (file_exists("{$tmpfname}/etc/{$file}")) @copy("{$tmpfname}/etc/{$file}", "{$tmpfname}/VRT_{$file}"); } - exec("rm -r {$tmpfname}/etc"); + rmdir_recursive("{$tmpfname}/etc"); if (file_exists("{$tmpfname}/{$snort_filename_md5}")) { if ($pkg_interface <> "console") update_status(gettext("Copying md5 signature to Suricata directory...")); @@ -621,7 +621,7 @@ if ($snortcommunityrules == 'on') { update_output_window(gettext("Installation of Snort GPLv2 Community Rules file completed...")); } error_log(gettext("\tInstallation of Snort GPLv2 Community Rules completed.\n"), 3, $suricata_rules_upd_log); - exec("rm -r {$tmpfname}/community"); + rmdir_recursive("{$tmpfname}/community"); } } |