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

regression in 16 SMB/CIFS Shares with $ at the end don't work #15238

Closed
fsmeets opened this issue Apr 25, 2019 · 7 comments
Closed

regression in 16 SMB/CIFS Shares with $ at the end don't work #15238

fsmeets opened this issue Apr 25, 2019 · 7 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@fsmeets
Copy link

fsmeets commented Apr 25, 2019

Steps to reproduce

  1. try mounting external storage SMB/CIFS with a share that ends with $ e.g. sharename$ these are "hidden" shares. They used to work fine in at least 13, 14 and 15.

Expected behaviour

external storage should be mounted and accessible.

Actual behaviour

share is not accessible, there is a message in the log:

{"reqId":"9iezNzbQSQUWX80ZXGM4","level":3,"time":"2019-04-25T19:33:49+00:00","remoteAddr":"93.x.x.154","user":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx","app":"files_external","method":"GET","url":"/apps/files_external/globalstorages/5?testOnly=true","message":"A placeholder was not substituted: sharename$ for mount type \OCA\Files_External\Lib\Storage\SMB","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Firefox/68.0","version":"16.0.0.9"}

I'm not sure whether there should be a substitution in the share field, or not. Maybe the $ needs to be escaped in some way?!

I "fixed" it with the following hack:

--- apps-pkg/files_external/lib/config.php.orig 2019-04-25 21:43:15.121994000 +0200
+++ apps-pkg/files_external/lib/config.php      2019-04-25 21:43:32.502900000 +0200
@@ -244,6 +244,10 @@
                                // no replacements in passwords
                                continue;
                        }
+                       if($key === 'share') {
+                               // no replacements in shares
+                               continue;
+                       }
                        $option = self::substitutePlaceholdersInConfig($option);
                        if(!self::arePlaceholdersSubstituted($option)) {
                                \OC::$server->getLogger()->error(

Server configuration

Operating system: FreeBSD 12.0

Web server: nginx 1.16.0

Database: MySQL 5.7.25

PHP version: 7.3.4

Nextcloud version: 16.0.0

Updated from an older Nextcloud/ownCloud or fresh install: 15.0.7

Where did you install Nextcloud from: FreeBSD ports/pkg

Signing status:

Signing status No errors have been found.

List of activated apps:

App list Enabled: - accessibility: 1.2.0 - activity: 2.9.1 - cloud_federation_api: 0.2.0 - comments: 1.6.0 - dav: 1.9.2 - federatedfilesharing: 1.6.0 - federation: 1.6.0 - files: 1.11.0 - files_external: 1.7.0 - files_pdfviewer: 1.5.0 - files_rightclick: 0.13.0 - files_sharing: 1.8.0 - files_texteditor: 2.8.0 - files_trashbin: 1.6.0 - files_versions: 1.9.0 - files_videoplayer: 1.5.0 - firstrunwizard: 2.5.0 - gallery: 18.3.0 - logreader: 2.1.0 - lookup_server_connector: 1.4.0 - nextcloud_announcements: 1.5.0 - notifications: 2.4.1 - oauth2: 1.4.2 - password_policy: 1.6.0 - privacy: 1.0.0 - provisioning_api: 1.6.0 - recommendations: 0.4.0 - serverinfo: 1.6.0 - sharebymail: 1.6.0 - support: 1.0.0 - survey_client: 1.4.0 - systemtags: 1.6.0 - theming: 1.7.0 - twofactor_backupcodes: 1.5.0 - updatenotification: 1.6.0 - user_ldap: 1.6.0 - viewer: 1.0.0 - workflowengine: 1.6.0 Disabled: - admin_audit - encryption - impersonate-master - richdocuments - twofactor_totp

Nextcloud configuration:

Config report

{
"system": {
"force_language": "de_DE",
"instanceid": "REMOVED SENSITIVE VALUE",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"cloud.xxx.xxx"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"overwrite.cli.url": "https://cloud.xxx.xxx",
"dbtype": "mysql",
"version": "16.0.0.9",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"memcache.local": "\OC\Memcache\APCu",
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "\OCA\User_LDAP\LDAPProviderFactory",
"theme": "",
"loglevel": 2,
"maintenance": false,
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "PLAIN",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "25",
"session_lifetime": 3600,
"apps_paths": [
{
"path": "/usr/local/www/nextcloud/apps",
"url": "/apps",
"writable": true
},
{
"path": "/usr/local/www/nextcloud/apps-pkg",
"url": "/apps-pkg",
"writable": false
}
],
"appstoreenabled": false
}
}

Are you using external storage, if yes which one: smb

Are you using encryption: no

Are you using an external user-backend, if yes which one: ActiveDirectory

@fsmeets fsmeets added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 25, 2019
@j-ed
Copy link
Contributor

j-ed commented May 15, 2019

The problem has been reported by an other user too:

https://help.nextcloud.com/t/feature-verstecke-windows-freigabe-einbinden/53281

@kesselb
Copy link
Contributor

kesselb commented May 18, 2019

Thank you for reporting this issue 🎉 There is another report with a proposed fix: #15567

@kesselb kesselb closed this as completed May 18, 2019
@KurtCa
Copy link

KurtCa commented May 20, 2019

Hey this hack worked for me. The fix proposed in #15567 does not work for me.
Wil this be fixed in the next release?

@kesselb
Copy link
Contributor

kesselb commented May 20, 2019

@KurtCa mind to create a new issue? Sure we could ignore placeholder for share. I'm not an smb / ldap expert but something like a smb share with the name of a ldap user sounds like a valid use case?

@NineSeven8
Copy link

This solution works perfectly, thanks for this. #15567 didn't work for me either.

@SchmelAtWork
Copy link

Works for me perfectly for 16.0.1 and 16.0.2.
Thanks a lot!

@barrydegraaff
Copy link

Just upgraded to 16.0.3 and this issue came up. The solution suggested in this issue worked.

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

No branches or pull requests

7 participants