summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-22 15:24:34 +1100
committerDamien Miller <djm@mindrot.org>1999-11-22 15:24:34 +1100
commitd71b12ee5b6b0283ce41ff2d9c8864c6aadc6bbe (patch)
tree5e692fe42c86a2142c7e8eae5f9bce252329d219
parent859cec02509ae0d3e2f34051d0f9d7366b6ca62f (diff)
- Fix EGD problems (Thanks to Ben Taylor <bent@clark.net>)
- Retry /dev/urandom reads interrupted by signal (report from Robert Hardy <rhardy@webcon.net>)
-rw-r--r--ChangeLog3
-rw-r--r--README1
-rw-r--r--helper.c12
3 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index eb79657af..d7ea7b761 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@
10 - Tidy RCSIDs of bsd-*.c 10 - Tidy RCSIDs of bsd-*.c
11 - Added autoconf test and macro to deal with old PAM libraries 11 - Added autoconf test and macro to deal with old PAM libraries
12 pam_strerror definition (one arg vs two). 12 pam_strerror definition (one arg vs two).
13 - Fix EGD problems (Thanks to Ben Taylor <bent@clark.net>)
14 - Retry /dev/urandom reads interrupted by signal (report from
15 Robert Hardy <rhardy@webcon.net>)
13 16
1419991121 1719991121
15 - OpenBSD CVS Changes: 18 - OpenBSD CVS Changes:
diff --git a/README b/README
index abeec979f..f0cf0d8b0 100644
--- a/README
+++ b/README
@@ -52,6 +52,7 @@ Credits -
52Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, 52Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
53Theo de Raadt, and Dug Song - Creators of OpenSSH 53Theo de Raadt, and Dug Song - Creators of OpenSSH
54'jonchen' - the original author of PAM support of SSH 54'jonchen' - the original author of PAM support of SSH
55Ben Taylor <bent@clark.net> - Solaris debugging and fixes
55Chip Salzenberg <chip@valinux.com> - Assorted patches 56Chip Salzenberg <chip@valinux.com> - Assorted patches
56Dan Brosemer <odin@linuxfreak.com> - Autoconf and build fixes & Debian scripts 57Dan Brosemer <odin@linuxfreak.com> - Autoconf and build fixes & Debian scripts
57Jim Knoble <jmknoble@pobox.com> - RPM spec file fixes 58Jim Knoble <jmknoble@pobox.com> - RPM spec file fixes
diff --git a/helper.c b/helper.c
index 28fe04219..47e797b6c 100644
--- a/helper.c
+++ b/helper.c
@@ -100,8 +100,7 @@ void get_random_bytes(unsigned char *buf, int len)
100 if (sizeof(RANDOM_POOL) > sizeof(addr.sun_path)) 100 if (sizeof(RANDOM_POOL) > sizeof(addr.sun_path))
101 fatal("Random pool path is too long"); 101 fatal("Random pool path is too long");
102 102
103 strncpy(addr.sun_path, RANDOM_POOL, sizeof(addr.sun_path - 1)); 103 strcpy(addr.sun_path, RANDOM_POOL);
104 addr.sun_path[sizeof(addr.sun_path - 1)] = '\0';
105 104
106 addr_len = offsetof(struct sockaddr_un, sun_path) + sizeof(RANDOM_POOL); 105 addr_len = offsetof(struct sockaddr_un, sun_path) + sizeof(RANDOM_POOL);
107 106
@@ -130,9 +129,12 @@ void get_random_bytes(unsigned char *buf, int len)
130 129
131#endif /* HAVE_EGD */ 130#endif /* HAVE_EGD */
132 131
133 c = read(random_pool, buf, len); 132 do {
134 if (c == -1) 133 c = read(random_pool, buf, len);
135 fatal("Couldn't read from random pool \"%s\": %s", RANDOM_POOL, strerror(errno)); 134
135 if ((c == -1) && (errno != EINTR))
136 fatal("Couldn't read from random pool \"%s\": %s", RANDOM_POOL, strerror(errno));
137 } while (c == -1);
136 138
137 if (c != len) 139 if (c != len)
138 fatal("Short read from random pool \"%s\"", RANDOM_POOL); 140 fatal("Short read from random pool \"%s\"", RANDOM_POOL);