]> git.proxmox.com Git - pve-container.git/commitdiff
use SHA-512 for container passwords
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 21 Jun 2018 12:14:28 +0000 (14:14 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 21 Aug 2018 08:02:27 +0000 (10:02 +0200)
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@proxmox.com>
src/PVE/LXC/Setup/Base.pm

index 9b1cf124ecac80c09b5e835e10e8162e5bf6a82b..2b777adb17a89f8a2037f087588f10a05660d422 100644 (file)
@@ -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 = '*';