File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
apps/files_external/lib/Lib/Storage Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -172,13 +172,21 @@ protected function getFileInfo(string $path): IFileInfo {
172172 }
173173 } catch (ConnectException $ e ) {
174174 $ this ->throwUnavailable ($ e );
175+ } catch (InvalidArgumentException $ e ) {
176+ $ this ->throwUnavailable ($ e );
175177 } catch (NotFoundException $ e ) {
176178 throw new \OCP \Files \NotFoundException ($ e ->getMessage (), 0 , $ e );
177179 } catch (ForbiddenException $ e ) {
178180 // with php-smbclient, this exception is thrown when the provided password is invalid.
179- // Possible is also ForbiddenException with a different error code, so we check it.
180- if ($ e -> getCode () === 1 ) {
181+ // we check if we can stat the root, which should only fail in authentication failures
182+ if ($ path === '' ) {
181183 $ this ->throwUnavailable ($ e );
184+ } else {
185+ try {
186+ $ this ->share ->stat ('' );
187+ } catch (\Exception $ e ) {
188+ $ this ->throwUnavailable ($ e );
189+ }
182190 }
183191 throw new \OCP \Files \ForbiddenException ($ e ->getMessage (), false , $ e );
184192 }
You can’t perform that action at this time.
0 commit comments