From bfce0fccdee25e1cd45a8d001d937d88fb67e8bd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 22 Jan 2021 19:40:30 +0100 Subject: [PATCH] su: Drop "id" pledge after switching user --- Userland/Utilities/su.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Utilities/su.cpp b/Userland/Utilities/su.cpp index 546e28b529..de276a726f 100644 --- a/Userland/Utilities/su.cpp +++ b/Userland/Utilities/su.cpp @@ -95,6 +95,11 @@ int main(int argc, char** argv) return 1; } + if (pledge("stdio exec", nullptr) < 0) { + perror("pledge"); + return 1; + } + execl(account.shell().characters(), account.shell().characters(), nullptr); perror("execl"); return 1;