-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Shared links on SMB Share stop working if AD username is written different #18715
Comments
cc @nextcloud/ldap |
@thechonta what happens with AD auth:
What happens with SMB auth:
You can get a value from LDAP that you can pass to an external storage configuration by specifying $home instead by setting the according field in LDAP's "Special attributes" in the Advanced tab. However, it does not work for provided credentials, only those pre-configured ones (and from the placeholder name you get that the initial idea was to use it in paths, but would work in any config field). |
@blizzz For my understanding it would need an phaser that take the given writing of the username and than rewrite it from what ever to an standard structure for example low-case. Kind regards Chonta |
This is on the SMB server. Nextcloud won't tamper with the provided login name.
I gave a hint on how you could use a value from LDAP to be used for your setup. Or configure AD that it would be matching comparisons on your login attributes case sensitively. |
I think if |
@kesselb it's not the uid, just the login name passed to services. |
How? The SMB Server dont care how the username is written, the nextcloud Server does.
Your hint i could not follow and to change the AD makes no sense for me. in oc_storages for every used username you have this and it is both the same user. In oc_filecache i have also for every numeric_id from oc_storage an entry. The home:: in oc_storages exist only one time for each user. Correct my if i am wrong, but the username handling the nextcloud uses in this cas is not optimal |
Ah, i see. The external SMB storages creates the identifier out of the login name that was passed to it. Mh..... but this is not related to the LDAP backend. Still, tampering with the provided credentials does not feel right. What works for you might break for others. @icewind1991 Do you have an idea, other than adding an option to read out the login name from a placeholder and only take the password from the login credentials? |
It would be the easiest way if the uid from oc_accounts would be used for the connection. Real sure you cold only be with read out the SID from the user object from the AD. |
Negative, the userid in Nextcloud never changes, regardless what is done in AD. It is created initially and stays like that.
This might work for you in your specific setup, but not for others. |
Looked into oc_credentials recently for another issue: #6343 (comment) server/lib/private/Security/CredentialsManager.php Lines 81 to 84 in 5bf3d1b
I think we are able to fetch the credentials in a case insensitive way. Not sure if possible for the storage table. |
The userid, which is used in this query, is not necessarily the same as the login name. You cannot mix them up. |
I can 🤣 You said the userid is always the same. So comparing lower(identifier) with strtolower($identifier) should work. But that's only about the credentials part and not having two record for the same credentials. |
It is immutable. In opposite to the login name, which is. Also user id is not used for logging in and can be totally different from the login name (which is default behaviour with LDAP). |
Is this Issue still valid? If not, please close this issue. Thanks! :) |
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions. |
Steps to reproduce
Expected behaviour
Expected is, that the Nextcloud will treed anny writing of the ldapaccount like the AD so it will be allways the same User and wahtever the user did will be available no matter how the user was writing his loginname.
Actual behaviour
If an user createt shared links with his login written surname.lastname and login another day with an diferent writing of hi username, all shares will be stop working.
The lokal filesystem is not affectet and if the SMB Storage is mountet to the nextcloud with fixed credentials, also nothing will be afected.
Only if the credentials for the smb share are stored in the Database und was got on login the writing of the username matters.
Nextcloud need to learn that for Ldapaccounts it dosend matter how the username is written and treet everything the same.
In the Databese for every written username there will be created entrys in oc_storages so you have multiple lines for the same objekt and the same user.
oc_filecahce also affected.
Server configuration detail
Operating system: Linux 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64
Webserver: Apache/2.4.29 (Ubuntu) (apache2handler)
Database: pgsql PostgreSQL 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, 64-bit
PHP version:
7.2.24-0ubuntu0.18.04.1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, apache2handler, mysqlnd, PDO, xml, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, igbinary, imagick, intl, json, ldap, exif, mysqli, pdo_mysql, pdo_pgsql, pgsql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache
Nextcloud version: 17.0.2 - 17.0.2.1
Updated from an older Nextcloud/ownCloud or fresh install:
Where did you install Nextcloud from: unknown
Signing status
Array
(
)
List of activated apps
Configuration (config/config.php)
Are you using external storage, if yes which one: local/smb/sftp/...
Are you using encryption:
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
LDAP configuration (delete this par if not used)
Client configuration
Browser: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
Operating system: Ubuntu 18.04
Logs
Web server error log
Nextcloud log
Browser log
Insert your browser log here, this could for example include:
The text was updated successfully, but these errors were encountered: