Fix incorrect handling of anonymous bridges on the local broker.

Thanks to Jan-Piet Mens.
pull/211/merge
Roger A. Light 11 years ago
parent 0d1cb339a8
commit 8e7736b78e

@ -1,3 +1,10 @@
1.3.3 - 20140801
================
Broker:
- Fix incorrect handling of anonymous bridges on the local broker.
1.3.2 - 20140713
================

@ -162,6 +162,7 @@ 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:
@ -176,6 +177,10 @@ int mqtt3_bridge_connect(struct mosquitto_db *db, struct mosquitto *context)
_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

Loading…
Cancel
Save