File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
apps/files_external/lib/Lib/Storage Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -178,9 +178,15 @@ protected function getFileInfo(string $path): IFileInfo {
178178 throw new \OCP \Files \NotFoundException ($ e ->getMessage (), 0 , $ e );
179179 } catch (ForbiddenException $ e ) {
180180 // with php-smbclient, this exception is thrown when the provided password is invalid.
181- // Possible is also ForbiddenException with a different error code, so we check it.
182- if ($ e -> getCode () === 1 ) {
181+ // we check if we can stat the root, which should only fail in authentication failures
182+ if ($ path === '' ) {
183183 $ this ->throwUnavailable ($ e );
184+ } else {
185+ try {
186+ $ this ->share ->stat ('' );
187+ } catch (\Exception $ e ) {
188+ $ this ->throwUnavailable ($ e );
189+ }
184190 }
185191 throw new \OCP \Files \ForbiddenException ($ e ->getMessage (), false , $ e );
186192 }
You can’t perform that action at this time.
0 commit comments