Skip to content

Commit

Permalink
ClipboardHistory: Use pledge() and unveil() :^)
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Jun 18, 2020
1 parent fe458f8 commit d480944
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions MenuApplets/ClipboardHistory/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,32 @@
#include <LibGUI/Image.h>
#include <LibGUI/TableView.h>
#include <LibGUI/Window.h>
#include <stdio.h>

int main(int argc, char* argv[])
{
if (pledge("stdio shared_buffer accept rpath unix cpath fattr", nullptr) < 0) {
perror("pledge");
return 1;
}

GUI::Application app(argc, argv);

if (pledge("stdio shared_buffer accept rpath", nullptr) < 0) {
perror("pledge");
return 1;
}

if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}

if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}

auto main_window = GUI::Window::construct();
main_window->set_title("Clipboard history");
main_window->set_rect(670, 65, 325, 500);
Expand Down

0 comments on commit d480944

Please sign in to comment.