Authentication plugin acl_check function is passed local_username for local bridges.
This commit is contained in:
parent
0c3e4e50cc
commit
0a86aee5fb
@ -194,13 +194,23 @@ int mosquitto_security_cleanup(struct mosquitto_db *db, bool reload)
|
||||
|
||||
int mosquitto_acl_check(struct mosquitto_db *db, struct mosquitto *context, const char *topic, int access)
|
||||
{
|
||||
char *username;
|
||||
|
||||
if(!context->id){
|
||||
return MOSQ_ERR_ACL_DENIED;
|
||||
}
|
||||
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){
|
||||
username = context->bridge->local_username;
|
||||
}else
|
||||
#endif
|
||||
{
|
||||
username = context->username;
|
||||
}
|
||||
return db->auth_plugin.acl_check(db->auth_plugin.user_data, context->id, username, topic, access);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user