open_basedir
restriction to JPATH_ROOT
e.g. /var/www/html
.php cli/joomla.php core:update
A core update should be performed correctly.
6/8 -- Extracting update package ...
Warning: is_dir(): open_basedir restriction in effect. File(/var/www) is not within the allowed path(s): (/var/www/html:/tmp) in /var/www/html/libraries/src/Filesystem/Folder.php on line 484
Warning: is_dir(): open_basedir restriction in effect. File(/var) is not within the allowed path(s): (/var/www/html:/tmp) in /var/www/html/libraries/src/Filesystem/Folder.php on line 484
Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/html:/tmp) in /var/www/html/libraries/src/Filesystem/Folder.php on line 484
Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/html:/tmp) in /var/www/html/libraries/src/Filesystem/Folder.php on line 484
In Folder.php line 69:
[RuntimeException (-1)]
Cannot create destination folder
Exception trace:
at /var/www/html/libraries/src/Filesystem/Folder.php:69
Joomla\CMS\Filesystem\Folder::copy() at /var/www/html/libraries/src/Console/UpdateCoreCommand.php:385
Joomla\CMS\Console\UpdateCoreCommand->copyFileTo() at /var/www/html/libraries/src/Console/UpdateCoreCommand.php:331
Joomla\CMS\Console\UpdateCoreCommand->processUpdatePackage() at /var/www/html/libraries/src/Console/UpdateCoreCommand.php:216
Joomla\CMS\Console\UpdateCoreCommand->updateJoomlaCore() at /var/www/html/libraries/src/Console/UpdateCoreCommand.php:168
Joomla\CMS\Console\UpdateCoreCommand->doExecute() at /var/www/html/libraries/vendor/joomla/console/src/Command/AbstractCommand.php:235
Joomla\Console\Command\AbstractCommand->execute() at /var/www/html/libraries/vendor/joomla/console/src/Application.php:1181
Joomla\Console\Application->runCommand() at /var/www/html/libraries/vendor/joomla/console/src/Application.php:403
Joomla\Console\Application->doExecute() at /var/www/html/libraries/src/Application/ConsoleApplication.php:191
Joomla\CMS\Application\ConsoleApplication->doExecute() at /var/www/html/libraries/vendor/joomla/console/src/Application.php:448
Joomla\Console\Application->execute() at /var/www/html/libraries/src/Application/ConsoleApplication.php:234
Joomla\CMS\Application\ConsoleApplication->execute() at /var/www/html/cli/joomla.php:78
I tested with a couple of docker images:
On both images I mounted a custom php.ini file into /usr/local/etc/php/conf.d/custom-php.ini
containing only the open_basedir
setting:
open_basedir = /var/www/html:/tmp
This issue is due to \Joomla\CMS\Filesystem\Folder::create
that checks if the parent folder of the one we want to create exists or not but, since it cannot access it, it runs into an endless loop.
Note that after checking if the parent folder exist the function checks if the folder we want to create exist and, if that is the case, it returns true
.
I think this issue can be solved by simply checking if the folder we want to create exists before checking for parent folders: I'm going to open a PR for that.
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-11-23 19:48:43 |
Closed_By | ⇒ | richard67 |
Closing as having a pull request.