Skip to content

Commit

Permalink
Fix spaces not being allowed in the bridge remote_username option.
Browse files Browse the repository at this point in the history
Closes #1131. Thanks to beville.
  • Loading branch information
ralight committed Feb 3, 2019
1 parent 3854993 commit 5df00f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 1 addition & 15 deletions src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5df00f6

Please sign in to comment.