diff --git a/ChangeLog.txt b/ChangeLog.txt index 0c59e5ad..f17e68a0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -28,6 +28,8 @@ Broker: - Fixed comment handling for config options that have optional arguments. - Improved documentation around bridge topic remapping. - Handle mismatched handshakes (e.g. QoS1 PUBLISH with QoS2 reply) properly. +- Fix spaces not being allowed in the bridge remote_username option. Closes + #1131. Library: - Fix TLS connections not working over SOCKS. diff --git a/src/conf.c b/src/conf.c index f81219f3..8479fd25 100644 --- a/src/conf.c +++ b/src/conf.c @@ -2026,21 +2026,7 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, struct log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration."); return MOSQ_ERR_INVAL; } - token = strtok_r(NULL, " ", &saveptr); - if(token){ - if(cur_bridge->remote_username){ - log__printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate username value in bridge configuration."); - return MOSQ_ERR_INVAL; - } - cur_bridge->remote_username = mosquitto__strdup(token); - if(!cur_bridge->remote_username){ - log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory."); - return MOSQ_ERR_NOMEM; - } - }else{ - log__printf(NULL, MOSQ_LOG_ERR, "Error: Empty username value in configuration."); - return MOSQ_ERR_INVAL; - } + if(conf__parse_string(&token, "bridge remote_username", &cur_bridge->remote_username, saveptr)) return MOSQ_ERR_INVAL; #else log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); #endif