On 24 Jan 2008, at 12:58, Anniyka Wandersmann wrote:
Hello together,
I try to modify the value of an attribute. This attribute is has
multiple
values.
the following code is what i do:
----------- snip ----------
$ldap = Net::LDAP->new ( $ldaphost ) or die "$@";
$mesg = $ldap->bind ( "$ldapuser",
password => "$ldappassword",
version => 3);
foreach $tmp (keys %add) {
$entry = $ldap -> modify ( "$tmp",
add=> [ 'member' => $username ] );
}
foreach $tmp (keys %del) {
$entry = $ldap -> modify ( "$tmp",
delete=> [ 'member' =>
$username ] );
}
$entry->code && warn "failed to add entry: ", $entry->error ;
$mesg = $ldap->unbind;
----------- /snip ----------
Well, the part with modify/add is working correctly
but if i want to modify/delete the same part again i get the
following error:
failed to add entry: 00000057: LdapErr: DSID-0C090A85, comment:
Error in
attribute conversion operation, data 0, vece^@ at zzlib-html.pl line
445,
<DATA> line 228.
What's the value of $entry->code when the modify fails? The value of
$entry->error is unstructured text that servers /may/ send back, but
isn't guaranteed to contain anything useful.
I also note you aren't getting the result for *each* modify operation,
you're just showing the result of the last one. If you move your test
against $entry->code inside each loop you should find exactly which
change is causing the problem.
Similarly, you should check $mesg->code after doing the bind.
the ^@ is not ascii but seems to by some control character.
Are you certain there are no strange keys in %add and %del?
$tmp by the way is not 0 but:
CN=XXX-NEWS-XXX,OU=XXX-XXX,OU=DXXX,OU=XXXXX,DC=XXX,DC=XXX,DC=de
and also $username is not empty either.
Well, at least without the X ;), but it is the correct DN where
$username,
and the DN of $username is also correct, should be remove out of
$tmp (i
got it by a print, well, data there is definitivly no empty data
or could it be that the error occures if "members" would be empty?
LDAPv3 will delete the whole attribute if you delete all its values,
but maybe your server vendor didn't read that bit of the spec. The
actual error code will give more of a precise indication what the
server thinks the problem is.
Cheers,
Chris