ldap_add: Invalid syntax (21) – fix

This error was driving me nuts:

ldap_add: Invalid syntax (21)
    additional info: objectClass: value #0 invalid per syntax

despite looking at my ldif a hundred times, until I relized my perl script added white space at the end of the line ….

        print "objectClass: top\n";
    print "objectClass: person \n";
    print "objectClass: organizationalPerson \n";
    print "objectClass: inetOrgPerson \n";
    print "objectClass: mozillaOrgPerson \n";
    print "objectClass: evolutionPerson \n";
    print "objectClass: simpleSecurityObject \n";

once changed to :

       print "objectClass: top\n";
    print "objectClass: person\n";
    print "objectClass: organizationalPerson\n";
    print "objectClass: inetOrgPerson\n";
    print "objectClass: mozillaOrgPerson\n";
    print "objectClass: evolutionPerson\n";
    print "objectClass: simpleSecurityObject\n";

The ldap gods were smiling again, hope this saves someone some time.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>