Loading core/lib/Drupal/Core/Updater/Updater.php +4 −4 Original line number Diff line number Diff line Loading @@ -340,12 +340,12 @@ public function prepareInstallDirectory(&$filetransfer, $directory) { // Probably still not writable. Try to chmod and do it again. // @todo Make a new exception class so we can catch it differently. try { $old_perms = substr(sprintf('%o', fileperms($parent_dir)), -4); $old_perms = fileperms($parent_dir) & 0777; $filetransfer->chmod($parent_dir, 0755); $filetransfer->createDirectory($directory); $this->makeWorldReadable($filetransfer, $directory); // Put the permissions back. $filetransfer->chmod($parent_dir, intval($old_perms, 8)); $filetransfer->chmod($parent_dir, $old_perms); } catch (FileTransferException $e) { $message = t($e->getMessage(), $e->arguments); Loading @@ -372,8 +372,8 @@ public function prepareInstallDirectory(&$filetransfer, $directory) { public function makeWorldReadable(&$filetransfer, $path, $recursive = TRUE) { if (!is_executable($path)) { // Set it to read + execute. $new_perms = substr(sprintf('%o', fileperms($path)), -4, -1) . "5"; $filetransfer->chmod($path, intval($new_perms, 8), $recursive); $new_perms = fileperms($path) & 0777 | 0005; $filetransfer->chmod($path, $new_perms, $recursive); } } Loading Loading
core/lib/Drupal/Core/Updater/Updater.php +4 −4 Original line number Diff line number Diff line Loading @@ -340,12 +340,12 @@ public function prepareInstallDirectory(&$filetransfer, $directory) { // Probably still not writable. Try to chmod and do it again. // @todo Make a new exception class so we can catch it differently. try { $old_perms = substr(sprintf('%o', fileperms($parent_dir)), -4); $old_perms = fileperms($parent_dir) & 0777; $filetransfer->chmod($parent_dir, 0755); $filetransfer->createDirectory($directory); $this->makeWorldReadable($filetransfer, $directory); // Put the permissions back. $filetransfer->chmod($parent_dir, intval($old_perms, 8)); $filetransfer->chmod($parent_dir, $old_perms); } catch (FileTransferException $e) { $message = t($e->getMessage(), $e->arguments); Loading @@ -372,8 +372,8 @@ public function prepareInstallDirectory(&$filetransfer, $directory) { public function makeWorldReadable(&$filetransfer, $path, $recursive = TRUE) { if (!is_executable($path)) { // Set it to read + execute. $new_perms = substr(sprintf('%o', fileperms($path)), -4, -1) . "5"; $filetransfer->chmod($path, intval($new_perms, 8), $recursive); $new_perms = fileperms($path) & 0777 | 0005; $filetransfer->chmod($path, $new_perms, $recursive); } } Loading