Fix mosquitto_passwd -b not updating passwords for existing users

Closes #1664. Thanks to Leon Kiefer.
pull/1691/head
Roger A. Light 6 years ago
parent 40bad1a999
commit 5908585afd

@ -1,6 +1,9 @@
Broker:
- Report invalid bridge prefix+pattern combinations at config parsing time
rather than letting the bridge fail later. Issue #1635.
- Fix `mosquitto_passwd -b` not updating passwords for existing users
correctly. Creating a new user with `-b` worked without problem.
Closes #1664.
Client library:
- Don't treat an unexpected PUBACK, PUBREL, or PUBCOMP as a fatal error.

@ -337,7 +337,7 @@ static int update_pwuser_cb(FILE *fptr, FILE *ftmp, const char *username, const
}else{
/* Write out a new line for our matching username */
helper->found = true;
rc = output_new_password(ftmp, username, password);
rc = output_new_password(ftmp, username, helper->password);
}
return rc;
}
@ -349,6 +349,7 @@ int update_pwuser(FILE *fptr, FILE *ftmp, const char *username, const char *pass
memset(&helper, 0, sizeof(helper));
helper.username = username;
helper.password = password;
rc = pwfile_iterate(fptr, ftmp, update_pwuser_cb, &helper);
if(helper.found){

Loading…
Cancel
Save