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!
This commit is contained in:
Andreas Kling 2020-03-30 12:09:26 +02:00
parent 0df15823b5
commit 5c37570dfc
Notes: sideshowbarker 2024-07-19 08:03:30 +09:00

View file

@ -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);