Hello Peter, list subscribers,
Sorry for the delay in getting back to this.
It still doesn't work:
Peter Marschall wrote:
Hi,
On Tuesday, 24. April 2007 10:12, Rudy Gevaert wrote:
Hi,
I'm trying to change the dn of an ldap entry:
my $result = $ldaps->search( base => "${base}",
filter => "(umMailUid=${old_mailUid})",
my $entry = $result->pop_entry;
$entry->changetype('modrdn');
$entry->add(newrdn => "umMailUid=${new_mailUid}");
$result = $entry->update($ldaps);
But I get this error:
[Ldap] No DN specified
You get this error because you did not specify the value for
deleteoldrdn, which AFAICT is required for the moddn or modrdn
operations.
Since you did not specify it, I guess you wanted it to be 0.
Inserting
$entry->add(deleteoldrdn => 0)
before the line doing the update does the trick.
I have had a look at the code and found a little inconsistency
with the current version.
While $ldap->update() works without requiring deleteoldrnd
(it assumes it to be 0 in this case), $entry->update()
currently fails horribly.
I put
$entry->changetype('moddn');
$entry->add(newrdn => "umMailUid=${new_mailUid}");
$entry->add(deleteoldrdn => 0);
$result = $entry->update($ldaps);
in my script. But now I get: "attribute 'umMailUid' cannot have
multiple values"
Any idea what's wrong? umMailUid isn't allow to have multiple values
(ldap structure), but I can't see where I'm defining multiple values for
that attribute.
Thanks in advance,
Rudy
The reason for this is that $entry->update() requests the
attributes in list context in order to build a list that
eventually becomes a hash in the called functions.
When the attribute does not exist, an empty list is returned,
making the hash-detection get mis-aligned and thus crete
the error above.
A fix has just been committed to SVN.
Regards
Peter
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Rudy Gevaert [EMAIL PROTECTED] tel:+32 9 264 4734
Directie ICT, afd. Infrastructuur ICT Department, Infrastructure office
Groep Systemen Systems group
Universiteit Gent Ghent University
Krijgslaan 281, gebouw S9, 9000 Gent, Belgie www.UGent.be
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --