From: Theodore Tso Date: Mon, 24 Oct 1994 19:27:47 +0000 (+0000) Subject: Don't check for srand48 and then try to define srandom to be srand48. X-Git-Tag: krb5-1.0-beta5~1079 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e551404f2d35b8c38024c9d001dd1e80be9af3c1;p=krb5.git Don't check for srand48 and then try to define srandom to be srand48. This breaks on machines which have both srandom and srand48. Instead, change krlogin to use krb5_random_confounder; it will do the right thing. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4561 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 43688d808..c29a8e65d 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,11 @@ +Mon Oct 24 14:46:07 1994 (tytso@rsx-11) + + * configure.in + * krlogin.c (des_write): Don't check for srand48 and then try to + define srandom to be srand48. This breaks on machines + which have both srandom and srand48. Instead, use + krb5_random_confounder; it will do the right thing. + Wed Oct 19 12:36:47 1994 Theodore Y. Ts'o (tytso@dcl) * krlogind.c (protocol): Change yet another variable to be an diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in index cb9bc2289..569afa149 100644 --- a/src/appl/bsd/configure.in +++ b/src/appl/bsd/configure.in @@ -32,8 +32,6 @@ AC_FUNC_CHECK(initgroups,AC_DEFINE(HAVE_INITGROUPS)) AC_FUNC_CHECK(setpriority,AC_DEFINE(HAVE_SETPRIORITY)) AC_FUNC_CHECK(setreuid,AC_DEFINE(HAVE_SETREUID)) AC_FUNC_CHECK(setresuid,AC_DEFINE(HAVE_SETRESUID)) -dnl if srand48 is there, use it (krlogind needs it) -AC_FUNC_CHECK(srand48,AC_DEFINE(srandom,srand48) AC_DEFINE(random,lrand48)) AC_FUNC_CHECK(sigprocmask, AC_COMPILE_CHECK([sigset_t], [#include ], diff --git a/src/appl/bsd/krlogin.c b/src/appl/bsd/krlogin.c index 29f61a16b..322064aa5 100644 --- a/src/appl/bsd/krlogin.c +++ b/src/appl/bsd/krlogin.c @@ -1756,9 +1756,13 @@ int des_write(fd, buf, len) seeded = 1; srandom((int) time((long *)0)); } +#if 0 garbage = random(); /* insert random garbage */ (void) memcpy(garbage_buf, &garbage, min(sizeof(long),8)); +#else + krb5_random_confounder(8, &garbage_buf); +#endif /* this "right-justifies" the data in the buffer */ (void) memcpy(garbage_buf + 8 - len, buf, len);