Fix spaces not being allowed in the bridge remote_username option.

Closes #1131. Thanks to beville.
pull/1600/head
Roger A. Light 7 years ago
parent 3854993d33
commit 5df00f66b4

@ -28,6 +28,8 @@ Broker:
- Fixed comment handling for config options that have optional arguments. - Fixed comment handling for config options that have optional arguments.
- Improved documentation around bridge topic remapping. - Improved documentation around bridge topic remapping.
- Handle mismatched handshakes (e.g. QoS1 PUBLISH with QoS2 reply) properly. - 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: Library:
- Fix TLS connections not working over SOCKS. - Fix TLS connections not working over SOCKS.

@ -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."); log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration.");
return MOSQ_ERR_INVAL; return MOSQ_ERR_INVAL;
} }
token = strtok_r(NULL, " ", &saveptr); if(conf__parse_string(&token, "bridge remote_username", &cur_bridge->remote_username, saveptr)) return MOSQ_ERR_INVAL;
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;
}
#else #else
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available."); log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available.");
#endif #endif

Loading…
Cancel
Save