diff options
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/part_export/shellcommands.pm | 20 | 
1 files changed, 15 insertions, 5 deletions
| diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm index a4eb0a052..1eb0d8367 100644 --- a/FS/FS/part_export/shellcommands.pm +++ b/FS/FS/part_export/shellcommands.pm @@ -65,8 +65,10 @@ sub _export_command {         || $svc_acct->_password =~ /^\$(1|2a?)\$/ ) {      $crypt_password = $svc_acct->_password;    } else { -    $crypt_password = crypt( $svc_acct->_password, -                             $saltset[int(rand(64))].$saltset[int(rand(64))] ); +    $crypt_password = crypt( +      $svc_acct->_password, +      $saltset[int(rand(64))].$saltset[int(rand(64))] +    );    }    $self->shellcommands_queue( $svc_acct->svcnum, @@ -92,9 +94,17 @@ sub _export_replace {    $new_quoted_password = shell_quote $new__password; #new, better?    $old_domain = $old->domain;    $new_domain = $new->domain; -  $new_crypt_password = ''; #surpress "used only once" warnings -  $new_crypt_password = crypt( $new->_password, -                               $saltset[int(rand(64))].$saltset[int(rand(64))]); + +  #eventuall should check a "password-encoding" field +  if ( length($new->_password) == 13 +       || $new->_password =~ /^\$(1|2a?)\$/ ) { +    $new_crypt_password = $new->_password; +  } else { +    $new_crypt_password = +      crypt( $new->_password, $saltset[int(rand(64))].$saltset[int(rand(64))] +    ); +  } +    if ( $self->option('usermod_pwonly') ) {      my $error = '';      if ( $old_username ne $new_username ) { | 
