From 5c37570dfc528d843364edaffff362c07b88d2db Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 30 Mar 2020 12:09:26 +0200 Subject: [PATCH] Shell: Stop making shell history files world-readable \0 pointed out that it's pretty bad to have world-readable .history files, especially for root's shell! --- Shell/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shell/main.cpp b/Shell/main.cpp index 9c4245a45dc..c6b201c99ce 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -978,8 +978,8 @@ void load_history() void save_history() { - auto history_file = Core::File::construct(get_history_path()); - if (!history_file->open(Core::IODevice::WriteOnly)) + auto history_file = Core::File::open(get_history_path(), Core::IODevice::WriteOnly, 0600); + if (!history_file) return; for (const auto& line : editor.history()) { history_file->write(line);