Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMB/CIFS share breaks when it contains a symlink entry that can't be accessed #15876

Closed
rik26 opened this issue Jun 5, 2019 · 1 comment
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@rik26
Copy link

rik26 commented Jun 5, 2019

Related to :
#7332
#7556

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;
        }
@rik26 rik26 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jun 5, 2019
@szaimen
Copy link
Contributor

szaimen commented 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.

@szaimen szaimen closed this as completed May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

2 participants