Issue #3214097 by paul121: The file permissions could not be set on keys/*.key
This commit is contained in:
commit
462f606625
|
@ -34,21 +34,15 @@ function farm_api_install() {
|
|||
$pub_filename = sprintf('%s/public.key', $keys_path);
|
||||
$pri_filename = sprintf('%s/private.key', $keys_path);
|
||||
|
||||
if ($file_system_checker->fileExist($pub_filename) && $file_system_checker->fileExist($pri_filename)) {
|
||||
// 1. If the file already exists, then just set the correct permissions.
|
||||
$file_system->chmod($pub_filename, 0600);
|
||||
$file_system->chmod($pri_filename, 0600);
|
||||
}
|
||||
else {
|
||||
// 2. Generate the pair in the selected directory.
|
||||
// Create keys if they don't exist.
|
||||
if (!$file_system_checker->fileExist($pub_filename) || !$file_system_checker->fileExist($pri_filename)) {
|
||||
try {
|
||||
$key_gen->generateKeys($keys_path);
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
// Unable to generate files after all.
|
||||
watchdog_exception('farm_api', $e);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Delete the "Default Consumer" created by the consumers module.
|
||||
|
|
Loading…
Reference in New Issue