projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NENA2 export: option to combine street suffixes with names, #14049
[freeside.git]
/
bin
/
shadow.reimport
diff --git
a/bin/shadow.reimport
b/bin/shadow.reimport
index
4d112d7
..
7957011
100755
(executable)
--- 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)
# -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);
use strict;
use vars qw(%part_svc);
@@
-14,8
+16,8
@@
use FS::Record qw(qsearch qsearchs);
use FS::svc_acct;
use FS::part_svc;
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("dr
b
");
my $user = shift or die &usage;
adminsuidsetup $user;
my $user = shift or die &usage;
adminsuidsetup $user;
@@
-36,7
+38,7
@@
die "No services with svcdb svc_acct!\n" unless %part_svc;
print "\n\n", &menu_svc, "\n", <<END;
Enter part number or part numbers to import.
END
print "\n\n", &menu_svc, "\n", <<END;
Enter part number or part numbers to import.
END
-my($shell_svcpart)=&get
part
;
+my($shell_svcpart)=&get
value
;
my @shell_svcpart = split(/[,\s]+/, $shell_svcpart);
print "\n\n", <<END;
my @shell_svcpart = split(/[,\s]+/, $shell_svcpart);
print "\n\n", <<END;
@@
-91,7
+93,13
@@
while (<SHADOW>) {
my $svc_acct = shift @svc_acct;
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';
+
+ next if $password eq 'NP' || $password eq '*LK*';
next if $svc_acct->_password eq $password;
next if $svc_acct->_password =~ /^\*SUSPENDED\*/;
next if $svc_acct->_password eq $password;
next if $svc_acct->_password =~ /^\*SUSPENDED\*/;