mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
passwd: Drop "tty" pledge promise after getting password from user
This leaves us with a total pledge of "stdio" when writing to /etc/passwd and /etc/shadow which is kinda neat. :^)
This commit is contained in:
parent
96c346cfb0
commit
d07ac4130f
1 changed files with 5 additions and 0 deletions
|
@ -131,6 +131,11 @@ int main(int argc, char** argv)
|
|||
target_account.set_password(new_password.value().characters());
|
||||
}
|
||||
|
||||
if (pledge("stdio", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!target_account.sync()) {
|
||||
perror("Core::Account::Sync");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue