Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auth_opt configuartion parsing is not skipped on reload #1068

Closed
jmcfadyen-ge opened this issue Dec 4, 2018 · 1 comment
Closed

auth_opt configuartion parsing is not skipped on reload #1068

jmcfadyen-ge opened this issue Dec 4, 2018 · 1 comment

Comments

@jmcfadyen-ge
Copy link

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;
@jmcfadyen-ge jmcfadyen-ge changed the title auth_opt configuartion parsing is not skipped on reload. auth_opt configuartion parsing is not skipped on reload Dec 4, 2018
@ralight ralight added this to the 1.5.5 milestone Dec 4, 2018
ralight added a commit that referenced this issue Dec 4, 2018
This matches the behaviour of the other plugin options.

Closes #1068. Thanks to Jason McFadyen.

Bug: #1068
@ralight
Copy link
Contributor

ralight commented Dec 4, 2018

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.

@ralight ralight closed this as completed Dec 8, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants