Fix the DN regexp to include dashes. Patch from Mike Hix <m@hix.io>.
FossilOrigin-Name: 2d137c4b6c7a0ddb8c901a5c840b5653d01fc0dedd71d48f9cd05dac95a770a2
This commit is contained in:
parent
85f71470f9
commit
b6c9631f9b
1 changed files with 5 additions and 5 deletions
10
shelldap
10
shelldap
|
|
@ -1290,7 +1290,7 @@ sub run_copy
|
||||||
# see if we're copying the entry to a nonexistent path
|
# see if we're copying the entry to a nonexistent path
|
||||||
#
|
#
|
||||||
my ( $new_dn, $old_dn );
|
my ( $new_dn, $old_dn );
|
||||||
( $d_dn, $new_dn ) = ( $1, $2 ) if $d_dn =~ /^([\w=]+),(.*)$/;
|
( $d_dn, $new_dn ) = ( $1, $2 ) if $d_dn =~ /^([\-\w=]+),(.*)$/;
|
||||||
if ( $new_dn ) { # absolute
|
if ( $new_dn ) { # absolute
|
||||||
unless ( $self->is_valid_dn( $new_dn ) ) {
|
unless ( $self->is_valid_dn( $new_dn ) ) {
|
||||||
print "Invalid destination.\n";
|
print "Invalid destination.\n";
|
||||||
|
|
@ -1300,7 +1300,7 @@ sub run_copy
|
||||||
else { # relative
|
else { # relative
|
||||||
$new_dn = $self->base();
|
$new_dn = $self->base();
|
||||||
}
|
}
|
||||||
$old_dn = $1 if $s_dn =~ /^[\w=]+,(.*)$/;
|
$old_dn = $1 if $s_dn =~ /^[\-\w=]+,(.*)$/;
|
||||||
|
|
||||||
# get the source entry object
|
# get the source entry object
|
||||||
my $e = ${ $s->{'entries'} }[0];
|
my $e = ${ $s->{'entries'} }[0];
|
||||||
|
|
@ -1314,7 +1314,7 @@ sub run_copy
|
||||||
# perhaps there is a better way to do this...?
|
# perhaps there is a better way to do this...?
|
||||||
#
|
#
|
||||||
my ( $uniqkey, $uniqval ) = ( $1, $2 )
|
my ( $uniqkey, $uniqval ) = ( $1, $2 )
|
||||||
if $d_dn =~ /^([\.\w\-]+)(?:\s+)?=(?:\s+)?([\.\-\s\w]+),?/;
|
if $d_dn =~ /^([\-\.\w]+)(?:\s+)?=(?:\s+)?([\-\.\s\w]+),?/;
|
||||||
unless ( $uniqkey && $uniqval ) {
|
unless ( $uniqkey && $uniqval ) {
|
||||||
print "Unable to parse unique values from RDN.\n";
|
print "Unable to parse unique values from RDN.\n";
|
||||||
return;
|
return;
|
||||||
|
|
@ -1948,8 +1948,8 @@ sub run_move
|
||||||
|
|
||||||
# see if we're moving the entry to a totally new path
|
# see if we're moving the entry to a totally new path
|
||||||
my ( $new_dn, $old_dn );
|
my ( $new_dn, $old_dn );
|
||||||
( $d_dn, $new_dn ) = ( $1, $2 ) if $d_dn =~ /^([\w=]+),(.*)$/;
|
( $d_dn, $new_dn ) = ( $1, $2 ) if $d_dn =~ /^([\-\w=]+),(.*)$/;
|
||||||
$old_dn = $1 if $s_dn =~ /^[\w=]+,(.*)$/;
|
$old_dn = $1 if $s_dn =~ /^[\-\w=]+,(.*)$/;
|
||||||
|
|
||||||
my $moddn = sub {
|
my $moddn = sub {
|
||||||
return $self->ldap()->moddn(
|
return $self->ldap()->moddn(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue