From d07ac4130f5662e3800ae5624ac1a178d0bc5fad Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 9 Jan 2021 22:22:07 +0100 Subject: 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. :^) --- Userland/passwd.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Userland') 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"); } -- cgit v1.2.3