Blob Blame Raw
From db093bf04ca1e42efa543f064d826775edf8c845 Mon Sep 17 00:00:00 2001
Message-Id: <db093bf04ca1e42efa543f064d826775edf8c845.1492299277.git.kevin.kofler@chello.at>
From: Teo Mrnjavac <teo@kde.org>
Date: Tue, 24 Jan 2017 11:24:46 +0100
Subject: [PATCH] Fix issue which disallowed non-Latin1 characters in
 passwords.

Fix issue which disallowed non-Latin1 characters in passwords.
https://github.com/calamares/calamares/commit/20d279a40921992c15e670c86d486985a555cf83

[users] SetPasswordJob: Also encode m_userName in UTF-8, not Latin1.
(Kevin Kofler)
https://github.com/calamares/calamares/commit/97c9a7c6e4f0207959b427ce8e2732051b2f574b
---
 src/modules/users/SetPasswordJob.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/modules/users/SetPasswordJob.cpp b/src/modules/users/SetPasswordJob.cpp
index 5121a76..79b3eeb 100644
--- a/src/modules/users/SetPasswordJob.cpp
+++ b/src/modules/users/SetPasswordJob.cpp
@@ -74,10 +74,9 @@ SetPasswordJob::exec()
     }
 
     QString encrypted = QString::fromLatin1(
-                            crypt( m_newPassword.toLatin1(),
+                            crypt( m_newPassword.toUtf8(),
                                    QString( "$6$%1$" )
-                                .arg( m_userName )
-                                .toLatin1() ) );
+                                .arg( m_userName ).toUtf8() ) );
 
     int ec = CalamaresUtils::System::instance()->
                           targetEnvCall( { "usermod",
-- 
2.9.3