diff options
author | Brendan Coles <bcoles@gmail.com> | 2021-01-12 06:37:40 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-12 08:58:59 +0100 |
commit | eece9edd910e1878f0bef3fec26f384070ce392a (patch) | |
tree | ee59fd239f83b2fd95dd0f788549fb2744d67cb6 | |
parent | eeffdb9725f1120c88c6be795f1f0a46cce10eb5 (diff) | |
download | serenity-eece9edd910e1878f0bef3fec26f384070ce392a.zip |
useradd: Use pledge()
-rw-r--r-- | Userland/useradd.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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; |