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

External (SMB/CIFS) storage app: always shows hidden files / does not scan subfolders #22032

Closed
steve-s-71 opened this issue Jul 28, 2020 · 11 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: external storage needs info

Comments

@steve-s-71
Copy link

steve-s-71 commented Jul 28, 2020

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Navigate to Settings -> External storages and mount a new SMB / CIFS storage
  2. Check "enable previews", do NOT check "Show hidden files"
  3. Navigate to the newly mounted folder

Expected behaviour

a) Folder content should NOT show hidden files
b) After some time "Pending" should change to display the Size

Actual behaviour

a) Folder External storages show all files including hidden files
b) Pending is shown forever. Except when I manually naviagte to EVERY subfolder, sub-sub folder and sub-sub-sub folder - what is nearly impossible on a larger storage. It apperently is also not possible to trigger the file scan via OCC comand - that does scan all natively stored files, but apprently not the external SMB / CIFS storages.

Server configuration

NC 19.0.1
Ext. stoarge app v 1.10.0
Ubuntu 20

Web server:
Apache

Database:
PostgreSQL 12.2

PHP version:
7.4.3

@steve-s-71 steve-s-71 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jul 28, 2020
@steve-s-71
Copy link
Author

@icewind1991 @MTGap and @PVince81 might be interested into this

@steve-s-71
Copy link
Author

May I kindly ask the NC devs to look at this??

@szaimen
Copy link
Contributor

szaimen commented Jun 9, 2021

You need to run occ files:scan --all to scan all your files.

@szaimen
Copy link
Contributor

szaimen commented Jun 9, 2021

Otherwise is this Issue still valid in NC21.0.2? If not, please close this issue. Thanks! :)

@j3l11234
Copy link
Contributor

j3l11234 commented Jul 1, 2021

Otherwise is this Issue still valid in NC21.0.2? If not, please close this issue. Thanks! :)

NC21.0.2 still has this problem, hidden files will still be displayed. Even if do NOT check "Show hidden files"

@steve-s-71
Copy link
Author

@j3l11234 I can't repoduce the scan issue anymore. But the issue with the hidden files still exists in 21.0.0 and so likely also in 21.0.2 what I have not yet installed.

The issue is, the External Files app only recognise files as hidden, that start with a dot. But if an SMB share is on a Windows Server a hidden file does not start with a dot.

@j3l11234
Copy link
Contributor

j3l11234 commented Jul 1, 2021

@steve-s-71 @szaimen
Hi, I am proud to announce that I have found the cause and solution.
The root cause is that icewind/smb(External Files app) can't recognize whether the file is hidden.
Here is the detail reason:

  1. before: icewind/smb read dos permissions mask from smbclient(query system.dos_attr.mode) to determine whether it is a hidden file
  2. In Dec 19,2019, smbclient changed the system.dos_attr.mode result from dos permissions mask(which contain hidden/archive/system attributes) to unix permission mask. (https://gitlab.com/samba-team/samba/-/commit/0fe9dc521#64c7de226f297840d2892b1c3d76cc68a56fbc72)
  3. icewind/smb use starting with a dot to determine whether it is a hidden file. (https://github.com/icewind1991/SMB/blob/9dba42ab2a3990de29e18cc62b0a8270aceb74e3/src/Native/NativeFileInfo.php#L78)

I found a way to get these properties. I have already submit a pull request to icewind/smb and waiting for merge and release new version.
icewind1991/SMB#107

Dos permissions mask refer: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb/65e0c225-5925-44b0-8104-6b91339c709f

@szaimen szaimen added 2. developing Work in progress feature: external storage and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap needs info labels Jul 1, 2021
@steve-s-71
Copy link
Author

@j3l11234 this is awesome. You made my day - thank you!

Is there a way for me as a "non-developer" to know if a new version of the External Storage App with this fix included is released?

@j3l11234
Copy link
Contributor

j3l11234 commented Jul 4, 2021

@steve-s-71 I'm still waiting for mr to be merged. I can compile a libsmbclient package on ubuntu to solve this problem.

@steve-s-71
Copy link
Author

@jospoortvliet can you please ask a developer to make this fix available in NC release?

@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 2. developing Work in progress labels Jan 23, 2023
@szaimen szaimen closed this as completed Mar 6, 2023
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 feature: external storage needs info
Projects
None yet
Development

No branches or pull requests

3 participants