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

fixed some issues relating to creation of paths. the commands worked, but the validation was wrong.

parent 4f0894ca
......@@ -492,17 +492,20 @@ function provision_check_path($path, $type, $test = true, $succeed_message = '',
break;
case "is_dir" : $value = is_dir($path);
break;
case "owner" : $value = fileowner($path);
case "owner" : $info = posix_getpwuid(fileowner($path));
$value = $info['name'];
break;
case "group" : $value = filegroup($path);
break;
case "mkdir" : $value = mkdir($path, 0770, true);
break;
case "chmod" : chmod($path, $test);
$value = sprintf("%o", fileperms($path));
case "chmod" : chmod($path, $test);
$test = (int) sprintf('%o', $test); # needs to be reset to oct
$value = (int) substr(sprintf('%o', fileperms($path)), -4);
break;
case "chown" : chown($path, $test);
$value = fileowner($path);
$info = posix_getpwuid(fileowner($path));
$value = $info['name'];
break;
case "chgrp" : chgrp($path, $test);
$value = filegroup($path);
......@@ -527,4 +530,4 @@ function provision_check_path($path, $type, $test = true, $succeed_message = '',
}
}
return $status;
}
\ No newline at end of file
}
......@@ -576,8 +576,8 @@ function _provision_verify($url = '') {
t("Could not change ownership <code>%path</code>", array("%path" => $path)),
PROVISION_PERM_ERROR | PROVISION_FRAMEWORK_ERROR );
provision_check_path($path, "chmod", 0700,
t("Changed permissions of <code>%path</code> to %perms", array("%path" => $path, '%perms' => 0700)),
t("Could not change ownership <code>%path</code> to %perms", array("%path" => $path, '%perms' => 0700)),
t("Changed permissions of <code>%path</code> to %perms", array("%path" => $path, '%perms' => sprintf('%o', 0700))),
t("Could not change ownership <code>%path</code> to %perms", array("%path" => $path, '%perms' => sprintf('%o', 0700))),
PROVISION_PERM_ERROR | PROVISION_FRAMEWORK_ERROR );
$data = array();
......
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