Closed gonzalodeniz closed 1 month ago
When I have an opening, I'll make a trace.
The recursiveChmod function has an error.
Here is a trace (I remove non-relevant variables):
# There is a path in the code that is ‘install/install’.
# $path=‘install/install’
recursiveChmod($path, $filePerm, $dirPerm) {
# basename extracts the last part of the route
$path = basename($path); # $path=‘install’;
...
} elseif (is_dir($path)) { # is_dir(‘install’) = True
# scandir(‘install’) extracts the contents of ‘/install’, not ‘install/install’.
# One of the elements returned is again ‘install’.
$foldersAndFiles = scandir($path);
# Start again at the same place. Infinite loop.
# $path/$entry = 'install/install'
recursiveChmod($path.‘/’.$entry, $filePerm, $dirPerm);
Does it work for you?
The solution is to rename or delete the second install folder:
mv install/install install/install_disable
Fixed in v3.1.2.120
Steps to reproduce
Expected behaviour
Successful completion of the upgrade
Actual behaviour
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 4096 bytes) in /var/www/html/teampass/sources/main.functions.php on line 2163
Server configuration
Operating system: ubuntu 22.04
Web server: apache 2.4
Database: MariaDB10
PHP version: 8.2
Teampass version: 3.1.2.114
Logs
Web server error log
Log from the web-browser developer console (CTRL + SHIFT + i)
I think the error is in this recursive function that does not stop:
source/main.functions.php
Line: 2141 function recursiveChmod( string $path, int $filePerm = 0644, int $dirPerm = 0755 )
Is there any news on this point?