Issue Bug Closed

#91462LostFilesCommand custom-path fails on symlinked storages/folders

Andreas Häfner 05/25/20, 10:25 updated 04/23/25, 09:55

Description

The LostFileCommand fails because of comparison based on realpath if a via --custom-path pased folders is symlinked:

bin/typo3cms cleanup:lostfiles --update-refindex --custom-path='uploads/symlinked_Folder'
[...]
16782 records from 47 tables were checked/updated.
Index Integrity was perfect!

 [ Exception ]                                   
  The path: "uploads/symlinked_Folder" is invalid 

However in normal mode or when using --exclude to exclude other folders the cleanup of “uploads/symlinked_Folder” works.

The problem is the comparison via realpath in sysext/lowlevel/Classes/Command/LostFilesCommand.php#L192

ls -l /var/www/releases/current/public/uploads
lrwxr-xr-x  1 www  www  28 May 11 13:44 /var/www/releases/current/public/uploads -> ../../../shared/Data/uploads
realpath /var/www/releases/current/public
/var/www/releases/20200511114408/public
realpath /var/www/releases/20200511114408/public/uploads/symlinked_Folder
/var/www/shared/Data/uploads/symlinked_Folder

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.