# HG changeset patch # User Mahlon E. Smith # Date 1386094404 28800 # Node ID f90f7ff0b146561a10f69d0d20deccb8f4bfb3ce # Parent 5b122351067ca12c890dd8b4ef0b8de5668994c9 Fix the DN regexp to include dashes. Patch from Mike Hix . diff -r 5b122351067c -r f90f7ff0b146 shelldap --- a/shelldap Wed May 15 12:18:54 2013 -0700 +++ b/shelldap Tue Dec 03 10:13:24 2013 -0800 @@ -1290,7 +1290,7 @@ # 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 @@ 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 @@ # 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 @@ # 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(