ldap_write_support icon indicating copy to clipboard operation
ldap_write_support copied to clipboard

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

Open pedro-nonfree opened this issue 5 years ago • 2 comments

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

pedro-nonfree avatar Mar 06 '20 13:03 pedro-nonfree

Hello, I have the same issue. I use samba domain controller as ldap server. I am able to connect nextcloud to the ldap server and use ldap users whitin nextcloud. I want to be able to create and manage ldap users from nextcloud using the ldap_write support extension but also using your solution i get the error message.

qbussrl avatar Mar 17 '20 08:03 qbussrl

Oh god you saved my day ! I was having the same bug I was getting crazy ...

In logs : "Exception: Cannot create user: Undefined attribute type"

In user creation panel : pop-up "Bad request"

Thanks

battosai30 avatar Dec 02 '20 08:12 battosai30