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:
Andreas Kling 2021-01-09 22:22:07 +01:00
commit d07ac4130f
Notes: sideshowbarker 2024-07-18 23:58:37 +09:00

View file

@ -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");
}