Closed Bug 5073 Opened 26 years ago Closed 26 years ago

ldap error "no such attribute" after removing and adding an attribute value

Categories

(Directory :: PerLDAP, defect, P1)

Sun
Solaris

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: si, Assigned: leif)

Details

I have a directory entry with the mail attribute with 2 values: mail: one mail: two If I replace one value ("one") with another value ("four"), fails with the "LDAP error: No such attribute" message. The ouput from the simplified script is like follows: Working on mail Doing operation: ab four Doing operation: db two LDAP error: No such attribute error updating But if I replace it with the "three" value (1 letter longer or more), it works !. What's happening ? The simplified script follows: (i've replaced the connection settings with X) #!/usr/bin/perl -w use Mozilla::LDAP::Conn; use Mozilla::LDAP::Utils; $LDAP_DEBUG=1; $user = "xxx"; $hostname = "xxx.xxx.xxx"; $port = "NNN"; $bind = "cn=Directory Manager, o=XXXXX, c=XXX"; $pswd = "XXXX"; $conn = new Mozilla::LDAP::Conn($hostname,$port,$bind,$pswd,""); die "can't connect to LDAP server" unless $conn; $base = "o=XXXXX,c=XXX"; $entry = $conn->search($base, "subtree", "cn=$user", 0, ("mail")); if (!$entry) { print "$user does not exist.\n"; exit; } $old_email = "two"; $new_email = "four"; if ($entry->hasValue("mail", $old_email, 1)) { if (!$entry->removeValue("mail", $old_email)) { print "Error removing $old_email\n"; } if (!$entry->addValue("mail", $new_email)) { print "Error adding $new_email\n"; } if (!$conn->update($entry)) $conn->printError() if $conn->getErrorCode(); print "error updating\n"; } } else { print "$user does not have mail = $old_email\n"; } $conn->close;
Severity: normal → major
Status: NEW → ASSIGNED
Priority: P3 → P1
What version of PerLDAP are you using here? I changed tons of things in v1.2.2, which might be related to this (but I'm not sure). Can you confirm what version you used, and if the problem is still there in v1.2.2?
Sorry. By mistake I thought i've posted the info. I'm using the Netscape Directory Server, perl 5.005_01, and perldap v1.2.1b (1.2 with patches applied to 1.2.1b). I've tried also perldap.1.2.2 right now, and it has the same behavior.
I am unable to duplicate this bug with 1.2.2, 1.2.1, or 1.2.0 using the supplied script. Leif, can you duplicate this bug? -Kevin
If it could help, the entry to modify in the directory has the following values: dn: cn=frf, ou=est FIB, o=UPCNET, c=ES cn: frf sn: rodriguez dni: 99999999 objectclass: top objectclass: person objectclass: organizationalPerson objectclass: inetOrgPerson objectclass: inetOrgPersonUPCNET mail: one mail: two
Dear si@upcnet.upc.es, There was a major memory problem bug when you perform two operations on the same attribute in the same update (as you are). Would you mind taking a look at bug 10431, applying the patch I posted there to API.xs, and testing to see if this fixes the problem. I think it might! :-) Thanks, -Kevin
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
It works ! Thanks a lot.
You need to log in before you can comment on or make changes to this bug.