Changeset 434


Ignore:
Timestamp:
09/07/09 13:01:01 (15 years ago)
Author:
nanardon
Message:
  • la-crypt-passwd kill show option and make it default action
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/bin/la-crypt-passwd

    r413 r434  
    1515=head1 SYNOPSIS 
    1616 
    17     la-crypt [--genkey|--regen] [--show] [--set BASE] 
     17    la-crypt [--genkey|--regen] [-m] [--set BASE] 
    1818 
    1919=cut 
     
    2525    'genkey'     => \my $genkey, 
    2626    'regen'      => \my $regen, 
    27     'show'       => \my $show, 
    2827    'set=s'      => \my $set, 
    2928) or pod2usage(); 
     
    4746Like --genkey but a new key will replace the current one if already present. 
    4847Stored password will be read and encrypted again using the new key. 
    49  
    50 =item --show 
    51  
    52 Show for each user the password in clear form. 
    5348 
    5449=item --set BASE 
     
    9388} 
    9489 
    95 if ($show) { 
    96     if ($LA->_base->get_global_value('rsa_private_key')) { 
    97         my $clearpasswd = get_clear_password(); 
    98         foreach (keys %$clearpasswd) { 
    99             printf("%s: %s\n", $_, $clearpasswd->{$_}); 
    100         } 
    101     } else { 
    102         warn "No rsa key found in database\n"; 
    103     } 
    104 } 
    10590if ($set) { 
    10691    if (!$LA->_base->get_global_value('rsa_private_key')) { 
     
    118103    } 
    119104    $destbase->commit; 
    120 } 
    121  
    122  
    123 if ($regen || $genkey) { 
     105} elsif ($regen || $genkey) { 
    124106    if ($LA->_base->get_global_value('rsa_private_key') && !$regen) { 
    125107        die <<EOF; 
     
    145127    } 
    146128    $base->commit; 
     129} else { 
     130    if ($LA->_base->get_global_value('rsa_private_key')) { 
     131        my $clearpasswd = get_clear_password(); 
     132        foreach (keys %$clearpasswd) { 
     133            printf("%s: %s\n", $_, $clearpasswd->{$_}); 
     134        } 
     135    } else { 
     136        warn "No rsa key found in database\n"; 
     137    } 
    147138} 
Note: See TracChangeset for help on using the changeset viewer.