diff --git a/README.md b/README.md index 478b8d2d..812ea358 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,6 @@ And to publish a message: ## To dynamically create/delete/show a bridge, use: - Set allow_sys_update with true value in mosquitto.conf file. - Mosquitto broker implement SYS-Topics. All SYS-Topics start $SYS and are read-only for MQTT clients. To dynamically create or delete a bridge, mosquitto use new topics: BRIDGE-Topics. All BRIDGE-Topics start with $BRIDGE and are read-write with ACL Protection. diff --git a/mosquitto.conf b/mosquitto.conf index d485563f..216b8c7d 100644 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -807,10 +807,6 @@ # Set to 0 for "unlimited". #bridge_max_packet_size 0 -# If allow_sys_update is set to true, Mosquitto allows to interpret some $SYS -# topics. Interpreted topics are : $BRIDGE/new and $BRIDGE/del. -# They are used for dynamic bridges behaviour. -#allow_sys_update true # ----------------------------------------------------------------- # Certificate based SSL/TLS support diff --git a/src/conf.c b/src/conf.c index a054c450..d6918d30 100644 --- a/src/conf.c +++ b/src/conf.c @@ -146,7 +146,6 @@ static void config__init_reload(struct mosquitto__config *config) config->security_options.allow_zero_length_clientid = true; config->security_options.auto_id_prefix = NULL; config->security_options.auto_id_prefix_len = 0; - config->allow_sys_update = false; mosquitto__free(config->security_options.password_file); config->security_options.password_file = NULL; @@ -824,8 +823,6 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, struct }else if(!strcmp(token, "allow_zero_length_clientid")){ conf__set_cur_security_options(config, cur_listener, &cur_security_options); if(conf__parse_bool(&token, "allow_zero_length_clientid", &cur_security_options->allow_zero_length_clientid, saveptr)) return MOSQ_ERR_INVAL; - }else if(!strcmp(token, "allow_sys_update")){ - if(conf__parse_bool(&token, "allow_sys_update", &config->allow_sys_update, saveptr)) return MOSQ_ERR_INVAL; }else if(!strncmp(token, "auth_opt_", strlen("auth_opt_")) || !strncmp(token, "plugin_opt_", strlen("plugin_opt_"))){ if(reload) continue; /* Auth plugin not currently valid for reloading. */ if(!cur_auth_plugin_config){ diff --git a/src/handle_publish.c b/src/handle_publish.c index c98f557a..ba269a04 100644 --- a/src/handle_publish.c +++ b/src/handle_publish.c @@ -256,13 +256,11 @@ int handle__publish(struct mosquitto *context) /* Check if demand concern bridge dynamic */ if(!strncmp(msg->topic, "$BRIDGE/", 8)){ - if(db.config->allow_sys_update){ rc = bridge__dynamic_analyse(&db, msg->topic, msg->payload, msg->payloadlen); if(rc == MOSQ_ERR_BRIDGE_DYNA ){ log__printf(NULL, MOSQ_LOG_DEBUG, "PUBLISH Invalid bridge dynamic configuration on $BRIDGE."); rc = 0; /* To not disturbe normal publish management */ } - } } if(!strncmp(msg->topic, "$CONTROL/", 9)){ diff --git a/src/mosquitto_broker_internal.h b/src/mosquitto_broker_internal.h index 9d48fca3..2fe044b6 100644 --- a/src/mosquitto_broker_internal.h +++ b/src/mosquitto_broker_internal.h @@ -251,7 +251,6 @@ typedef struct mosquitto_plugin_id_t{ struct mosquitto__config { bool allow_duplicate_messages; - bool allow_sys_update; int autosave_interval; bool autosave_on_changes; bool check_retain_source; diff --git a/src/security.c b/src/security.c index 6bef2b97..77fa865a 100644 --- a/src/security.c +++ b/src/security.c @@ -643,7 +643,7 @@ static int acl__check_single(struct mosquitto__auth_plugin_config *auth_plugin, } -static int acl__check_dollar(struct mosquitto_db *db, const char *topic, int access) +static int acl__check_dollar(const char *topic, int access) { int rc; bool match = false; @@ -671,7 +671,6 @@ static int acl__check_dollar(struct mosquitto_db *db, const char *topic, int acc } }else if(!strncmp(topic, "$BRIDGE", 7)){ /* Check if demand concern bridge dynamic */ - if(db->config->allow_sys_update){ if((strncmp("$BRIDGE/new",topic,11))==0){ log__printf(NULL, MOSQ_LOG_DEBUG, "Bridge New"); return MOSQ_ERR_SUCCESS; @@ -680,7 +679,7 @@ static int acl__check_dollar(struct mosquitto_db *db, const char *topic, int acc log__printf(NULL, MOSQ_LOG_DEBUG, "Bridge Del"); return MOSQ_ERR_SUCCESS; } - } else { log__printf(NULL, MOSQ_LOG_DEBUG, "You must activate allow_sys_update"); } + } }else{ /* This is an unknown $ topic, for the moment just defer to actual tests. */ log__printf(NULL, MOSQ_LOG_DEBUG, "Topic with $ forbidden"); @@ -705,7 +704,7 @@ int mosquitto_acl_check(struct mosquitto *context, const char *topic, uint32_t p return MOSQ_ERR_SUCCESS; } - rc = acl__check_dollar(&db, topic, access); + rc = acl__check_dollar(topic, access); if(rc) return rc; /*