Don't check for srand48 and then try to define srandom to be srand48.
authorTheodore Tso <tytso@mit.edu>
Mon, 24 Oct 1994 19:27:47 +0000 (19:27 +0000)
committerTheodore Tso <tytso@mit.edu>
Mon, 24 Oct 1994 19:27:47 +0000 (19:27 +0000)
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

src/appl/bsd/ChangeLog
src/appl/bsd/configure.in
src/appl/bsd/krlogin.c

index 43688d808fd0b94d7250f1a6815632bb44a21ba6..c29a8e65de59241acb7fe6be7f715e8c653e5c16 100644 (file)
@@ -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
index cb9bc2289ea21d810420491796d2950b9f986080..569afa1499d92d399c970dbe24a8084f6443db4f 100644 (file)
@@ -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 <signal.h>],
index 29f61a16bb6a505021243c9c8a87b87fff2132a9..322064aa5e4d3aebc2fd04cff5ee95dcd2b197d6 100644 (file)
@@ -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);