[pve-devel] [PATCH container 3/3] use SHA-512 for container passwords

Dominik Csapak d.csapak at proxmox.com
Thu Jun 21 14:14:28 CEST 2018


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 <d.csapak at proxmox.com>
---
 src/PVE/LXC/Setup/Base.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Setup/Base.pm b/src/PVE/LXC/Setup/Base.pm
index ab872a5..628ffeb 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 = '*';
-- 
2.11.0





More information about the pve-devel mailing list