diff --git a/directory/perldap/Conn.pm b/directory/perldap/Conn.pm index 4ce3f3a1b513..aa2af47a364a 100644 --- a/directory/perldap/Conn.pm +++ b/directory/perldap/Conn.pm @@ -1,5 +1,5 @@ ############################################################################# -# $Id: Conn.pm,v 1.11 1998/08/03 06:58:01 leif Exp $ +# $Id: Conn.pm,v 1.12 1998/08/03 07:50:54 leif Exp $ # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in @@ -385,20 +385,22 @@ sub add ############################################################################# -# Modify the RDN, and update the entry accordingly +# Modify the RDN, and update the entry accordingly. Note that the last +# two arguments (DN and "delete") are optional. # sub modifyRDN { - my ($self, $rdn, $del) = ($_[$[], lc $_[$[ + 1], $_[$[ + 2]); + my ($self, $rdn, $dn, $del) = ($_[$[], lc $_[$[ + 1], lc $_[$[ + 2], $_[$[ + 3]); my (@vals); my $ret = 1; $del = 1 if ($del eq ""); + $dn = $self->{dn} if ($dn eq ""); - @vals = ldap_explode_dn(lc $self->{dn}, 0); + @vals = ldap_explode_dn(lc $dn, 0); if ($vals[$[] ne $rdn) { - $ret = ldap_modrdn2_s($self->{ld}, $self->{dn}, $rdn, $del); + $ret = ldap_modrdn2_s($self->{ld}, $dn, $rdn, $del); if ($ret == LDAP_SUCCESS) { shift(@vals);