diff src/pst2ldif.cpp @ 108:1b2a4fac1303 stable-0-6-21

fix title bug with old schema in pst2ldif, also escape commas in distinguished names per rfc4514.
author Carl Byington <carl@five-ten-sg.com>
date Tue, 21 Oct 2008 14:37:13 -0700
parents 07d090676ce9
children e213bfcf9aa7
line wrap: on
line diff
--- a/src/pst2ldif.cpp	Sat Oct 11 12:54:24 2008 -0700
+++ b/src/pst2ldif.cpp	Tue Oct 21 14:37:13 2008 -0700
@@ -161,13 +161,13 @@
                                 print_ldif_single("personalTitle", item->contact->job_title);
                             if (item->contact->company_name)
                                 print_ldif_single("company", item->contact->company_name);
+                        }
                         else {
                             // new schema
                             if (item->contact->job_title)
                                 print_ldif_single("title", item->contact->job_title);
                             if (item->contact->company_name)
                                 print_ldif_single("o", item->contact->company_name);
-                            }
                         }
                         if (item->contact->address1  && *item->contact->address1)
                             print_ldif_single("mail", item->contact->address1);
@@ -640,6 +640,7 @@
             printf("objectClass: organization\n\n");
             printf("dn: cn=root, %s\n", ldap_base);
             printf("cn: root\n");
+            printf("sn: root\n");
             for (vector<string>::size_type i=0; i<ldap_class.size(); i++)
                 print_ldif_single("objectClass", ldap_class[i].c_str());
             printf("\n");
@@ -711,8 +712,7 @@
 
     print_escaped_dn(value);
     if (base && base[0]) {
-        printf(",");
-        print_escaped_dn(base);
+        printf(", %s", base);
     }
     printf("\n");
     return;
@@ -763,6 +763,7 @@
             case '\\':
             case '"' :
             case '+' :
+            case ',' :
             case ';' :
             case '<' :
             case '>' :