mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-19 08:03:30 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5c37570dfc5
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…
Reference in a new issue