From 479348c9e74ab4c89ee818ac9f8a03dee46ae6dd Mon Sep 17 00:00:00 2001 From: Itamar Date: Sat, 11 Apr 2020 16:36:55 +0300 Subject: [PATCH] Debugger: Add pledges --- Applications/Debugger/DebugSession.cpp | 1 - Applications/Debugger/main.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Applications/Debugger/DebugSession.cpp b/Applications/Debugger/DebugSession.cpp index 8766ad60b2..86c59e8196 100644 --- a/Applications/Debugger/DebugSession.cpp +++ b/Applications/Debugger/DebugSession.cpp @@ -77,7 +77,6 @@ OwnPtr DebugSession::exec_and_attach(const String& command) return nullptr; } - // TOOD: do we actually need this waitpid? if (waitpid(pid, nullptr, WSTOPPED) != pid) { perror("waitpid"); return nullptr; diff --git a/Applications/Debugger/main.cpp b/Applications/Debugger/main.cpp index 05fc498487..94fbe0ffcb 100644 --- a/Applications/Debugger/main.cpp +++ b/Applications/Debugger/main.cpp @@ -159,8 +159,11 @@ void print_help() int main(int argc, char** argv) { - // TODO: pledge & unveil - // TODO: check that strace still works + if (pledge("stdio proc exec rpath", nullptr) < 0) { + perror("pledge"); + return 1; + } + if (argc == 1) return usage();