Skip to content

Commit

Permalink
[468] Set persistence file to only be readable by owner.
Browse files Browse the repository at this point in the history
Not implemented on Windows.

Thanks to Moshe Zioni.

Bug: eclipse-mosquitto#468
  • Loading branch information
ralight committed Jun 23, 2017
1 parent ab45f86 commit 09cb1b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Broker:
- Fix for poor websockets performance.
- Fix lazy bridges not timing out for idle_timeout. Closes #417.
- Fix problems with large retained messages over websockets. Closes #427.
- Set persistence file to only be readable by owner, except on Windows. Closes
#468.

Clients:
- Don't use / in auto-generated client ids.
Expand Down
3 changes: 3 additions & 0 deletions src/persist.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ int mqtt3_db_backup(struct mosquitto_db *db, bool shutdown)
goto error;
}
}

/* Set permissions to -rw------- */
umask(0077);
#endif

db_fptr = _mosquitto_fopen(outfile, "wb");
Expand Down

0 comments on commit 09cb1b6

Please sign in to comment.