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

broker configuration read incorrectly (conf.d with per_listener acl settings) #1149

Closed
momoskitto opened this Issue Feb 6, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@momoskitto
Copy link

momoskitto commented Feb 6, 2019

version:
mosquitto 1.5.5 on debian

configuration:

mosquitto.conf file:
include_dir /tmp/conf.d

two files in conf.d:
/tmp/conf.d/default.conf:

per_listener_settings true
port 10001

/tmp/conf.d/listener.conf:

listener 10002

allow_anonymous false
acl_file /tmp/mosq-acl
password_file /tmp/mosq-user

acl file /tmp/mosq-acl:

pattern read test/#

password_file /tmp/mosq-user (password is "test"):

tester:$6$s275PjYK6AE3JCbg$XtQEepwbtyoOzwXmGTPRUesjSG2j8tn2zaWpPSMMFs636QnKIxZHdJ3gfLe7OSvsyYEv3D3O/UWovczlSW6vXQ==

steps to reproduce:
use above configuration, connect to port 10002 as user tester1234:

mosquitto_sub --port 10002 -t "#" -u "tester1234" -P "test"

observed behaviour:
the connection to the broker is successful, but the connection should be refused.

misc:

  • renaming the configuration files in conf.d so that they might be read in a different order does not seem to change anything
  • merging the 2 configuration files in conf.d into a single one (first default.conf followed by listener.conf) works correctly
@ralight

This comment has been minimized.

Copy link
Contributor

ralight commented Feb 8, 2019

Thanks for the report, this has been fixed in the fixes branch with two changes, the first to return an error if per_listener_settings is set to true after other security options (which was already happening in the main config file, but not in subsequent files), and the config files are sorted before loading.

@ralight ralight closed this Feb 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.