Frank Offermanns wrote:
This all looks correct. You simply have to correctly parse the LDIF output.
See RFC 2849 for the details. And use a decent LDIF parser for your favourite scripting language and not some home-grown bash/sed/awk/whatever scripts which fail for such a simple thing.
I am not quite sure, if I understand it correctly. I made the ldif using slapcat. Slapcat used to Base64 encode the 1.3.6.1.4.1.1466.115.121.1.5 syntax. Now it doesn't do that anymore. But due to this change slapadd is not able to import this file. So I simply use slapcat and slapadd, but now slapadd fails. I am not using any other tools, only OpenLDAP tools. And if I only use OpenLDAP tools everything should work correctly, shouldn't it? That's why I think there is a bug in slapcat. But if you think slapcat works correctly I could also say: There is a bug in slapadd, because it can't import the ldif generated by slapcat.
Can't reproduce the problem here.
### violino:~/OD/hobj/tests> cat file.ldif dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,dc=example,dc=com changetype: modify replace: userSMIMEcertificate userSMIMEcertificate:< file:file.ldif violino:~/OD/hobj/tests> ../clients/tools/ldapmodify -x -H ldap://:9011 -D cn=manager,dc=example,dc=com -w secret -f file.ldif violino:~/OD/hobj/tests> ../servers/slapd/slapd -Tc -f testrun/slapd.1.conf
... dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,dc=example,dc=com objectClass: OpenLDAPperson cn: Jennifer Smith cn: Jen Smith sn: Smith uid: jen postalAddress: Alumni Association $ 111 Maple St $ Anytown, MI 48109 seeAlso: cn=All Staff,ou=Groups,dc=example,dc=com drink: Sam Adams homePostalAddress: 1000 Maple #44 $ Anytown, MI 48103 title: Telemarketer, UM Alumni Association mail: jen@mail.alumni.example.com homePhone: +1 313 555 2333 pager: +1 313 555 6442 facsimileTelephoneNumber: +1 313 555 2756 telephoneNumber: +1 313 555 8232 structuralObjectClass: OpenLDAPperson entryUUID: 36d5bdb8-d6b8-49c3-a2f3-225ea3b5aee1 creatorsName: cn=Manager,dc=example,dc=com createTimestamp: 20150324065632Z userSMIMECertificate:: ZG46IGNuPUplbm5pZmVyIFNtaXRoLG91PUFsdW1uaSBBc3NvY2lhd GlvbixvdT1QZW9wbGUsZGM9ZXhhbXBsZSxkYz1jb20KY2hhbmdldHlwZTogbW9kaWZ5CnJlcGxh Y2U6IHVzZXJTTUlNRWNlcnRpZmljYXRlCnVzZXJTTUlNRWNlcnRpZmljYXRlOjwgZmlsZTpmaWx lLmxkaWYK entryCSN: 20150505100709.913100Z#000000#000#000000 modifiersName: cn=manager,dc=example,dc=com modifyTimestamp: 20150505100709Z
...