diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-04-02 07:40:36 +0200 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-04-02 07:46:42 +0200 |
commit | efae2c8a3b12b983250cd3a9a2e3833a82b04ce7 (patch) | |
tree | 33f48382e362d3813694e174443ea2d992cbdf64 /src | |
parent | 2484f5ce9be86936f5b0e51b9a758ff48ba83054 (diff) | |
download | ratpoison-efae2c8a3b12b983250cd3a9a2e3833a82b04ce7.zip |
At saving time, restrict the permissions of the history file
Diffstat (limited to 'src')
-rw-r--r-- | src/history.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/history.c b/src/history.c index a9a1c12..421973e 100644 --- a/src/history.c +++ b/src/history.c @@ -247,6 +247,10 @@ history_save (void) return; } + if (fchmod (fileno (f), 0600) == -1) + PRINT_ERROR (("ratpoison: could not change mode to 0600 on %s - %s\n", + filename, strerror (errno))); + list_for_each_entry(item, &histories[hist_COMMAND].head, node) { fputs(item->line, f); putc('\n', f); |