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

Damien Miller djm at mindrot.org
Sun May 13 10:27:54 EST 2001


On Sat, 12 May 2001, Damien Miller wrote:

> On Fri, 11 May 2001, John Dunlap wrote:
>
> > Nuts,  don't pay too much attention to what I say works.  I cannot
> > duplicate it.  I could have sworn that some combination accepted
> > the first try but I cannot find it now.  Sorry, -- John
>
> My patch is wrong too - I'll do another tonight.

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




More information about the openssh-unix-dev mailing list