readpass.c patch

John Dunlap dunlap at apl.washington.edu
Wed Oct 24 11:16:40 EST 2001


To make readpass.c work on first try with gnome-askpass on RHL 7.1:

wget http://bass.directhit.com/openssh_snap/openssh-SNAP-20011023.tar.gz
tar xfz openssh-SNAP-20011023.tar.gz
cd openssh
./configure --with-pam --enable-gnome-askpass --with-tcp-wrappers
mv readpass.c readpass.c1

new readpass.c according to patch I received from djm 5-13-01:

--------------------- cut here ---------------------------------
--- readpass.c1	Wed Jul 18 08:45:45 2001
+++ readpass.c	Tue Oct 23 18:01:01 2001
@@ -71,12 +71,15 @@
 		fatal("ssh_askpass: exec(%s): %s", askpass, strerror(errno));
 	}
 	close(p[1]);
-	len = read(p[0], buf, sizeof buf);
+//	len = read(p[0], buf, sizeof buf);            // djm 5-13-01
+        memset(buf, 0, sizeof(buf));                  // djm 5-13-01
+        len = atomicio(read, p[0], buf, sizeof buf);  // djm 5-13-01
 	close(p[0]);
 	while (waitpid(pid, &status, 0) < 0)
 		if (errno != EINTR)
 			break;
-	if (len <= 1)
+//	if (len <= 1)                                 // djm 5-13-01
+	if (len == -1)                                // djm 5-13-01
 		return xstrdup("");
 	nl = strchr(buf, '\n');
 	if (nl)
--------------------- cut here ---------------------------------

Regards,
John

-- 
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