Hi! I had some fight with ssh-add this morning that I have now tracked down to a change recently made. I run "ssh-add < /dev/null" to launch (x11-)ssh-askpass from the CDE startup. Unfortunately, no keys are added to ssh-agent! Reason: Between 2.2.0p1 (ssh-add.c 1.20) and now (ssh-add 1.22) the input reading from ssh-askpass was changed from read() to atomicio(). 91c120 < len = read(p[0], buf, sizeof buf); ---> len = atomicio(read, p[0], buf, sizeof buf);After having entered the passphrase, atomicio will first read the correct number of characters (like read()), but then will try to read another hunk, which is not there anymore, because anything has been read. read() will hence return "0", so that atomicio will also return "0", even though "buf" contains the correct passphrase... Best regards, Lutz -- Lutz Jaenicke Lutz.Jaenicke at aet.TU-Cottbus.DE BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/ Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129 Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
On Tue, 17 Oct 2000, Lutz Jaenicke wrote:> Hi! > > I had some fight with ssh-add this morning that I have now tracked > down to a change recently made. I run "ssh-add < /dev/null" to > launch (x11-)ssh-askpass from the CDE startup. Unfortunately, no > keys are added to ssh-agent!Thanks again. Does this help: diff -u -r1.25 ssh-add.c --- ssh-add.c 2000/09/30 10:36:54 1.25 +++ ssh-add.c 2000/10/17 12:11:17 @@ -117,7 +117,9 @@ fatal("ssh_askpass: exec(%s): %s", askpass, strerror(errno)); } close(p[1]); - len = atomicio(read, p[0], buf, sizeof buf); + buf[0] = '\0'; + atomicio(read, p[0], buf, sizeof buf); + len = strlen(buf); close(p[0]); while (waitpid(pid, &status, 0) < 0) if (errno != EINTR) -d -- | ``We've all heard that a million monkeys banging on | Damien Miller - | a million typewriters will eventually reproduce the | <djm at mindrot.org> | works of Shakespeare. Now, thanks to the Internet, / | we know this is not true.'' - Robert Wilensky UCB / http://www.mindrot.org
Apparently Analagous Threads
- Critical EGD handling in 2.1.1p1
- scp not shutting down in 2.1.1p4
- [Lutz.Jaenicke@aet.TU-Cottbus.DE: 2.9p1: HP-UX 10.20 utmp/wtmp handling broken?]
- [schulz@adi.com: 0.9.8a: DSA_generate_parameters & RSA_generate_key not in libcrypto]
- OpenSSH (CVS) performance observations