eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.61k stars 2.33k forks source link

Dynamic security plugin does not save changes #3058

Open PeterLecky opened 1 month ago

PeterLecky commented 1 month ago

I am on Ubuntu 2022.4 and running mosquitto 2.0.18-0mosquitto1~focal1 from repo at: http://ppa.launchpad.net/mosquitto-dev/mosquitto-ppa/ubuntu It seems that changes made via dynamic-security api are properly handled and stored in memory, but the json file is not updated (all created users/groups/acls are lost after restart of the daemon). Relevant part of config:

global

per_listener_settings false
allow_anonymous false
autosave_interval 60
user mosquitto
log_type all
plugin /usr/lib/x86_64-linux-gnu/mosquitto_dynamic_security.so
plugin_opt_config_file /etc/mosquitto/dynamic-security.json

File permissions of json file: -rw-rw---- 1 mosquitto mosquitto 149194 Sep 6 2023 dynamic-security.json

There is nothing in the log regarding troubles with saving the json file. Please let me know if I can add more information. Thanks Peter

PeterLecky commented 1 month ago

Good evening, I found #2967. It is necessary to have also writable access for mosquitto user to directory where is json file stored. This changed probably in 2.16 version, it was not required by older versions. I didn't see that in changelogs, so keeping this opened please documment it in documentation if you believe that it should be mentioned for other users.