Commit ee4d0fa4 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Do checking to see that the tarball has been correctly extracted. Remove db...

Do checking to see that the tarball has been correctly extracted. Remove db password from log info returned to hosting.
parent b4e9a6e9
......@@ -120,7 +120,7 @@ function _provision_mysql_import_dump($dump_file, $db_name, $db_user, $db_passwd
PROVISION_PERM_ERROR);
if ($readable) {
provision_log("notice", sprintf("Importing database using command: mysql -u%s -p%s -h%s %s < %s",
$db_user, $db_passwd, $db_host, $db_name, $dump_file));
$db_user, 'XXXXXXXXXX', $db_host, $db_name, $dump_file));
provision_shell_exec("mysql -u%s -p%s -h%s %s < %s",
$db_user, $db_passwd, $db_host, $db_name, $dump_file );
}
......
......@@ -422,6 +422,9 @@ function _provision_recursive_delete($path) {
/**
* Wrapper around drush_shell_exec to provide sprintf functionality with some more safety.
*
* @TODO: fix this so we can get error codes and the return values. drush_shell_exec is too
* limited
*/
function provision_shell_exec() {
$args = func_get_args();
......
......@@ -219,8 +219,13 @@ function provision_path_extract($path, &$target, &$reason) {
if (is_writeable(dirname($target)) && !file_exists($target) && !is_dir($target)) {
mkdir($target);
provision_shell_exec("tar -zxf %s -C %s", $path, $target);
$target = TRUE;
return TRUE;
if (is_writeable(dirname($target)) && is_readable(dirname($target)) && is_dir($target)) {
$target = TRUE;
return TRUE;
}
else {
$reason = t("The file could not be extracted");
}
}
else {
$reason = t("The target directory could not be written to");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment