history: use mode 0600 for creating history file

Fixes #6926.
This commit is contained in:
David Adam 2020-05-10 21:28:16 +08:00
parent 90c89c877f
commit 6bd563ca32
2 changed files with 2 additions and 1 deletions

View file

@ -8,6 +8,7 @@
- Ctrl-C no longer kills background jobs for which job control is disabled, matching POSIX semantics (#6828).
- Improve Gradle completion
- Fixed `pushd`'s behavior with respect to the directory stack when given an invalid argument
- The history file is now created with user-private permissions, matching other shells (#6926). The directory containing the history file remains private, so there should not have been any private date revealed.
### Syntax changes and new commands

View file

@ -69,7 +69,7 @@
#define HISTORY_OUTPUT_BUFFER_SIZE (64 * 1024)
// The file access mode we use for creating history files
static constexpr int history_file_mode = 0644;
static constexpr int history_file_mode = 0600;
// How many times we retry to save
// Saving may fail if the file is modified in between our opening