From a1292232a7f68e77f9db52eb5360a788ed9ac243 Mon Sep 17 00:00:00 2001 From: Illia Chub Date: Tue, 12 Oct 2021 11:22:40 +0300 Subject: [PATCH] Rewritten password hashing logic --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 26a1934..620623f 100755 --- a/main.py +++ b/main.py @@ -72,7 +72,7 @@ def upgradeSystem(): def createUser(): rawPassword = request.headers.get("X-Password") - passwordHashProcessDescriptor = subprocess.Popen(["mkpasswd", "-m", "sha-512", "\"", rawPassword, "\""], shell=True) + passwordHashProcessDescriptor = subprocess.Popen(["mkpasswd -m sha-512 \"" + rawPassword + "\"", shell=True, stdout=subprocess.PIPE, stderr=STDOUT) hashedPassword = passwordHashProcessDescriptor.communicate()[0] hashedPassword = hashedPassword.decode("ascii")