From 2219297afc85d4c96a624696073b5ead8b5bc5c6 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 29 Jul 2021 13:16:33 -0400 Subject: [PATCH] Fix simple password support Simple password was broken during the MFA addition, restore the most common authentication mechanism. --- confluent_server/confluent/pam.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/pam.py b/confluent_server/confluent/pam.py index 24e75db5..ed57fc8a 100644 --- a/confluent_server/confluent/pam.py +++ b/confluent_server/confluent/pam.py @@ -168,7 +168,9 @@ class pam(): currcpassword = c_char_p(currpassword.encode('utf8')) else: currpassword = password - currcpassword = c_char_p(password.encode('utf8')) + if not isinstance(currpassword, bytes): + currpassword = currpassword.encode('utf8') + currcpassword = c_char_p(currpassword) dst = calloc(len(currpassword)+1, sizeof(c_char)) memmove(dst, currcpassword, len(currpassword)) response[i].resp = dst