Use SHA512 instead of MD5 to encrypt root password
authoryuhuan.yang <yuhuan.yang@samsung.com>
Wed, 24 Jan 2018 05:22:45 +0000 (13:22 +0800)
committerYang Yuhuan <yuhuan.yang@10.113.136.109>
Mon, 29 Jan 2018 06:13:53 +0000 (06:13 +0000)
Change-Id: I646334220703dedc28b7b1286e28e01ef4c485de
(cherry picked from commit 707754fa61eb4ae452e3af267e14290552122549)

mic/kickstart/__init__.py

index fd2806d..75678ad 100755 (executable)
@@ -265,7 +265,7 @@ class RootPasswordConfig(KickstartConfig):
         p1 = subprocess.Popen(["/bin/echo", "root:%s" %password],
                               stdout = subprocess.PIPE,
                               preexec_fn = self.chroot)
-        p2 = subprocess.Popen(["/usr/sbin/chpasswd", "-m"],
+        p2 = subprocess.Popen(["/usr/sbin/chpasswd", "-c","SHA512"],
                               stdin = p1.stdout,
                               stdout = subprocess.PIPE,
                               preexec_fn = self.chroot)