1
Fork 0
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:
Andreas Kling 2021-01-09 22:22:07 +01:00
parent 96c346cfb0
commit d07ac4130f

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