diff options
| author | ivan <ivan> | 2004-03-18 22:00:26 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2004-03-18 22:00:26 +0000 | 
| commit | b0e831837b25fe2d0cbc506fd419c7fc1d290cf9 (patch) | |
| tree | 3f46937a5611bd9f9c01180442b1ef7edd0e5da0 | |
| parent | d6f99aebb1f8a915b2bfddacbadb6cbbbed75ef0 (diff) | |
add -b option
| -rwxr-xr-x | bin/shadow.reimport | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/bin/shadow.reimport b/bin/shadow.reimport index acf31d362..f5d48d2d9 100755 --- a/bin/shadow.reimport +++ b/bin/shadow.reimport @@ -3,6 +3,8 @@  # -d: dry-run: make no changes  # -r: replace: overwrite existing passwords (otherwise only "*" passwords will  #              be changed) +# -b: blowfish replace: overwrite existing passwords only if they are +#                       blowfish-encrypted  use strict;  use vars qw(%part_svc); @@ -13,8 +15,8 @@ use FS::Record qw(qsearch qsearchs);  use FS::svc_acct;  use FS::part_svc; -use vars qw($opt_d $opt_r); -getopts("dr"); +use vars qw($opt_d $opt_r $opt_b); +getopts("drb");  my $user = shift or die &usage;  adminsuidsetup $user; @@ -90,7 +92,9 @@ while (<SHADOW>) {    my $svc_acct = shift @svc_acct; -  next unless $svc_acct->_password eq '*' || $opt_r; +  next unless    $svc_acct->_password eq '*' +              || $opt_r +              || ( $opt_b && $svc_acct->_password =~ /^\$2a?\$/ );    next if $svc_acct->username eq 'root'; | 
