diff --git a/ChangeLog.txt b/ChangeLog.txt index 817f99ec..d0d83917 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -2,6 +2,10 @@ Broker: - Fix excessive CPU use on non-Linux systems when the open file limit is set high. Closes #1947. +Apps: +- Fix `mosquitto_passwd -b` using username as password (not if `-c` is also + used). Closes #1949. + Build: - Fix `install` target when using WITH_CJSON=no. Closes #1938. diff --git a/apps/mosquitto_passwd/mosquitto_passwd.c b/apps/mosquitto_passwd/mosquitto_passwd.c index 92613f0f..9495c3c5 100644 --- a/apps/mosquitto_passwd/mosquitto_passwd.c +++ b/apps/mosquitto_passwd/mosquitto_passwd.c @@ -505,7 +505,7 @@ int main(int argc, char *argv[]) }else if(batch_mode == true && idx+3 == argc){ password_file_tmp = argv[idx]; username = argv[idx+1]; - password_cmd = argv[idx+1]; + password_cmd = argv[idx+2]; }else if(batch_mode == false && idx+2 == argc){ password_file_tmp = argv[idx]; username = argv[idx+1];