<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>218353</bug_id>
          
          <creation_ts>2009-12-12 04:04:32 +0000</creation_ts>
          <short_desc>LDAP directory contacts cannot be modified</short_desc>
          <delta_ts>2009-12-13 18:12:45 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kdepimlibs</product>
          <component>kldap</component>
          <version>4.3</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>rdratlos</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>878284</commentid>
    <comment_count>0</comment_count>
    <who name="">rdratlos</who>
    <bug_when>2009-12-12 04:04:32 +0000</bug_when>
    <thetext>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: &apos;value #0 invalid per syntax&apos;. 

kaddressbook uses kdepimlibs for communication with the LDAP server. kdepimlibs use the modify-&gt;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 &lt;attribute name&gt; statement kdepimlibs adds an empty line before end of operation (&apos;-&apos;). 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>878288</commentid>
    <comment_count>1</comment_count>
    <who name="">rdratlos</who>
    <bug_when>2009-12-12 04:18:02 +0000</bug_when>
    <thetext>Correction:
kdepimlibs does not add an empty line but the attribute name without a value. This is not allowed by RFC 2849.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>878289</commentid>
    <comment_count>2</comment_count>
      <attachid>39004</attachid>
    <who name="">rdratlos</who>
    <bug_when>2009-12-12 04:27:15 +0000</bug_when>
    <thetext>Created attachment 39004
Patch for kdepimlibs

proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>878290</commentid>
    <comment_count>3</comment_count>
    <who name="">rdratlos</who>
    <bug_when>2009-12-12 04:28:12 +0000</bug_when>
    <thetext>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&apos;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&apos;ve applied. 

I have not identified further side-effects of this patch. But I recommed some further testing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879072</commentid>
    <comment_count>4</comment_count>
    <who name="Allen Winter">winter</who>
    <bug_when>2009-12-13 16:20:07 +0000</bug_when>
    <thetext>SVN commit 1062016 by winterz:

Fix &quot;LDAP directory contents cannot be modified&quot;
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&amp;revision=1062016</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879126</commentid>
    <comment_count>5</comment_count>
    <who name="Allen Winter">winter</who>
    <bug_when>2009-12-13 18:12:45 +0000</bug_when>
    <thetext>SVN commit 1062059 by winterz:

Backport r1062016 by winterz from trunk to the 4.3 branch:

Fix &quot;LDAP directory contents cannot be modified&quot;
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&amp;revision=1062059</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>39004</attachid>
            <date>2009-12-12 04:27:15 +0000</date>
            <delta_ts>2009-12-12 04:27:15 +0000</delta_ts>
            <desc>Patch for kdepimlibs</desc>
            <filename>kdepimlibs-4.3.2.patch</filename>
            <type>text/plain</type>
            <size>540</size>
            <attacher>rdratlos</attacher>
            
              <data encoding="base64">LS0tIGtkZXBpbWxpYnMtNC4zLjIub3JpZy9rYWJjL3BsdWdpbnMvbGRhcGtpby9yZXNvdXJjZWxk
YXBraW8uY3BwCTIwMDktMDItMTggMTc6Mjg6MzIuMDAwMDAwMDAwICswMTAwCisrKyBrZGVwaW1s
aWJzLTQuMy4yL2thYmMvcGx1Z2lucy9sZGFwa2lvL3Jlc291cmNlbGRhcGtpby5jcHAJMjAwOS0x
Mi0xMSAwOToxMDowMy4wMDAwMDAwMDAgKzAxMDAKQEAgLTIxNiw3ICsyMTYsOSBAQAogICAgIGlm
ICggbW9kICkgewogICAgICAgdG1wICs9IEtMREFQOjpMZGlmOjphc3NlbWJsZUxpbmUoIFFMYXRp
bjFTdHJpbmcoICJyZXBsYWNlIiApLCBhdHRyICkgKyAnXG4nOwogICAgIH0KLSAgICB0bXAgKz0g
S0xEQVA6OkxkaWY6OmFzc2VtYmxlTGluZSggYXR0ciwgdmFsdWUgKSArICdcbic7CisgICAgaWYg
KCAhdmFsdWUuaXNFbXB0eSgpICkgeworICAgICAgdG1wICs9IEtMREFQOjpMZGlmOjphc3NlbWJs
ZUxpbmUoIGF0dHIsIHZhbHVlICkgKyAnXG4nOworICAgIH0gIAogICAgIGlmICggbW9kICkgewog
ICAgICAgdG1wICs9ICItXG4iOwogICAgIH0K
</data>

          </attachment>
      

    </bug>

</bugzilla>