From: Dominik Csapak Date: Thu, 21 Jun 2018 12:14:28 +0000 (+0200) Subject: use SHA-512 for container passwords X-Git-Url: https://git.proxmox.com/?p=pve-container.git;a=commitdiff_plain;h=f55589da9db195e4ab3d2d53cb29a88a4dd10492 use SHA-512 for container passwords this is in glibc since 2.7, centos 6 has 2.12, debian 6 has 2.11, ubuntu 12.04 has 2.15 so all 'old' templates have a version new enough Signed-off-by: Dominik Csapak --- diff --git a/src/PVE/LXC/Setup/Base.pm b/src/PVE/LXC/Setup/Base.pm index 9b1cf12..2b777ad 100644 --- a/src/PVE/LXC/Setup/Base.pm +++ b/src/PVE/LXC/Setup/Base.pm @@ -356,7 +356,7 @@ sub set_user_password { if (defined($opt_password)) { if ($opt_password !~ m/^\$(?:1|2[axy]?|5|6)\$[a-zA-Z0-9.\/]{1,16}\$[a-zA-Z0-9.\/]+$/) { my $time = substr (Digest::SHA::sha1_base64 (time), 0, 8); - $opt_password = crypt(encode("utf8", $opt_password), "\$1\$$time\$"); + $opt_password = crypt(encode("utf8", $opt_password), "\$6\$$time\$"); }; } else { $opt_password = '*';