My first post in the forum, if something is wrong or incomplete please say.
I am trying to add an entry to openldap using the lib Paddle. But when the user name contain some special character the request fail, pointing a syntax error in sn.
Maybe I am making something wrong but when I try to add this entry
[
objectClass: ["top", "person", "inetOrgPerson"],
cn: "rodrigo+1@email",
sn: "Rodrigo Rebouças",
displayName: "Rodrigo Rebouças",
uid: "na",
mail: "rodrigo+1@email",
userPassword: 123
]
I receive:
14:47:07.844 [debug] add request = {'AddRequest',
"cn=rodrigo\\+1@email,ou=users,ou=opengalaxy,dc=opengalaxy",
[{'AddRequest_attributes',"objectClass",
["top","person","inetOrgPerson"]},
{'AddRequest_attributes',"cn",["rodrigo+1@email"]},
{'AddRequest_attributes',"sn",["Rodrigo Rebouças"]},
{'AddRequest_attributes',"displayName",
["Rodrigo Rebouças"]},
{'AddRequest_attributes',"uid",["na"]},
{'AddRequest_attributes',"mail",["rodrigo+1@email"]},
{'AddRequest_attributes',"userPassword",["123"]}]}
14:47:07.845 [debug] add reply = {ok,{'LDAPMessage',2,
{addResponse,
{'LDAPResult',invalidAttributeSyntax,[],
"sn: value #0 invalid per syntax",asn1_NOVALUE}},
asn1_NOVALUE}}
Alas, to make it clear when I just change ç
for c
in the sn
parameter:
[
objectClass: ["top", "person", "inetOrgPerson"],
cn: "rogen@email",
sn: "Rodrigo Reboucas",
displayName: "Rodrigo Reboucas",
uid: "na",
mail: "rogen@email",
userPassword: 123
]
Everything runs fine:
14:50:31.698 [debug] add request = {'AddRequest',
"cn=rogen@email,ou=users,ou=opengalaxy,dc=opengalaxy",
[{'AddRequest_attributes',"objectClass",
["top","person","inetOrgPerson"]},
{'AddRequest_attributes',"cn",["rogen@email"]},
{'AddRequest_attributes',"sn",["Rodrigo Reboucas"]},
{'AddRequest_attributes',"displayName",
["Rodrigo Reboucas"]},
{'AddRequest_attributes',"uid",["na"]},
{'AddRequest_attributes',"mail",["rogen@email"]},
{'AddRequest_attributes',"userPassword",["123"]}]}
14:50:31.703 [debug] add reply = {ok,{'LDAPMessage',2,
{addResponse,{'LDAPResult',success,[],[],asn1_NOVALUE}},
asn1_NOVALUE}}
Sounds like encoding to me or if I done something wrong please tell me, thanks!!