rng: Use arc4random for pseudo random number generation Default rng generates same random numbers within one second of unix time: rbtz@host:~$ while :; do jot -r 1; sleep 0.1; done 81 81 81 21 21 21 21 21 21 21 21 21 21 26 This patch solves problem by using FreeBSD's arc4 rng diff -Nur athena-jot-9.0.orig/configure.in athena-jot-9.0/configure.in --- athena-jot-9.0.orig/configure.in 2001-05-16 09:19:50.000000000 +0400 +++ athena-jot-9.0/configure.in 2012-03-15 16:50:04.169791328 +0400 @@ -4,6 +4,10 @@ AC_PROG_CC AC_PROG_INSTALL AC_CHECK_FUNCS(srandom random srand48 lrand48) +AC_CHECK_HEADER([bsd/stdlib.h], + [AC_DEFINE([HAVE_BSD_STDLIB_H], [1], + [Define to 1 if you have .])], + [AC_MSG_ERROR([sorry, can't do anything for you])]) AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile) diff -Nur athena-jot-9.0.orig/debian/changelog athena-jot-9.0/debian/changelog --- athena-jot-9.0.orig/debian/changelog 2012-03-15 19:11:26.000000000 +0400 +++ athena-jot-9.0/debian/changelog 2012-03-15 16:54:27.891099052 +0400 @@ -1,3 +1,9 @@ +athena-jot (9.0-5yandex0) oneiric; urgency=low + + * Use arc4random number generation instead of time based + + -- Alexey Ivanov Thu, 15 Mar 2012 16:53:49 +0400 + athena-jot (9.0-5) unstable; urgency=low * Reverted to compat=3 for etch inclusion. diff -Nur athena-jot-9.0.orig/debian/control athena-jot-9.0/debian/control --- athena-jot-9.0.orig/debian/control 2012-03-15 19:11:26.000000000 +0400 +++ athena-jot-9.0/debian/control 2012-03-15 16:57:30.492004515 +0400 @@ -2,12 +2,12 @@ Section: utils Priority: optional Maintainer: Francesco Paolo Lovergine -Build-Depends: debhelper (>> 4.0.0) +Build-Depends: debhelper (>> 4.0.0), libbsd-dev Standards-Version: 3.7.2 Package: athena-jot Architecture: any -Depends: ${shlibs:Depends} +Depends: ${shlibs:Depends} Description: print out increasing, decreasing, random, or redundant data, one per line Athena jot - or simply jot - prints out increasing, decreasing, random, or redundant data, usually numbers, one per line. diff -Nur athena-jot-9.0.orig/jot.c athena-jot-9.0/jot.c --- athena-jot-9.0.orig/jot.c 2012-03-15 19:11:26.000000000 +0400 +++ athena-jot-9.0/jot.c 2012-03-15 16:26:11.898689086 +0400 @@ -60,6 +60,11 @@ #include #include "config.h" +#if defined(HAVE_BSD_STDLIB_H) +#include +#define srandom // +#define random arc4random +#else #if !defined(HAVE_SRANDOM) || !defined(HAVE_SRANDOM) #if defined(HAVE_SRAND48) && defined(HAVE_LRAND48) #define srandom srand48 @@ -69,6 +74,7 @@ #define random rand #endif #endif +#endif /* HAVE_ARC4RANDOM */ #define REPS_DEF 100 #define BEGIN_DEF 1 diff -Nur athena-jot-9.0.orig/Makefile.in athena-jot-9.0/Makefile.in --- athena-jot-9.0.orig/Makefile.in 2001-05-16 09:19:50.000000000 +0400 +++ athena-jot-9.0/Makefile.in 2012-03-15 16:50:22.841883915 +0400 @@ -15,7 +15,7 @@ CPPFLAGS=@CPPFLAGS@ CFLAGS=@CFLAGS@ LDFLAGS=@LDFLAGS@ -LIBS=@LIBS@ +LIBS=@LIBS@ -lbsd ALL_CFLAGS=-I. ${CPPFLAGS} ${CFLAGS} all: jot