diff options
author | Andreas Kling <kling@serenityos.org> | 2021-01-09 22:22:07 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-09 22:22:07 +0100 |
commit | d07ac4130f5662e3800ae5624ac1a178d0bc5fad (patch) | |
tree | 3dd59f2311d5a23e66e6b7582b8abb0803162b6b | |
parent | 96c346cfb0cd090a883ac5b2ad1915365e5c8a60 (diff) | |
download | serenity-d07ac4130f5662e3800ae5624ac1a178d0bc5fad.zip |
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. :^)
-rw-r--r-- | Userland/passwd.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Userland/passwd.cpp b/Userland/passwd.cpp index cfb2e7e57a..7735dfd887 100644 --- a/Userland/passwd.cpp +++ b/Userland/passwd.cpp @@ -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"); } |