Skip to content

Commit

Permalink
useradd: Use pledge()
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles authored and awesomekling committed Jan 12, 2021
1 parent eeffdb9 commit eece9ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Userland/useradd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eece9ed

Please sign in to comment.