diff --git a/base/etc/user/00-gclient b/base/etc/user/00-gclient new file mode 100644 index 00000000..fcd404ac --- /dev/null +++ b/base/etc/user/00-gclient @@ -0,0 +1,3 @@ +Name=gclient +Description=Sample user application. +Command=/usr/bin/gclient diff --git a/wind/main.cpp b/wind/main.cpp index e8d4442f..943cf93c 100644 --- a/wind/main.cpp +++ b/wind/main.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -19,6 +20,8 @@ Result luna_main(int argc, char** argv) { srand((unsigned)time(NULL)); + TRY(os::Security::pledge("stdio rpath wpath cpath unix proc exec tty id", NULL)); + StringView socket_path = "/tmp/wind.sock"; StringView user; @@ -74,8 +77,8 @@ Result luna_main(int argc, char** argv) auto server = TRY(os::LocalServer::create(socket_path, false)); TRY(server->listen(20)); - StringView args[] = { "/usr/bin/gclient"_sv }; - TRY(os::Process::spawn("/usr/bin/gclient"_sv, Slice { args, 1 }, false)); + StringView args[] = { "/usr/bin/init"_sv, "--user"_sv }; + TRY(os::Process::spawn("/usr/bin/init"_sv, Slice { args, 2 }, false)); ui::Color background = ui::BLACK; @@ -85,6 +88,8 @@ Result luna_main(int argc, char** argv) Vector clients; + TRY(os::Security::pledge("stdio rpath unix", NULL)); + while (1) { screen.canvas().fill(background);