Skip to content
Snippets Groups Projects
Commit 235da54a authored by Adam G-H's avatar Adam G-H
Browse files

Issue #3429268: Chmod 0777 race condition during staging operations

parent d145dddc
No related branches found
No related tags found
No related merge requests found
......@@ -67,7 +67,7 @@ class SiteConfigurationExcluder implements EventSubscriberInterface {
}
/**
* Makes the staged `sites/default` directory world-writable.
* Makes the staged `sites/default` directory owner-writable.
*
* This is done to allow the core scaffold plugin to make changes in
* `sites/default`, if necessary, without breaking if `sites/default` is not
......@@ -89,7 +89,7 @@ class SiteConfigurationExcluder implements EventSubscriberInterface {
if (!is_dir($dir)) {
return;
}
if (!$this->fileSystem->chmod($dir, 0777)) {
if (!$this->fileSystem->chmod($dir, 0700)) {
throw new FileException("Could not change permissions on '$dir'.");
}
}
......
......@@ -54,7 +54,7 @@ final class Cleaner extends QueueWorkerBase implements ContainerFactoryPluginInt
if (file_exists($dir)) {
$this->fileSystem->deleteRecursive($dir, function (string $path): void {
$this->fileSystem->chmod($path, 0777);
$this->fileSystem->chmod($path, is_dir($path) ? 0700 : 0600);
});
}
}
......
......@@ -470,7 +470,7 @@ class CoreUpdateTest extends UpdateTestBase {
$pattern = '/^Unused stage directory deleted: (.+)$/m';
$matches = [];
preg_match($pattern, $output, $matches);
$this->assertCount(2, $matches);
$this->assertCount(2, $matches, $output);
$this->assertDirectoryDoesNotExist($matches[1]);
// Rerunning the command should exit with a message that no newer version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment