summaryrefslogtreecommitdiff
path: root/FS/FS/part_export/shellcommands.pm
diff options
context:
space:
mode:
authorivan <ivan>2004-03-18 22:32:02 +0000
committerivan <ivan>2004-03-18 22:32:02 +0000
commitb0011320cc2c33233ee694c61903667d2d3d8e5b (patch)
treea07dde71ca8c041cece3deb4845d8de06d4c2abe /FS/FS/part_export/shellcommands.pm
parent3b7030c2c7464c2a1b409cdc22fad4a593d4f231 (diff)
don't re-encrypt password on replace also
Diffstat (limited to 'FS/FS/part_export/shellcommands.pm')
-rw-r--r--FS/FS/part_export/shellcommands.pm20
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 ) {