You cannot just pass the entry to modify, you need to call update
as a method on the entry. This is because the LDIF entry can be more than
just a modify command. So change it to
$r = $entry->update( $ldap );
Graham.
On Tue, Mar 26, 2002 at 03:08:02PM -0500, CZa...@wi... wrote:
> Hello, can anyone help with the LDIF class.
>
> I'm am reading a ldif file and trying to place the contents into a DB, but
> I am getting errors and the modify updates are not
> being applied to the LDAP service.
>
>
> ERROR Message:
> modifytimestamp attribute has duplicate value. VALUE: at ldif_modify.pl
> line 20, <GEN1> chunk 1.
>
> CODE:
> #!/usr/bin/perl -w
>
> use Net::LDAP qw(:all);
> use Net::LDAP::Util qw(ldap_error_desc);
> use Net::LDAP::LDIF;
>
>
> $ldap = Net::LDAP->new('server.xyz.com', port => '389') || die
> "ERROR: $@";
> $ldif = Net::LDAP::LDIF->new("out.ldif", "r") || die "$@";
>
>
> while ( $entry = $ldif->read_entry ) {
>
> $r = $ldap->modify( $entry );
> if ($r->code) {
> warn $entry->dn,"; ",$r->error;
> } else {
> printf "%s\n",ldap_error_desc($r->code);
> }
> }
>
|