From f0b61e7d415990c350e0deaffef41da92c7b09cc Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Tue, 16 Oct 2018 14:12:22 +0900 Subject: [PATCH] sudo: print prompt to stderr --- apps/sudo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/sudo.c b/apps/sudo.c index 49f2775d..47f15da1 100644 --- a/apps/sudo.c +++ b/apps/sudo.c @@ -44,8 +44,8 @@ int main(int argc, char ** argv) { char * username = getenv("USER"); char * password = malloc(sizeof(char) * 1024); - fprintf(stdout, "[%s] password for %s: ", argv[0], username); - fflush(stdout); + fprintf(stderr, "[%s] password for %s: ", argv[0], username); + fflush(stderr); /* Disable echo */ struct termios old, new; @@ -57,7 +57,7 @@ int main(int argc, char ** argv) { fgets(password, 1024, stdin); password[strlen(password)-1] = '\0'; tcsetattr(fileno(stdin), TCSAFLUSH, &old); - fprintf(stdout, "\n"); + fprintf(stderr, "\n"); int uid = toaru_auth_check_pass(username, password);