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

mosquitto_ctrl is not using options file specified via -o parameter #2471

Closed
Vitaljok opened this issue Mar 10, 2022 · 2 comments
Closed

mosquitto_ctrl is not using options file specified via -o parameter #2471

Vitaljok opened this issue Mar 10, 2022 · 2 comments
Labels
Component: mosquitto-apps Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Milestone

Comments

@Vitaljok
Copy link

Hello!

Followed the documentation for the Dynamic Security plugin (https://mosquitto.org/documentation/dynamic-security/) and, perhaps, found a bug.

I have started local broker on custom port with enabled Dynamic security plugin.
Following command works as expected:

$ mosquitto_ctrl -h localhost -p 23456 -u admin -P asd dynsec getDefaultACLAccess

publishClientSend    : deny
publishClientReceive : allow
subscribe            : deny
unsubscribe          : allow

As described in the documentation

... mosquitto_ctrl can load an options file ... from a default location ... $HOME/.config/mosquitto_ctrl

If I create mentioned file with following content

-h localhost
-p 23456
-u admin
-P asd

then it also works as expected:

$ mosquitto_ctrl dynsec getDefaultACLAccess

publishClientSend    : deny
publishClientReceive : allow
subscribe            : deny
unsubscribe          : allow

The documentation also says

You may override this behaviour by manually specifying an options file with -o <path to options file>.

But the file is not loaded and default options are used instead (it tries to connect to the broker on the default port).

$ mosquitto_ctrl -o /path/to/my/options dynsec getDefaultACLAccess

Error: Connection refused

Is this a bug or an undocumented feature?
Thanks!

Versions:

  • mosquitto_ctrl version 2.0.14
  • Ubuntu 18.04.6 LTS
@rillbert
Copy link

I believe I see the same behavior as described by @Vitaljok.

Further on, the version of the docs that I follow (at https://mosquitto.org/documentation/dynamic-security/#installation) claims that the default config file name is $HOME/.config/mosquitto_ctrl.conf which has an extra .conf suffix compared to the name reported by @Vitaljok

The only way I got to work was to not use the -o option and remove the .config suffix of the config file.

  • mosquitto_ctrl version 2.0.14
  • ubuntu 20.04

Cheers

@ralight
Copy link
Contributor

ralight commented Aug 10, 2022

Thank you both, I've fixed the two issues ready for 2.0.15.

ralight added a commit that referenced this issue Aug 10, 2022
…entation.

Closes #2471. Thanks to Vitaljok and rillbert
@ralight ralight added Type: Bug Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Component: mosquitto-apps labels Aug 10, 2022
@ralight ralight added this to the 2.0.15 milestone Aug 10, 2022
@ralight ralight closed this as completed Aug 11, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: mosquitto-apps Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants