mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-24 00:20:21 +00:00
Terminal: Create config file parent directories before unveil()'ing
Otherwise unveil() will fail, as even with "c" permissions the file's parent directory must exist. Fixes #5651.
This commit is contained in:
parent
5e4808878d
commit
4b65ba27ec
Notes:
sideshowbarker
2024-07-18 21:24:51 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/4b65ba27ec5 Pull-request: https://github.com/SerenityOS/serenity/pull/5761 Issue: https://github.com/SerenityOS/serenity/issues/5651
1 changed files with 4 additions and 1 deletions
|
@ -27,6 +27,8 @@
|
|||
#include <AK/URL.h>
|
||||
#include <Applications/Terminal/TerminalSettingsWindowGML.h>
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/ConfigFile.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibDesktop/Launcher.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/ActionGroup.h>
|
||||
|
@ -347,6 +349,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
RefPtr<Core::ConfigFile> config = Core::ConfigFile::get_for_app("Terminal");
|
||||
Core::File::ensure_parent_directories(config->file_name());
|
||||
|
||||
pid_t shell_pid = 0;
|
||||
|
||||
|
@ -502,7 +505,7 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (unveil(config->file_name().characters(), "rwc")) {
|
||||
if (unveil(config->file_name().characters(), "rwc") < 0) {
|
||||
perror("unveil");
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue