From 6f5f44519688979adc0518f72f3dd1ee92b558e2 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 26 May 2016 09:25:41 +0100 Subject: [PATCH] [169] mosquitto_passwd handles unknown cmd args properly. Closes #169. Thanks to castorgodinho. Bug: https://github.com/eclipse/mosquitto/issues/169 --- ChangeLog.txt | 2 ++ src/mosquitto_passwd.c | 1 + 2 files changed, 3 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 2b4a93bf..f2123f6f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -18,6 +18,8 @@ Broker: PUBREL, PUBCOMP without disconnecting. Closes #57. - Fix websockets listeners not being able to bind to an IP address. Closes #170. +- mosquitto_passwd utility now correctly deals with unknown command line + arguments in all cases. Closes #169. Client library: - Fix the case where a message received just before the keepalive timer diff --git a/src/mosquitto_passwd.c b/src/mosquitto_passwd.c index 4a9ffeee..a7ad1cca 100644 --- a/src/mosquitto_passwd.c +++ b/src/mosquitto_passwd.c @@ -369,6 +369,7 @@ int main(int argc, char *argv[]) batch_mode = true; }else{ fprintf(stderr, "Error: Unknown option '%s'\n", argv[1]); + return 1; } password_file_tmp = argv[2]; username = argv[3];