From eece9edd910e1878f0bef3fec26f384070ce392a Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Tue, 12 Jan 2021 06:37:40 +0000 Subject: [PATCH] useradd: Use pledge() --- Userland/useradd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/useradd.cpp b/Userland/useradd.cpp index 995027707f..627e1209f2 100644 --- a/Userland/useradd.cpp +++ b/Userland/useradd.cpp @@ -39,6 +39,11 @@ constexpr const char* DEFAULT_SHELL = "/bin/Shell"; int main(int argc, char** argv) { + if (pledge("stdio wpath rpath cpath chown", nullptr) < 0) { + perror("pledge"); + return 1; + } + const char* home_path = nullptr; int uid = 0; int gid = USERS_GID;