From f7f5c7bb21c94f6be6b36202a8fa301d86a66406 Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Wed, 17 Sep 2014 15:48:17 -0400 Subject: Replace exec() calls with system calls and also use unlink_if_exists(). --- config/snort/snort_download_updates.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'config/snort/snort_download_updates.php') diff --git a/config/snort/snort_download_updates.php b/config/snort/snort_download_updates.php index c95f8440..9d677619 100755 --- a/config/snort/snort_download_updates.php +++ b/config/snort/snort_download_updates.php @@ -119,8 +119,7 @@ if (file_exists("{$snortdir}/{$snort_community_rules_filename}.md5") && $snortco /* Check for postback to see if we should clear the update log file. */ if (isset($_POST['clear'])) { - if (file_exists("{$snort_rules_upd_log}")) - mwexec("/bin/rm -f {$snort_rules_upd_log}"); + unlink_if_exists($snort_rules_upd_log); } if (isset($_POST['check'])) { @@ -133,12 +132,9 @@ if ($_POST['force']) { conf_mount_rw(); // Remove the existing MD5 signature files to force a download - if (file_exists("{$snortdir}/{$emergingthreats_filename}.md5")) - @unlink("{$snortdir}/{$emergingthreats_filename}.md5"); - if (file_exists("{$snortdir}/{$snort_community_rules_filename}.md5")) - @unlink("{$snortdir}/{$snort_community_rules_filename}.md5"); - if (file_exists("{$snortdir}/{$snort_rules_file}.md5")) - @unlink("{$snortdir}/{$snort_rules_file}.md5"); + unlink_if_exists("{$snortdir}/{$emergingthreats_filename}.md5"); + unlink_if_exists("{$snortdir}/{$snort_community_rules_filename}.md5"); + unlink_if_exists("{$snortdir}/{$snort_rules_file}.md5"); // Revert file system to R/O. conf_mount_ro(); -- cgit v1.2.3