summaryrefslogtreecommitdiffstats
path: root/usr/local/www/crash_reporter.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-02-10 12:22:50 +0000
committerErmal <eri@pfsense.org>2013-02-10 12:22:50 +0000
commiteb2339191437c435bdc959b8bc0de9584aa24f28 (patch)
tree3b15692ba5fbdb407c3d1e3fd1bcf7681e72d299 /usr/local/www/crash_reporter.php
parent1c903aa4d471eb35039014937e065ddd9113e29c (diff)
downloadpfsense-eb2339191437c435bdc959b8bc0de9584aa24f28.zip
pfsense-eb2339191437c435bdc959b8bc0de9584aa24f28.tar.gz
Make sure the directory exists
Diffstat (limited to 'usr/local/www/crash_reporter.php')
-rwxr-xr-xusr/local/www/crash_reporter.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php
index 3cbc51f..d3146b8 100755
--- a/usr/local/www/crash_reporter.php
+++ b/usr/local/www/crash_reporter.php
@@ -101,7 +101,9 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
<?php
if (gettext($_POST['Submit']) == "Yes") {
echo gettext("Processing...");
- file_put_contents("/var/crash/crashreport_header.txt", $crash_report_header);
+ if (!is_dir("/var/crash"))
+ mwexec("/bin/mkdir -p /var/crash");
+ @file_put_contents("/var/crash/crashreport_header.txt", $crash_report_header);
if(file_exists("/tmp/PHP_errors.log"))
exec("cp /tmp/PHP_errors.log /var/crash/");
exec("/usr/bin/gzip /var/crash/*");
OpenPOWER on IntegriCloud