Fixes to bug #5
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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']));
|
||||
}
|
||||
|
Reference in New Issue
Block a user