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

Dollar sign in SMB external storage not supported anymore #15567

Closed
rainbob5 opened this issue May 16, 2019 · 14 comments · Fixed by #15637
Closed

Dollar sign in SMB external storage not supported anymore #15567

rainbob5 opened this issue May 16, 2019 · 14 comments · Fixed by #15637
Assignees
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug regression

Comments

@rainbob5
Copy link

rainbob5 commented May 16, 2019

After updating from v15 to v16, my SMB storages with a dollar sign in the configuration name (useful to hide shares in a Windows network) doesn't work anymore. If I rename with share without the dollar sign it works

EDIT: The bug is just on the home page of the file app; if I try to access the storage with /?dir=myshare in the URL it works

Steps to reproduce

  1. Configure a SMB storage with a dollar in the name
  2. Go to file app

Expected behaviour

I should be able to click on the share and access its files

Actual behaviour

The share name is red and when I click on it I have an error message: "Mount configuration incomplete. Do you want to review mount point config in admin settings page?"
In the admin logs I have this error: "A placeholder was not substituted: myshare$ for mount type \OCA\Files_External\Lib\Storage\SMB"

Server configuration

Docker image nextcloud:16

@rainbob5 rainbob5 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels May 16, 2019
@hessercan
Copy link

I have the same issue. Shares worked fine in 15.0.7. Updated to 16.0.1 tonight and my private share is inaccessible because of the $

@Anti-Lope
Copy link

I have the sam issue. update 15.0.6 -> 16.0.1
double check mountpoint with and without $ and it is the $

@RockNLol
Copy link

Same issues after updating from 15.0.6 to 16.0.1

@kesselb
Copy link
Contributor

kesselb commented May 17, 2019

Looks like a regression from #14174

There is a check if all placeholders for external storage configuration is replaced. A placeholder starts with an $. If your share name ends with $ the configuration looks incomplete. The patch below allows $ as last character (a hidden share always ends with $ right?)

Index: apps/files_external/lib/config.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- apps/files_external/lib/config.php	(revision a3b4410283a0517b458deacc8ee704c12ec028bd)
+++ apps/files_external/lib/config.php	(date 1558130442000)
@@ -292,7 +292,7 @@
 				}
 			}
 		} else if (is_string($option)) {
-			if (strpos($option, '$') !== false) {
+			if (strpos(rtrim($option, '$'), '$') !== false) {
 				$result = false;
 			}
 		}


cc @blizzz you better know if the patch is acceptable. Not sure if this works well with ldap ;)

@blizzz
Copy link
Member

blizzz commented May 17, 2019

@kesselb yes, that looks fine from my point of view! In LDAP we just introduce another placeholder.

Would be awesome if someone could confirm :

a hidden share always ends with $ right?

@kesselb
Copy link
Contributor

kesselb commented May 17, 2019

Updated the patch. I forgot about rtrim ;)

@rainbob5
Copy link
Author

@kesselb yes, that looks fine from my point of view! In LDAP we just introduce another placeholder.

Would be awesome if someone could confirm :

a hidden share always ends with $ right?

Yes that's the only way to configure a hidden share.

I confirm the fix is working, my shares are back on tracks, thanks !

@blizzz
Copy link
Member

blizzz commented May 20, 2019

@rainbob5 superb, thanks for the feedback.

@kesselb mind opening the PR then?

@smoonlee
Copy link

Thanks, Fixed my issue on 16.0.1

@thechonta

This comment has been minimized.

@kesselb

This comment has been minimized.

@thechonta

This comment has been minimized.

@victorbw
Copy link

victorbw commented Jul 11, 2019

worked for me as well! (16.0.3)

thank you for sharing this with us! *thumbsup

@StodgyWaif
Copy link

Thank You!
This patch resolved the issue on our server 16.0.3 on Ubuntu 18.04.1
However it did not fix opening documents in Collabora on hidden share.
We are using a share like this \\Server\Users$\$user\
(Hidden share with login name variable)
I have no idea if this is related or not.
Clicking on a document gives this message:

Failed to read document from storage. Please contact your storage server (nextcloud.domain.com) administrator.

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 regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.