6.0.0-beta1
8/12/25

[#6518] Possible format failure in dn (export in ldif)
Summary Possible format failure in dn (export in ldif)
Queue Turba
Queue Version 2.2-RC3
Type Bug
State Resolved
Priority 1. Low
Owners selsky (at) columbia (dot) edu
Requester herbert (at) linuxhacker (dot) at
Created 03/22/2008 (6352 days ago)
Due
Updated 03/23/2008 (6351 days ago)
Assigned 03/22/2008 (6352 days ago)
Resolved 03/23/2008 (6351 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
03/23/2008 07:41:49 AM Matt Selsky Comment #3
Assigned to Matt Selsky
State ⇒ Resolved
Reply to this comment
The whole DN should be base64-encoded, not just part of it.



There were a few problems with that patch.  Try this instead:



http://lists.horde.org/archives/cvs/Week-of-Mon-20080317/076541.html



My fix will be in Turba 2.2rc4.
03/22/2008 03:23:29 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
Can you please say why you think that, or point to a spec or something?
03/22/2008 02:33:34 PM herbert (at) linuxhacker (dot) at Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Turba
Summary ⇒ Possible format failure in dn (export in ldif)
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
If the name containing an Umlaut, then the exported ldif data looks like:



     dn: cn=SGVyYmVydCBNw7xzdGVybWFubg==,mail=herbert@linuxhacker.at



I think, it should be:



   dn:: Y249SGVyYmVydCBNw7xzdGVybWFubmhlcmJlcnRAbGludXhoYWNrZXIuYXQ=



This patch works for me:



--- lib/Data/ldif.php.orig1     2008-03-22 13:24:49.000000000 +0100

+++ lib/Data/ldif.php   2008-03-22 13:55:50.000000000 +0100

@@ -192,26 +192,20 @@

                      // Store cn and mail separately for use in record dn

                      if 
(!$this->_is_safe_string($row[$mozillaTurbaMap[$value]])) {

                          $recordData .= $value . ':: ' . 
base64_encode($row[$mozillaTurbaMap[$value]]) ."\n";

-                        if ($value == 'cn') {

-                            $recordCn = 
base64_encode($row[$mozillaTurbaMap[$value]]);

-                        }

-                        if ($value == 'mail') {

-                            $recordMail = 
base64_encode($row[$mozillaTurbaMap[$value]]);

-                        }

                      } else {

                          $recordData .= $value . ': ' . 
$row[$mozillaTurbaMap[$value]] ."\n";

-                        if ($value == 'cn') {

-                            $recordCn = $row[$mozillaTurbaMap[$value]];

-                        }

-                        if ($value == 'mail') {

-                            $recordMail = $row[$mozillaTurbaMap[$value]];

-                        }

                      }

                  }

              }



-            $export .= 'dn: cn=' . $recordCn . ',mail=' . $recordMail . "\n"

-                . "objectclass: top\n"

+            $dn = 'cn=' .  $row[$mozillaTurbaMap['cn']] .   
$row[$mozillaTurbaMap['mail']];

+           if (!($this->_is_safe_string($row[$mozillaTurbaMap['cn']]) &&

+               $this->_is_safe_string($row[$mozillaTurbaMap['cn']]))) {

+               $export .= 'dn:: ' . base64_encode($dn) . "\n";

+           } else {

+               $export .= 'dn: ' . $dn  . "\n";

+            }

+           $export .= "objectclass: top\n"

                  . "objectclass: person\n"

                  . "objectclass: organizationalPerson\n"

                  . "objectclass: inetOrgPerson\n"




Saved Queries