useradd: Use pledge()

This commit is contained in:
Brendan Coles 2021-01-12 06:37:40 +00:00 committed by Andreas Kling
commit eece9edd91
Notes: sideshowbarker 2024-07-18 23:54:45 +09:00

View file

@ -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;