]> Softwares of Agnibho - librevax.git/commitdiff
Bugfix: userman password update
authorAgnibho Mondal <mondal@agnibho.com>
Thu, 11 Jan 2024 19:29:08 +0000 (00:59 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Thu, 11 Jan 2024 19:29:08 +0000 (00:59 +0530)
userman

diff --git a/userman b/userman
index 4732ef573f78c98ebf8a0c2d951c01aa54df24b8..d06b2267748087dcdc26602879d4969f6978f5d9 100755 (executable)
--- a/userman
+++ b/userman
@@ -35,7 +35,7 @@ try:
             print("Updating user: "+sys.argv[2])
             auth=input("Authorisation (all/none):")
             pwd=getpass()
-            pwd=bcrypt.hashpw(pwd.encode("utf-8"), bcrypt.gensalt())
+            pwd=base64.b64encode(bcrypt.hashpw(pwd.encode("utf-8"), bcrypt.gensalt()))
             cur.execute("UPDATE users SET auth=?, hash=? WHERE user=?", (auth, pwd, sys.argv[2]))
             if(cur.rowcount==0):
                 print("No record to update")