From d1688630a1f43fcd0e780d98556282de3e756f6a Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 27 Nov 2006 01:08:47 +0000 Subject: [PATCH] some svc_acct.pm fixes for s1 --- FS/FS/svc_acct.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index c301b87ec..98564cce2 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -870,7 +870,7 @@ sub check { unless ( $recref->{_password} ); #if ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([^\t\n]{4,16})$/ ) { - if ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([^\t\n]{$passwordmin,$passwordmax})$/ ) { + if ( $recref->{_password} =~ /^((\*SUSPENDED\* |!!?)?)([^\t\n]{$passwordmin,$passwordmax})$/ ) { $recref->{_password} = $1.$3; #uncomment this to encrypt password immediately upon entry, or run #bin/crypt_pw in cron to give new users a window during which their @@ -879,7 +879,7 @@ sub check { #$recref->{password} = $1. # crypt($3,$saltset[int(rand(64))].$saltset[int(rand(64))] #; - } elsif ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([\w\.\/\$\;\+]{13,60})$/ ) { + } elsif ( $recref->{_password} =~ /^((\*SUSPENDED\* |!!?)?)([\w\.\/\$\;\+]{13,64})$/ ) { $recref->{_password} = $1.$3; } elsif ( $recref->{_password} eq '*' ) { $recref->{_password} = '*'; @@ -1579,6 +1579,10 @@ sub ldap_password { } elsif ( $self->_password =~ /^\$2a?\$(.*)$/ ) { #Blowfish die "Blowfish encryption not supported in this context, svcnum ". $self->svcnum. "\n"; + } elsif ( $self->_password =~ /^(\w{48})$/ ) { #LDAP SSHA + return '{SSHA}'. $1; + } elsif ( $self->_password =~ /^(\w{64})$/ ) { #LDAP NS-MTA-MD5 + return '{NS-MTA-MD5}'. $1; } else { #plaintext return '{PLAIN}'. $self->_password; #my $encryption = ( scalar(@_) && $_[0] ) ? shift : 'crypt'; -- 2.11.0