2.9p1 ssh-add/ssh-askpass first try fails

John Dunlap dunlap at apl.washington.edu
Mon May 14 08:08:25 EST 2001


Damien,
This patch cures the problem for me.
Tested on RHL6.2 and RHL7.2.
Thanks, John

> 
> Please try this:
> 
> Index: readpass.c
> ===================================================================
> RCS file: /var/cvs/openssh/readpass.c,v
> retrieving revision 1.14
> diff -u -r1.14 readpass.c
> --- readpass.c	2001/05/06 18:01:44	1.14
> +++ readpass.c	2001/05/13 00:26:13
> @@ -69,12 +69,13 @@
>  		fatal("ssh_askpass: exec(%s): %s", askpass, strerror(errno));
>  	}
>  	close(p[1]);
> -	len = read(p[0], buf, sizeof buf);
> +	memset(buf, 0, sizeof(buf));
> +	len = atomicio(read, p[0], buf, sizeof buf);
>  	close(p[0]);
>  	while (waitpid(pid, &status, 0) < 0)
>  		if (errno != EINTR)
>  			break;
> -	if (len <= 1)
> +	if (len == -1)
>  		return xstrdup("");
>  	nl = strchr(buf, '\n');
>  	if (nl)
> 
> -- 
> | Damien Miller <djm at mindrot.org> \ ``E-mail attachments are the poor man's
> | http://www.mindrot.org          /   distributed filesystem'' - Dan Geer
> 

-- 
John Dunlap                           University of Washington
Senior Electrical Engineer            Applied Physics Laboratory
dunlap at apl.washington.edu             1013 NE 40th Street
206-543-7207, 543-1300, FAX 543-6785  Seattle, WA   98105-6698



More information about the openssh-unix-dev mailing list