summaryrefslogtreecommitdiff
path: root/Shell
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-30 12:09:26 +0200
committerAndreas Kling <kling@serenityos.org>2020-03-30 12:09:26 +0200
commit5c37570dfc528d843364edaffff362c07b88d2db (patch)
tree803acb3ff0cf7ccc639bbf3bb2a3d7f72d9f4f2e /Shell
parent0df15823b50da2a2d18244334fb3fe69142a6c9b (diff)
downloadserenity-5c37570dfc528d843364edaffff362c07b88d2db.zip
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!
Diffstat (limited to 'Shell')
-rw-r--r--Shell/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Shell/main.cpp b/Shell/main.cpp
index 9c4245a45d..c6b201c99c 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);