Backout changeset c7589b77956c5bac076ae23905fbfc8902d69dc5.

This commit is contained in:
Roger A. Light 2014-08-02 21:48:08 +01:00
parent e6239e1b3c
commit 56ff849c65
4 changed files with 0 additions and 79 deletions

View File

@ -672,13 +672,6 @@
# username is also set.
#password
# Set the username to use on the local broker.
#local_username
# Set the password to use on the local broker.
# This option is only used if local_username is also set.
#local_password
# -----------------------------------------------------------------
# Certificate based SSL/TLS support
# -----------------------------------------------------------------

View File

@ -162,26 +162,6 @@ int mqtt3_bridge_connect(struct mosquitto_db *db, struct mosquitto *context)
mqtt3_db_messages_delete(context);
}
if(context->bridge->local_username){
rc = mosquitto_unpwd_check(db, context->bridge->local_username, context->bridge->local_password);
switch(rc){
case MOSQ_ERR_SUCCESS:
break;
case MOSQ_ERR_AUTH:
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Bridge %s failed authentication on local broker.", context->id);
return rc;
case MOSQ_ERR_UNKNOWN:
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Bridge %s returned application error in authorisation.", context->id);
return rc;
default:
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Unknown error in authentication for bridge %s.", context->id);
return rc;
}
}else if(!db->config->allow_anonymous){
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Bridge %s requires a username on local broker.", context->id);
return MOSQ_ERR_AUTH;
}
/* Delete all local subscriptions even for clean_session==false. We don't
* remove any messages and the next loop carries out the resubscription
* anyway. This means any unwanted subs will be removed.

View File

@ -250,8 +250,6 @@ void mqtt3_config_cleanup(struct mqtt3_config *config)
if(config->bridges[i].clientid) _mosquitto_free(config->bridges[i].clientid);
if(config->bridges[i].username) _mosquitto_free(config->bridges[i].username);
if(config->bridges[i].password) _mosquitto_free(config->bridges[i].password);
if(config->bridges[i].local_username) _mosquitto_free(config->bridges[i].local_username);
if(config->bridges[i].local_password) _mosquitto_free(config->bridges[i].local_password);
if(config->bridges[i].topics){
for(j=0; j<config->bridges[i].topic_count; j++){
if(config->bridges[i].topics[j].topic) _mosquitto_free(config->bridges[i].topics[j].topic);
@ -1142,54 +1140,6 @@ int _config_read_file(struct mqtt3_config *config, bool reload, const char *file
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Empty listener value in configuration.");
return MOSQ_ERR_INVAL;
}
}else if(!strcmp(token, "local_password")){
#ifdef WITH_BRIDGE
if(reload) continue; // FIXME
if(!cur_bridge){
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration.");
return MOSQ_ERR_INVAL;
}
token = strtok_r(NULL, " ", &saveptr);
if(token){
if(cur_bridge->local_password){
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate local_password value in bridge configuration.");
return MOSQ_ERR_INVAL;
}
cur_bridge->local_password = _mosquitto_strdup(token);
if(!cur_bridge->local_password){
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory");
return MOSQ_ERR_NOMEM;
}
}else{
cur_bridge->local_password = NULL;
}
#else
_mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available.");
#endif
}else if(!strcmp(token, "local_username")){
#ifdef WITH_BRIDGE
if(reload) continue; // FIXME
if(!cur_bridge){
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration.");
return MOSQ_ERR_INVAL;
}
token = strtok_r(NULL, " ", &saveptr);
if(token){
if(cur_bridge->local_username){
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Duplicate local_username value in bridge configuration.");
return MOSQ_ERR_INVAL;
}
cur_bridge->local_username = _mosquitto_strdup(token);
if(!cur_bridge->local_username){
_mosquitto_log_printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory");
return MOSQ_ERR_NOMEM;
}
}else{
cur_bridge->local_username = NULL;
}
#else
_mosquitto_log_printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available.");
#endif
}else if(!strcmp(token, "log_dest")){
token = strtok_r(NULL, " ", &saveptr);
if(token){

View File

@ -258,8 +258,6 @@ struct _mqtt3_bridge{
time_t restart_t;
char *username;
char *password;
char *local_username;
char *local_password;
bool notifications;
char *notification_topic;
enum mosquitto_bridge_start_type start_type;