Skip to content

Conversation

@ieblYang
Copy link

Release notes

Fixed an issue where the ACL parser incorrectly interpreted the MQTT topic wildcard '#' as the start of a line comment. This caused topic strings in ACL configuration files to be truncated, preventing proper authorization for topics containing the wildcard.

What does this PR do?

This PR fixes a bug in the ACL file parser where the MQTT single-level topic wildcard character '#'was being incorrectly recognized as the start of a line comment. This caused the parser to stop reading the current line at the '#'character, truncating any topic string that contained it.
image

Why is it important/What is the impact to the user?

  • ACL rules for topics ending with wildcard '#'are incorrectly parsed
  • Users may be denied access to topics they should have permissions for
  • MQTT subscription patterns like 'test/v1/#'don't work as expected
  • System functionality that relies on wildcard subscriptions may break

Checklist

  • [√] My code follows the style guidelines of this project
    - [ ] I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • [√] I have added tests that prove my fix is effective or that my feature works
  • [√] I have updated the Changelog if it's a feature or a fix that has to be reported

Author's Checklist

  • Check if the topic requirements/constraints are met.

How to test this PR locally

  1. Add a rule in the local acl.conf file.
  2. Ensure that the topic in this rule ends with #.
  3. Ensure that there are no​ comments on this line (i.e., the line does not start with #).
  • Example:​ topic read test/v1/#
  1. Start or restart the service.
  2. Verify that the client can successfully subscribe to the topic test/v1/#.

Related issues

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

Successfully merging this pull request may close these issues.

Incorrect ACL Comment Parsing for Topics with Wildcard '#'

1 participant