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
Same topic and ACL evaluate to false #1589
Comments
What you're running into here is the difference between topics, and topic filters (subscriptions). They aren't the same thing, despite appearances. You publish and receive messages on topics, and subscribe to topic filters. A topic filter/subscription is allowed to have wildcards in it, a topic isn't. So:
|
It was not returning MOSQ_ERR_INVAL if the topic contains a wildcard. Closes #1589. Thanks to mdelete.
That change should make it work consistently. |
Thanks for your quick response! I still wonder, because this function is not only called when matching topics to topic filters but also when checking access for a subscription. How would you write an ACL for a wildcard topic filter? In another example, But when I call |
If you're referring to the use of For your two examples I can only repeat what I've already said, |
Yes, you're right, I found the FIXME while studying the code ;) |
If I have an ACL for a user saying foo/+ and this user wants to subscribe to the topic foo/+ it gets rejected. Is this intended? Am I mental? Or is this a bug?
The function
mosquitto_topic_matches_sub("foo/+", "foo/+", &b)
returnsMOSQ_ERR_INVAL
andb==false
Btw:
mosquitto_topic_matches_sub("foo/+", "foo/bar/+", &b)
also evaluates tob==false
(as it should) but it returnsMOSQ_ERR_SUCCESS
The text was updated successfully, but these errors were encountered: