sudo: print prompt to stderr
This commit is contained in:
parent
a53f832107
commit
f0b61e7d41
@ -44,8 +44,8 @@ int main(int argc, char ** argv) {
|
|||||||
char * username = getenv("USER");
|
char * username = getenv("USER");
|
||||||
char * password = malloc(sizeof(char) * 1024);
|
char * password = malloc(sizeof(char) * 1024);
|
||||||
|
|
||||||
fprintf(stdout, "[%s] password for %s: ", argv[0], username);
|
fprintf(stderr, "[%s] password for %s: ", argv[0], username);
|
||||||
fflush(stdout);
|
fflush(stderr);
|
||||||
|
|
||||||
/* Disable echo */
|
/* Disable echo */
|
||||||
struct termios old, new;
|
struct termios old, new;
|
||||||
@ -57,7 +57,7 @@ int main(int argc, char ** argv) {
|
|||||||
fgets(password, 1024, stdin);
|
fgets(password, 1024, stdin);
|
||||||
password[strlen(password)-1] = '\0';
|
password[strlen(password)-1] = '\0';
|
||||||
tcsetattr(fileno(stdin), TCSAFLUSH, &old);
|
tcsetattr(fileno(stdin), TCSAFLUSH, &old);
|
||||||
fprintf(stdout, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
int uid = toaru_auth_check_pass(username, password);
|
int uid = toaru_auth_check_pass(username, password);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user