diff --git a/exec/background_stigs.php b/exec/background_stigs.php
index 03c3637..7d01cdb 100644
--- a/exec/background_stigs.php
+++ b/exec/background_stigs.php
@@ -155,7 +155,7 @@ foreach ($xml_files as $key => $file) {
continue;
}
elseif(!empty(STIG_EXCLUSIONS) && preg_match("/" . STIG_EXCLUSIONS . "/i", $file)) {
- unlink($file);
+ unlink(TMP . "/stigs/xml/$file");
$log->debug("Skipping $file due to matching STIG exclusion");
continue;
}
diff --git a/exec/installer.php b/exec/installer.php
index 7e00965..22937ce 100644
--- a/exec/installer.php
+++ b/exec/installer.php
@@ -101,16 +101,26 @@ function save_Database($params)
$php = null;
$mysql = null;
if (strtolower(substr(PHP_OS, 0, 3)) == 'lin') {
+ $res = [];
+ exec("which php", $res);
if (file_exists('/bin/php')) {
$php = realpath("/bin/php");
}
+ elseif (is_array($res) && isset($res[0]) && file_exists($res[0])) {
+ $php = realpath($res[0]);
+ }
else {
die(json_encode(['error' => 'Cannot find the PHP executable']));
}
+ $res = [];
+ exec("which mysql", $res);
if (file_exists('/bin/mysql')) {
$mysql = realpath('/bin/mysql');
}
+ elseif (is_array($res) && isset($res[0]) && file_exists($res[0])) {
+ $mysql = realpath($res[0]);
+ }
else {
die(json_encode(['error' => 'Cannot find the MySQL executable']));
}
diff --git a/setup.php b/setup.php
index febbbf6..e9a7a96 100644
--- a/setup.php
+++ b/setup.php
@@ -51,6 +51,14 @@ if (!is_writable(dirname(__FILE__) . "/config.inc")) {
die("Sagacity needs write access to the config.inc file in the document root");
}
+if(!is_writable(dirname(__FILE__) . "/inc")) {
+ die("Sagacity needs write access to the /inc directory to create the encrypted password file");
+}
+
+if(!file_exists(dirname(__FILE__) . "/logs")) {
+ mkdir(dirname(__FILE__) . "/logs");
+}
+
if (!function_exists('openssl_encrypt')) {
print <<