From b1d0505eef8c0d30e20adb2d514f7f135acc5e9d Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Sat, 20 Sep 2014 17:46:01 -0400 Subject: Replace '/bin/rm' calls with rmdir_recursive() function. --- config/suricata/suricata_check_for_rule_updates.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config/suricata/suricata_check_for_rule_updates.php') diff --git a/config/suricata/suricata_check_for_rule_updates.php b/config/suricata/suricata_check_for_rule_updates.php index 065825b6..b38ebf3d 100644 --- a/config/suricata/suricata_check_for_rule_updates.php +++ b/config/suricata/suricata_check_for_rule_updates.php @@ -405,7 +405,7 @@ function suricata_fetch_new_rules($file_url, $file_dst, $file_md5, $desc = "") { /* remove old $tmpfname files if present */ if (is_dir("{$tmpfname}")) - exec("/bin/rm -r {$tmpfname}"); + rmdir_recursive("{$tmpfname}"); /* Make sure required suricatadirs exsist */ exec("/bin/mkdir -p {$suricatadir}rules"); @@ -415,7 +415,7 @@ exec("/bin/mkdir -p {$suricatalogdir}"); /* See if we need to automatically clear the Update Log based on 1024K size limit */ if (file_exists($suricata_rules_upd_log)) { if (1048576 < filesize($suricata_rules_upd_log)) - exec("/bin/rm -r {$suricata_rules_upd_log}"); + unlink_if_exists("{$suricata_rules_upd_log}"); } /* Log start time for this rules update */ @@ -753,7 +753,7 @@ if (is_dir("{$tmpfname}")) { update_status(gettext("Cleaning up after rules extraction...")); update_output_window(gettext("Removing {$tmpfname} directory...")); } - exec("/bin/rm -r {$tmpfname}"); + rmdir_recursive("{$tmpfname}"); } if ($pkg_interface <> "console") { -- cgit v1.2.3