Allow other apps access to log file on Windows.

This change means that users with the appropriate security permissions
can open the log file for reading at the same time that it is being
written.

Closes #515.
pull/1342/head
Roger Light 6 years ago committed by Roger A. Light
parent d17d7c9229
commit 2b2afc93bc

@ -4,6 +4,9 @@
Broker: Broker:
- Fix persistent clients being incorrectly expired on Raspberry Pis. - Fix persistent clients being incorrectly expired on Raspberry Pis.
Closes #1272. Closes #1272.
- Windows: Allow other applications access to the log file when running.
Closes #515.
1.6.3 - 20190618 1.6.3 - 20190618
================ ================

@ -248,7 +248,7 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
sec.bInheritHandle = FALSE; sec.bInheritHandle = FALSE;
sec.lpSecurityDescriptor = &sd; sec.lpSecurityDescriptor = &sd;
hfile = CreateFile(buf, GENERIC_READ | GENERIC_WRITE, 0, hfile = CreateFile(buf, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ,
&sec, &sec,
dwCreationDisposition, dwCreationDisposition,
FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_NORMAL,

@ -61,3 +61,11 @@ command line as follows:
C:\Program Files\mosquitto\mosquitto install C:\Program Files\mosquitto\mosquitto install
C:\Program Files\mosquitto\mosquitto uninstall C:\Program Files\mosquitto\mosquitto uninstall
Logging
-------
If you use `log_dest file ...` in your configuration, the log file will be
created with security permissions for the current user only. If running as a
service, this means the SYSTEM user. You will only be able to view the log file
if you add permissions for yourself or whatever user you wish to view the logs.

Loading…
Cancel
Save