Mosquitto on windows always opens files with write flag
Closed this issue · 1 comments
Hey, I noticed that on windows file are always opened with the GENERIC_WRITE flag. I suggest it should be changed so it sets that flag based on the file mode.
Background: We were setting up mosquitto to run on a windows VM as a service. We set up a password_file in the config and created the password_file with the personal user using mosquitto_passwd.exe. This ran fine when running as the personal user using mosquitto.exe -c mosquitto.conf, but it would not start as a service.
When we checked the permissions of the password_file, the SYSTEM account only had read and execute access to the file. After we gave the SYSTEM account write access the mosquitto service started without issue.
Now that I know it's an issue it is easy enough to workaround. But if this was fixed there would be one less pitfall to running as a service on windows.
Agreed, this seems like a pretty obvious fix.