]> git.proxmox.com Git - pve-container.git/commitdiff
Revert "fix 1153: let crypt() handle unicode CT passwords"
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 2 May 2017 09:46:36 +0000 (11:46 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 2 May 2017 09:46:36 +0000 (11:46 +0200)
This reverts commit cfa3086d95c3a39b584b2d60aa53938e1f30b3dc.

We now corectly encode all parameter as utf8, so the previous
code is now correct.

src/PVE/LXC/Setup/Base.pm

index 8cd72556033f01ada93bbf1ec02bdd3f668d41a0..7bf66ca81d62de49c0b0dd06723dfc3a2ba7479b 100644 (file)
@@ -363,7 +363,7 @@ sub set_user_password {
     if (defined($opt_password)) {
        if ($opt_password !~ m/^\$/) {
            my $time = substr (Digest::SHA::sha1_base64 (time), 0, 8);
-           $opt_password = crypt($opt_password, "\$1\$$time\$");
+           $opt_password = crypt(encode("utf8", $opt_password), "\$1\$$time\$");
        };
     } else {
        $opt_password = '*';