From 06625420e24900fde2e17f62e989293dfc4e0829 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 8 May 2014 23:27:35 +0100 Subject: [PATCH] Fix for local_username/password bridge checks. --- src/security.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/security.c b/src/security.c index 802c188b..a019ada5 100644 --- a/src/security.c +++ b/src/security.c @@ -197,7 +197,15 @@ int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, cons if(!db->auth_plugin.lib){ return mosquitto_acl_check_default(db, context, topic, access); }else{ - return db->auth_plugin.acl_check(db->auth_plugin.user_data, context->id, context->username, topic, access); +#ifdef WITH_BRIDGE + if(context->bridge){ + return db->auth_plugin.acl_check(db->auth_plugin.user_data, context->id, context->bridge->local_username, topic, access); + }else{ +#endif + return db->auth_plugin.acl_check(db->auth_plugin.user_data, context->id, context->username, topic, access); +#ifdef WITH_BRIDGE + } +#endif } }