You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SMB/CIFS share breaks when it contains a symlink entry that can't be accessed #15876
Having a symlink on a smb share gave an unhandled exception : ForbiddenException in /apps/files_external/lib/Lib/Storage/SMB.php, private function shareMTime()
I resolved the bug with the following code. I'm unable to create a PR, i don't understand how it works.
In
/apps/files_external/lib/Lib/Storage/SMB.php :
/**
* get the best guess for the modification time of the share
*
* @return int
*/
private function shareMTime() {
$highestMTime = 0;
$files = $this->share->dir($this->root);
foreach ($files as $fileInfo) {
try {
if ($fileInfo->getMTime() > $highestMTime) {
$highestMTime = $fileInfo->getMTime();
}
} catch (NotFoundException $e) {
// Ignore this, can happen on unavailable DFS shares
- }
+ } catch (ForbiddenException $e) {
+ // Ignore this too : symlink
+ }
}
return $highestMTime;
}
I'm closing this issue due to inactivity. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen.
Activity
szaimen commentedon May 21, 2021
I'm closing this issue due to inactivity. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen.