nextcloud / nextcloud/ldap_write_support

[bug] new line character at the end of LDIF template and then you cannot add new users

Open
#132 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
PHP
Stars
33
Forks
14
Avg merge
1d 4h
Merged PRs (30d)
13

Description

I spent 7 hours and 10 minutes finding a surreal bug, the LDIF template must be trimmed appropiately

I had one environment working and the other one no (error text=: empty AttributeDescription)

The faulty LDIF template was:

dn: uid={UID},ou=users,{BASE}
objectClass: inetOrgPerson
uid: {UID}
displayName: {UID}
cn: {UID}
sn: {UID}
userPassword: {PWD}

the good one

dn: uid={UID},ou=users,{BASE}
objectClass: inetOrgPerson
uid: {UID}
displayName: {UID}
cn: {UID}
sn: {UID}
userPassword: {PWD}

the patch

dn: uid={UID},ou=users,{BASE}
objectClass: inetOrgPerson
uid: {UID}
displayName: {UID}
cn: {UID}
sn: {UID}
userPassword: {PWD}
-

the error was the last newline character that generated a new attribute list item without anything on it, and that made slapd to protest saying text=: empty AttributeDescription

empty-attributedescription

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

No files, tests, or entry points are named. Start by locating the code that generates the LDIF user template and reproduce the slapd error with a trailing blank line; done means the generated LDIF has no empty attribute entry and new users can be added successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.