From 10841ca8e2ab3824db98113f7149b7743f98645a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Fri, 24 Feb 2017 18:31:30 +0100 Subject: Do not encrypt the empty password (mga#19318) --- USER/USER.xs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/USER/USER.xs b/USER/USER.xs index bb11612..086580b 100644 --- a/USER/USER.xs +++ b/USER/USER.xs @@ -206,7 +206,8 @@ Admin_UserSetPass(self, ent, userPasswd) char *userPasswd PPCODE: USER__ERR *error = NULL; - gboolean crypted = FALSE; + /* If no password is set, do not encrypt the empty string. (mga#19318) */ + gboolean crypted = (strlen(userPasswd) == 0) ? TRUE : FALSE; if (lu_user_setpass(self, ent, userPasswd, crypted, &error) == FALSE) { croak(_("Failed to set password: '%s'.\n"), error ? error->string : _("unknown error")); if (error) { lu_error_free(&error); } -- cgit v1.2.1