aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--USER/USER.xs3
1 files changed, 2 insertions, 1 deletions
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); }