mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
MenuApplets: Username: init app early, pledge early, do not unveil /tmp
This commit is contained in:
parent
738f5f4d66
commit
6b6594e3d0
Notes:
sideshowbarker
2024-07-19 00:34:55 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/6b6594e3d0b Pull-request: https://github.com/SerenityOS/serenity/pull/4549
|
@ -69,12 +69,14 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unveil("/res", "r") < 0) {
|
auto app = GUI::Application::construct(argc, argv);
|
||||||
perror("unveil");
|
|
||||||
|
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
||||||
|
perror("pledge");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unveil("/tmp", "rwc") < 0) {
|
if (unveil("/res", "r") < 0) {
|
||||||
perror("unveil");
|
perror("unveil");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -86,8 +88,6 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
unveil(nullptr, nullptr);
|
unveil(nullptr, nullptr);
|
||||||
|
|
||||||
auto app = GUI::Application::construct(argc, argv);
|
|
||||||
|
|
||||||
auto window = GUI::Window::construct();
|
auto window = GUI::Window::construct();
|
||||||
window->set_title("UserName");
|
window->set_title("UserName");
|
||||||
window->set_window_type(GUI::WindowType::MenuApplet);
|
window->set_window_type(GUI::WindowType::MenuApplet);
|
||||||
|
@ -96,10 +96,5 @@ int main(int argc, char** argv)
|
||||||
window->resize(widget.get_width(), 16);
|
window->resize(widget.get_width(), 16);
|
||||||
window->show();
|
window->show();
|
||||||
|
|
||||||
if (pledge("stdio shared_buffer rpath", nullptr) < 0) {
|
|
||||||
perror("pledge");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return app->exec();
|
return app->exec();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue