mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
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:
parent
0df15823b5
commit
5c37570dfc
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue