From b6c9631f9b0fcff878e7286e0925dddf7717080d Mon Sep 17 00:00:00 2001 From: "mahlon@laika.com" Date: Tue, 3 Dec 2013 18:13:23 +0000 Subject: [PATCH] Fix the DN regexp to include dashes. Patch from Mike Hix . FossilOrigin-Name: 2d137c4b6c7a0ddb8c901a5c840b5653d01fc0dedd71d48f9cd05dac95a770a2 --- shelldap | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shelldap b/shelldap index 11da145..50ada56 100755 --- a/shelldap +++ b/shelldap @@ -1290,7 +1290,7 @@ sub run_copy # see if we're copying the entry to a nonexistent path # 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 unless ( $self->is_valid_dn( $new_dn ) ) { print "Invalid destination.\n"; @@ -1300,7 +1300,7 @@ sub run_copy else { # relative $new_dn = $self->base(); } - $old_dn = $1 if $s_dn =~ /^[\w=]+,(.*)$/; + $old_dn = $1 if $s_dn =~ /^[\-\w=]+,(.*)$/; # get the source entry object my $e = ${ $s->{'entries'} }[0]; @@ -1314,7 +1314,7 @@ sub run_copy # perhaps there is a better way to do this...? # my ( $uniqkey, $uniqval ) = ( $1, $2 ) - if $d_dn =~ /^([\.\w\-]+)(?:\s+)?=(?:\s+)?([\.\-\s\w]+),?/; + if $d_dn =~ /^([\-\.\w]+)(?:\s+)?=(?:\s+)?([\-\.\s\w]+),?/; unless ( $uniqkey && $uniqval ) { print "Unable to parse unique values from RDN.\n"; return; @@ -1948,8 +1948,8 @@ sub run_move # see if we're moving the entry to a totally new path my ( $new_dn, $old_dn ); - ( $d_dn, $new_dn ) = ( $1, $2 ) if $d_dn =~ /^([\w=]+),(.*)$/; - $old_dn = $1 if $s_dn =~ /^[\w=]+,(.*)$/; + ( $d_dn, $new_dn ) = ( $1, $2 ) if $d_dn =~ /^([\-\w=]+),(.*)$/; + $old_dn = $1 if $s_dn =~ /^[\-\w=]+,(.*)$/; my $moddn = sub { return $self->ldap()->moddn(