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

ACL plugin last line bug #1897

Closed
KacperSzmitko opened this issue Oct 18, 2021 · 1 comment
Closed

ACL plugin last line bug #1897

KacperSzmitko opened this issue Oct 18, 2021 · 1 comment

Comments

@KacperSzmitko
Copy link

Environment

  • VerneMQ Version: 1.12.3
  • OS: Docker
  • VerneMQ configuration (vernemq.conf) or the changes from the default
    I used those options
    - DOCKER_VERNEMQ_listener.ssl.default=0.0.0.0:8883
    - DOCKER_VERNEMQ_listener.ssl.cafile=/etc/ssl/ca.crt
    - DOCKER_VERNEMQ_listener.ssl.certfile=/etc/ssl/server.crt
    - DOCKER_VERNEMQ_listener.ssl.keyfile=/etc/ssl/server.key
    - DOCKER_VERNEMQ_listener.ssl.require_certificate=on
    - DOCKER_VERNEMQ_listener.ssl.use_identity_as_username=on
    - DOCKER_VERNEMQ_plugins.vmq_acl=on
    - DOCKER_VERNEMQ_vmq_acl.acl_file=/etc/vernemq/vmq.acl
    - DOCKER_VERNEMQ_vmq_acl.acl_reload_interval=3

Expected behaviour

My vmq.acl file contains something like this:

user server1
topic read sample

I expected to allow user "server1" to sub topic "sample"

Actual behaviour

When I use vmq.acl file with just those two lines ACL doesnt work. But when i add empy line at the end it works. This always refers to the last line of the acl. That is, in an ACL file with more rules but no blank line at the end, all rules except the last one work.

@ioolkos
Copy link
Contributor

ioolkos commented Oct 19, 2021

@KapelanJR Thanks for reporting, jep, there's a couple of quirks in the ACL file parser. Another one is that you need to make sure there are no unnecessary empty lines and no spaces at the end of topics (because those would count as part of a topic name).
Need to make sure this is documented somewhere.


👉 Thank you for supporting VerneMQ: https://github.com/sponsors/vernemq
👉 Using the binary VerneMQ packages commercially (.deb/.rpm/Docker) requires a paid subscription.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants