[Bug]: Can't set quota from LDAP (or ldap default quota) if display name is not set
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
My server has Nextcloud configured to the LLDAP server for managing accounts and groups. I configure the LDAP app in Nextcloud via occ from a systemd service. The relevant parts of it:
${occ} ldap:set-config s01 ldapUserDisplayName "displayName"
${occ} ldap:set-config s01 ldapQuotaAttribute "${quotaAttribute}"
${occ} ldap:set-config s01 ldapQuotaDefault "${defaultQuota}"
Separately:
defaultQuota = "500 GB";
quotaAttribute = "nextcloudQuota";
I can verify on the web UI that all the LDAP app parameters get set correctly by my script.
When a user in LLDAP has username, email and display name, everything works correctly, the default quota shown by default, and if I change the nextcloudQuota parameter, it will get propagated in Nextcloud.
However, if a user has username and email but NO display name, then the user will have none (Unlimited) as their quota value. So it doesn't get the configured value or the default value either. Having no display name prevents quota and possibly more properties being synced.
Steps to reproduce
- Set up LDAP server (eg. LLDAP)
- Set up Nextcloud with LDAP app configured, with default LDAP quota and LDAP quota attribute correctly set
- Create user in LLDAP, don't set display name
- Set quota from LLDAP
Expected behavior
User has first the default quota then the quota set via LDAP
Nextcloud Server version
32
Operating system
Other
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
Possibly relevant code:
https://github.com/nextcloud/server/blob/stable32/apps/user_ldap/lib/User/User.php#L88-L101
https://github.com/nextcloud/server/blob/stable32/apps/user_ldap/lib/User/User.php#L525-L578
https://github.com/nextcloud/server/blob/stable32/apps/user_ldap/lib/Access.php#L922-L937
Note: this was found by a LLM while debugging my issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/user_ldap/lib/User/User.php lines 88-101 and 525-578, then inspect apps/user_ldap/lib/Access.php lines 922-937. Reproduce the LDAP setup with a user lacking a display name and trace quota synchronization; done means both the configured default quota and the LDAP quota attribute apply without a display name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100