diff options
author | Eric Andersen | 2004-05-01 01:27:30 +0000 |
---|---|---|
committer | Eric Andersen | 2004-05-01 01:27:30 +0000 |
commit | 6f9a7783ce2f3ffae28176f8bcfcd6b86c1b41b3 (patch) | |
tree | c8d14b02f851c42acde95b53c77527e5461c885b /loginutils/vlock.c | |
parent | 90d2bff4c67d65a4025451213d5028c539b7b91a (diff) | |
download | busybox-6f9a7783ce2f3ffae28176f8bcfcd6b86c1b41b3.zip busybox-6f9a7783ce2f3ffae28176f8bcfcd6b86c1b41b3.tar.gz |
Do not use getpass(3)
Diffstat (limited to 'loginutils/vlock.c')
-rw-r--r-- | loginutils/vlock.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/loginutils/vlock.c b/loginutils/vlock.c index 7abf120..def484a 100644 --- a/loginutils/vlock.c +++ b/loginutils/vlock.c @@ -193,10 +193,9 @@ extern int vlock_main(int argc, char **argv) snprintf(prompt, 100, "%s's password: ", pw->pw_name); - if ((pass = getpass(prompt)) == NULL) { - perror("getpass"); + if ((pass = bb_askpass(0, prompt)) == NULL) { restore_terminal(); - exit(1); + bb_perror_msg_and_die("password"); } crypt_pass = pw_encrypt(pass, pw->pw_passwd); @@ -210,9 +209,8 @@ extern int vlock_main(int argc, char **argv) memset(crypt_pass, 0, strlen(crypt_pass)); if (isatty(STDIN_FILENO) == 0) { - perror("isatty"); restore_terminal(); - exit(1); + bb_perror_msg_and_die("isatty"); } sleep(++times); |