Compare commits

..

No commits in common. "499bf6dd192a5fc9049c6af9b4ed7f6359aecd51" and "3b8aabce0fc73edafcf3d2947b193186226989f2" have entirely different histories.

4 changed files with 3 additions and 9 deletions

View File

@ -14,7 +14,6 @@
#include <os/FileSystem.h>
#include <os/IPC.h>
#include <os/Process.h>
#include <os/Security.h>
#include <pwd.h>
#include <shadow.h>
#include <sys/stat.h>
@ -46,8 +45,6 @@ Result<int> luna_main(int argc, char** argv)
return 1;
}
TRY(os::Security::pledge("stdio rpath wpath proc exec id", nullptr));
setsid();
bool success = os::IPC::Notifier::run_and_wait(

View File

@ -58,7 +58,7 @@ Result<int> luna_main(int argc, char** argv)
{
srand((unsigned)time(NULL));
TRY(os::Security::pledge("stdio rpath wpath cpath unix tty id", NULL));
TRY(os::Security::pledge("stdio rpath wpath cpath unix proc exec tty id", NULL));
StringView socket_path = "/tmp/wind.sock";
StringView system_socket_path = "/tmp/wsys.sock";
@ -128,7 +128,7 @@ Result<int> luna_main(int argc, char** argv)
TRY(fds.try_append({ .fd = server->fd(), .events = POLLIN, .revents = 0 }));
TRY(fds.try_append({ .fd = system_server->fd(), .events = POLLIN, .revents = 0 }));
TRY(os::Security::pledge("stdio rpath wpath cpath unix", NULL));
TRY(os::Security::pledge("stdio rpath wpath cpath unix proc exec", NULL));
while (1)
{

View File

@ -64,7 +64,7 @@ Result<u64> sys_waitpid(Registers* regs, SyscallArgs args)
check(current->child_being_waited_for != -1);
target = TRY(Result<Process*>::from_option(Scheduler::find_by_pid(current->child_being_waited_for), ESRCH));
check(target->dead());
check(!target->dead());
}
else
target = child.value();

View File

@ -15,7 +15,6 @@
#include <os/IPC.h>
#include <os/Main.h>
#include <os/Process.h>
#include <os/Security.h>
#include <pwd.h>
#include <stdlib.h>
#include <sys/stat.h>
@ -68,8 +67,6 @@ Result<int> luna_main(int argc, char** argv)
parser.add_value_argument(username, 'u', "user", "the user to start the UI session as");
parser.parse(argc, argv);
TRY(os::Security::pledge("stdio rpath wpath cpath proc exec id", nullptr));
if (geteuid() != 0)
{
os::eprintln("error: %s can only be started as root.", argv[0]);