Mosquitto: auth_opt configuartion parsing is not skipped on reload

Created on 4 Dec 2018  路  1Comment  路  Source: eclipse/mosquitto

When an auth plugin is used with auth_opt configuration lines and mosquitto is reloaded, the configuration parsing breaks on the auth_opt line. This logs a false error message and ends the parsing, preventing lines below from being processed.

The following patch can be applied to have the auth_opt configuration lines align with the auth_plugin behaviour. I'm requesting an existing contributor apply this to skip the agreement overhead for myself.

diff --git a/src/conf.c b/src/conf.c
index 0b1d79c..bdc8524 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -816,6 +816,7 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, struct
                                        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(!strncmp(token, "auth_opt_", 9)){
+                                       if(reload) continue; // Auth plugin not currently valid for reloading.
                                        if(!cur_auth_plugin_config){
                                                log__printf(NULL, MOSQ_LOG_ERR, "Error: An auth_opt_ option exists in the config file without an auth_plugin.");
                                                return MOSQ_ERR_INVAL;
bug mosquitto-broker

Most helpful comment

Good catch, thanks. I think we're safe on the ECA front, this is just a copy-paste from the existing code and is the only way to fix it. This will be part of 1.5.5, which will be released in a week.

>All comments

Good catch, thanks. I think we're safe on the ECA front, this is just a copy-paste from the existing code and is the only way to fix it. This will be part of 1.5.5, which will be released in a week.

Was this page helpful?
0 / 5 - 0 ratings