-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
WebDAV yields empty results when encountering restricted content in SMB external storage (patch included) #24893
Comments
does it? The return is type hinted to iterable. false is not an iterable. |
My PHP skills date from > 20 years ago (before all this fancy OO programming, and now get off my lane ;) ). I am not able to provide any feedback about iterables if my life would depend on it, but the ForbiddenException breakage does not occur any more when encountering restricted content, and the SMB share is now fully accessible with WebDAV, where previously it was not. Example of an SMB share :
with "b/" being restricted (ACL's applied). Without the patch :
With the patch :
-> I.e. working as expected. |
Note : next to our production deployment (two 19.0.4 instances, soon to be upgraded to 20.0.4), I have a 20.0.4 sandbox environment, available for testing patches. |
Same issue with:
Fix from @didierm fixes the issue from me, SMB shares are now accessible again. Cheers! |
I have the same issue with my Nextcloud 20.0.4 on Ubuntu 20.04 and PHP 7.4. The fix from @didierm worked for me too! |
@didierm not really. The PR #25313 is to mitigate against a rare situation where oc_filecache has an inconsistency. @icewind1991 any comments on the patch above ? |
The issue actually seems to be showing since the merge of #24102 as there the available space was requested additionally in the files propfind request, however the underlying issue with the no permission exception not being cached anywhere when trying to iterate over the directory is something that must have been there before. I tend to agree that catching the exception inside of the getFolderContents method would be a somehow sane attempt to solve this, however I cannot fully see if that has any other side-effects. To reproduce the issue basically create a smb share with ACLs applied to only one subdirectory and do not check the "Verify ACL access when listing files" setting.
|
Testing of #25383 is very welcome, a patch to apply on top of 20.0.5 is also available here: You can apply the patch with the following command inside of your Nextcloud directory:
|
@juliushaertl @rullzer -> milestone 20.0.7 candidate ? |
Steps to reproduce
Expected behaviour
The folder scan should skip the restricted folder(s) and provide the client with the readable contents of the share.
Actual behaviour
The folder scan aborts, and returns an empty folder list.
This happens at both the top share level, or later at any subfolder level, if restricted content is encountered.
Server configuration
Operating system:
CentOS Linux release 7.9.2009 (Core)
Web server:
Apache 2.4.6
Database:
PostgreSQL 9.2.24
PHP version:
PHP 7.3.25
Nextcloud version: (see Nextcloud admin page)
versions 19.0.4 and 20.0.4
Are you using external storage, if yes which one: local/smb/sftp/...
SMB/CIFS
Are you using encryption:
no
Are you using an external user-backend, if yes which one:
LDAP
Client configuration
Browser:
Windows Explorer
Operating system:
Windows10
Logs
Nextcloud log (data/nextcloud.log)
Nextcloud log
More information
Fix
By tracing the calls in the above quoted Exception log, it was deduced the directory scan exits the function at :
server/apps/files_external/lib/Lib/Storage/SMB.php
Line 235 in 4c01f0d
Taking inspiration from the merged patch in the very analogous issue #7332, the following change fixes the issue :
server/apps/files_external/lib/Lib/Storage/SMB.php
Line 238 in 4c01f0d
I am not sure whether it's appropriate, but you may probably want to catch
(NotFoundException $e)
too.The text was updated successfully, but these errors were encountered: