From efae2c8a3b12b983250cd3a9a2e3833a82b04ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Courr=C3=A8ges-Anglas?= Date: Wed, 2 Apr 2014 07:40:36 +0200 Subject: At saving time, restrict the permissions of the history file --- src/history.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit v1.2.3