mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:07:34 +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()
|
void save_history()
|
||||||
{
|
{
|
||||||
auto history_file = Core::File::construct(get_history_path());
|
auto history_file = Core::File::open(get_history_path(), Core::IODevice::WriteOnly, 0600);
|
||||||
if (!history_file->open(Core::IODevice::WriteOnly))
|
if (!history_file)
|
||||||
return;
|
return;
|
||||||
for (const auto& line : editor.history()) {
|
for (const auto& line : editor.history()) {
|
||||||
history_file->write(line);
|
history_file->write(line);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue