[PATCH] function bb_askpass only read one line once

Denys Vlasenko vda.linux at googlemail.com
Thu Jan 28 20:29:14 UTC 2010


On Thursday 28 January 2010 10:46, Michael Zhu wrote:
> >From 48a56ae1c473334e56fa33f8925ae57ce7bc2e0b Mon Sep 17 00:00:00 2001
> From: Michael Zhu <linuxsir320 at gmail.com>
> Date: Thu, 28 Jan 2010 09:34:32 +0000
> Subject: [PATCH] function bb_askpass only read one line once
> 
> ---
>  libbb/bb_askpass.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libbb/bb_askpass.c b/libbb/bb_askpass.c
> index f9b918c..ef93c2f 100644
> --- a/libbb/bb_askpass.c
> +++ b/libbb/bb_askpass.c
> @@ -57,9 +57,9 @@ char* FAST_FUNC bb_ask(const int fd, int timeout, const char *prompt)
>  	fputs(prompt, stdout);
>  	fflush_all();
>  	ret = NULL;
> -	/* On timeout or Ctrl-C, read will hopefully be interrupted,
> +	/* On timeout or Ctrl-C, fgets will hopefully be interrupted,
>  	 * and we return NULL */
> -	if (read(fd, passwd, sizeof_passwd - 1) > 0) {
> +	if (fgets(passwd, sizeof_passwd, stdin)) {

Are you serious??

--
vda


More information about the busybox mailing list