Print messages in mosquitto_passwd when adding/updating passwords.

Closes #2544. Thanks to Shruti Nanda.
pull/2559/head
Roger A. Light 3 years ago
parent fe32e2506b
commit e3246f547c

@ -57,6 +57,8 @@ Broker:
to trust default CA certificates. Closes #2473. to trust default CA certificates. Closes #2473.
- Add `--test-config` option which can be used to test a configuration file - Add `--test-config` option which can be used to test a configuration file
before trying to use it in a live broker. Closes #2521. before trying to use it in a live broker. Closes #2521.
- Print messages in mosquitto_passwd when adding/updating passwords.
Closes #2544.
Plugins / plugin interface: Plugins / plugin interface:
- Add persist-sqlite plugin. - Add persist-sqlite plugin.

@ -336,8 +336,10 @@ static int update_pwuser(FILE *fptr, FILE *ftmp, const char *username, const cha
rc = pwfile_iterate(fptr, ftmp, update_pwuser_cb, &helper); rc = pwfile_iterate(fptr, ftmp, update_pwuser_cb, &helper);
if(helper.found){ if(helper.found){
printf("Updating password for user %s\n", username);
return rc; return rc;
}else{ }else{
printf("Adding password for user %s\n", username);
return output_new_password(ftmp, username, password, iterations); return output_new_password(ftmp, username, password, iterations);
} }
} }
@ -606,6 +608,7 @@ int main(int argc, char *argv[])
return 1; return 1;
} }
free(password_file); free(password_file);
printf("Adding password for user %s\n", username);
rc = output_new_password(fptr, username, password_cmd, iterations); rc = output_new_password(fptr, username, password_cmd, iterations);
fclose(fptr); fclose(fptr);
return rc; return rc;

Loading…
Cancel
Save