Closed Bug 1383 Opened 26 years ago Closed 26 years ago

Problem adding an entry, schema violation

Categories

(Directory :: LDAP C SDK, defect, P2)

All
Solaris
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: leif, Assigned: leif)

Details

From: Paul-Emile Bellaloum <pebellaloum@atos-group.com> 'm working with th PerLDAP module and I find it very useful to make some treatments on LDAP server. However, I have one problem : I can't manage to add an entry. In fact, my code is as belows : $entry = new Mozilla::LDAP::Entry(); $entry->setDN($dn); $entry->{objectclass} = ["top","person","organizationalPerson","inetOrgPerson","AtosPerson","MailRecipient"]; $entry->addValue("cn",$cn); $entry->addValue("sn",$name); $entry->addValue("givenname",$given_name); $entry->addValue("uid",$uid); $entry->addValue("codeAccount",$codeaccount); $entry->addValue("userpassword",$password); $entry->addValue("sysorg",$sysorg); $entry->addValue("org1",$org1); $entry->addValue("org2",$org2); $entry->addValue("org3",$org3); $entry->addValue("org4",$org4); $entry->addValue("mail",$mail); $entry->addValue("mailhost",$mailhost); $entry->addValue("routingaddress",$routing); $entry->addValue("site",$site); $entry->addValue("postalCode",$cp); $entry->addValue("l",$ville); $entry->addValue("street",$voie); $entry->addValue("co",$pays); $entry->addValue("telephonenumber",$phone); $entry->addValue("facsimiletelelephonenumber",$fax); $conn->add($entry); unfortunately, it does not work! I have an error code 65 (LDAP_OBJECTCLASS_VIOLATION). But if I try the same with the ldapmodify utility like this : ldapmodify -D "uid=admin,o=atos" -w admin -f essai where the file essai contains the following : dn : uid=jbellalo,ou=infogerance,o=atos changetype:add mailhost: euler sn: Bellaloum codeaccount: ZGCMOO telephonenumber: (33) 1 39 86 6253 objectclass: top objectclass: person objectclass: organizationalPerson objectclass: inetOrgPerson objectclass: AtosPerson objectclass: MailRecipient postalcode: 92150 site: Suresnes street: 1 rue salomon de Rothschild givenname: Jacques uid: jbellalo mail: jbellaloum@atos-group.com sysorg: Infogerance facsimiletelephonenumber: (33) 1 39 85 1162 l: Suresnes routingaddress: jbellalo@euler.production.axime.fr cn: Bellaloum Jacques userpassword: jacky org1: Atos org2: Infogerance org3: Moyen de production org4: ISR IT WORKS! And you can see that the attributes are the same that for the program with PerLDAP. So, I don't understand why I have a problem with the schema violation. I will be grateful if you could help me because I am going mad!!!!! Thanks in advance, Paul-Emile
More from Paul: In fact, I had a problem with the attribute "facsimileTelephoneNumber" (I found it in the error log). It was not allowed (?). However, it is allowed by the InetOrgPerson class, so it must work, doesn't it ? Finally, I used the attribute "fax" instead of "facsimiletelephonenumber" and it...WORKS! I don't really understand... Leif: Could it possibly be something with the length of the attribute name/type???
Priority: P2 → P1
Status: NEW → ASSIGNED
Component: PerLDAP → LDAP C SDK
I am having similar problems with the C sdk. My process takes a large volume of attributes coming from Oracle (use pro C to grab attribute - value pairs), then based on the action (insert, update or delete) which is assigned by the ORacle, I proceed to use the API (ldap_modify_s) to CRUD the matching LDAP attributes for the uid passed to my interface.
Severity: normal → critical
Priority: P1 → P3
Priority: P3 → P2
Setting all current Open Critical and Major to M3
Clearing "M" field since Directory product is not used for 5.0 specific project bug metrics and will mess up our queries on milestones.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
As pointed out by Erik Scrafford (eriks@chilisoft.com), this is most likely a typo/error in the example code. It says $entry->addValue("facsimiletelelephonenumber",$fax); when it really should be $entry->addValue("facsimiletelephonenumber",$fax);
You need to log in before you can comment on or make changes to this bug.