Version: (using KDE 4.3.2) OS: Linux Installed from: Ubuntu Packages I tested kaddressbook (4.3) as front-end to manage contacts in a LDAP directory (addressbook). The server runs openldap 2.4. kaddressbook perfectly adds and deletes contacts. But it fails to modify attribute values of a contact within the LDAP directory. After changing e. g. the facsimile number of a contact, kaddressbook shows the updated number but the new number is not saved in the LDAP directory. OpenLDAP reports following failure: 'value #0 invalid per syntax'. kaddressbook uses kdepimlibs for communication with the LDAP server. kdepimlibs use the modify->replace operation of the LDAP protocol for modification of attribute values. In case of empty attributes (especially numbers) kdepimlibs does not comply to IETF RFC 2849. After the replace <attribute name> statement kdepimlibs adds an empty line before end of operation ('-'). When parsing such a request, the LDAP server reports the above mentioned error notification and denies the complete modification request. kaddressbook does not report this problem to the user.
Correction: kdepimlibs does not add an empty line but the attribute name without a value. This is not allowed by RFC 2849.
Created attachment 39004 [details] Patch for kdepimlibs proposed patch
There seems to be a simple fix for this problem. The kabc plugin ldapkio within kdepimlibs has a private addEntry method that can be changed to solve this bug. It resides in the file resourceldapkio.cpp. The addEntry method should check itself (again), if the calling function has handed over a value for a particular attribute or not. If not, the attribute name should not be added (and afterwards sent to the LDAP directory). This applies for modification (i. e. replace) operations and add operations. I've tested this solution under Ubuntu karmic and it works fine. Attribute values can be added, modified and deleted again. Attached there is the patch I've applied. I have not identified further side-effects of this patch. But I recommed some further testing.
SVN commit 1062016 by winterz: Fix "LDAP directory contents cannot be modified" Thanks to the patch from rdratlos@yahoo.co.uk BUG: 218353 MERGE: 4.3,e4 M +3 -1 resourceldapkio.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1062016
SVN commit 1062059 by winterz: Backport r1062016 by winterz from trunk to the 4.3 branch: Fix "LDAP directory contents cannot be modified" Thanks to the patch from rdratlos@yahoo.co.uk CCBUG: 218353 MERGE: 4.3,e4 M +3 -1 resourceldapkio.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1062059