nextcloud / nextcloud/server

[Bug]: Can't set quota from LDAP (or ldap default quota) if display name is not set

Open
#59,432 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 32-feedback bug feature: ldap
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
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
  1. Set up LDAP server (eg. LLDAP)
  2. Set up Nextcloud with LDAP app configured, with default LDAP quota and LDAP quota attribute correctly set
  3. Create user in LLDAP, don't set display name
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.