Changeset 584 for LATMOS-Accounts


Ignore:
Timestamp:
01/12/10 19:05:48 (15 years ago)
Author:
nanardon
Message:
  • add function to check password over cracklib
Location:
LATMOS-Accounts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/Makefile.PL

    r578 r584  
    2020        'POD::Usage' => undef, 
    2121        'Unicode::String' => undef, 
     22        'Crypt::Cracklib' => undef, 
    2223    }, # e.g., Module::Name => 1.1 
    2324    ($] >= 5.005 ?     ## Add these new keywords supported since 5.005 
  • LATMOS-Accounts/bin/la-passwd

    r457 r584  
    1616    la-passwd [options] userid 
    1717 
     18=head1 OPTIONS 
     19 
     20=over 4 
     21 
     22=item -t --test 
     23 
     24Don't change password but check it validity using CrackLib. 
     25 
     26=back 
     27 
    1828=cut 
    1929 
     
    2131    'c|config=s' => \my $config, 
    2232    'b|base=s'   => \my $base, 
     33    't|test'     => \my $test, 
    2334    'help'       => sub { pod2usage(0) }, 
    2435) or pod2usage(); 
     
    4051print "\n"; 
    4152 
     53print $obj->check_password($password) . "\n"; 
     54 
     55exit(0)  if($test); 
     56 
    4257if ($obj->set_password($password)) { 
    4358    print "Password succefully changed\n"; 
  • LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Objects.pm

    r504 r584  
    55use warnings; 
    66use LATMOS::Accounts::Log; 
     7use Crypt::Cracklib; 
    78 
    89our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 
     
    307308        return $self->_set_password($clear_pass); 
    308309    } else { 
    309         $self->log(LA_ERROR, "Permission denied for %s to change its password", 
     310        $self->base->log(LA_ERROR, "Permission denied for %s to change its password", 
    310311            $self->id); 
    311312        return; 
     
    323324            "Cannot set password: userPassword attributes is unsupported"); 
    324325    } 
     326} 
     327 
     328sub check_password { 
     329    my ( $self, $password ) = @_; 
     330    my $dictionary; 
     331 
     332    return fascist_check($password, $dictionary); 
    325333} 
    326334 
Note: See TracChangeset for help on using the changeset viewer.