summaryrefslogtreecommitdiffstats
path: root/rescue/genpasswd
diff options
context:
space:
mode:
authorMaarten Vanraes <alien@mageia.org>2011-10-25 19:16:57 +0000
committerMaarten Vanraes <alien@mageia.org>2011-10-25 19:16:57 +0000
commit38d6a29addb61ce0a632ed38e47655dbdd819aa9 (patch)
treebe8dd4517e3f13490421821e46ed952d0c9326c0 /rescue/genpasswd
parent9733292408917f57f9ce4038dd9916cb6ba68533 (diff)
downloaddrakx-backup-do-not-use-38d6a29addb61ce0a632ed38e47655dbdd819aa9.tar
drakx-backup-do-not-use-38d6a29addb61ce0a632ed38e47655dbdd819aa9.tar.gz
drakx-backup-do-not-use-38d6a29addb61ce0a632ed38e47655dbdd819aa9.tar.bz2
drakx-backup-do-not-use-38d6a29addb61ce0a632ed38e47655dbdd819aa9.tar.xz
drakx-backup-do-not-use-38d6a29addb61ce0a632ed38e47655dbdd819aa9.zip
- pass perl_checker
Diffstat (limited to 'rescue/genpasswd')
-rwxr-xr-xrescue/genpasswd7
1 files changed, 5 insertions, 2 deletions
diff --git a/rescue/genpasswd b/rescue/genpasswd
index b7fe1f660..2f129673d 100755
--- a/rescue/genpasswd
+++ b/rescue/genpasswd
@@ -1,10 +1,13 @@
#!/usr/bin/perl
+use strict;
+
system "stty -echo";
print STDERR "Give a password for ssh access: ";
-chomp($word = <STDIN>);
+chomp(my $word = <STDIN>);
print STDERR "\n";
system "stty echo";
-print crypt($word, join('', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]));
+my @salt = ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64];
+print crypt($word, join('', @salt));
print "\n";