Hi again

I'm also adding Bob into this mail chain as he was the one that wrote the
code for RANDOM in 2004.

When testing this out I noticed the following:

ola@quartz:~/svn/fsp/cron-apt$ dd if=/dev/urandom count=1 2> /dev/null | cksum
2815760522 512
ola@quartz:~/svn/fsp/cron-apt$ echo "2815760522 512" | cut -d' ' -f1
2815760522
ola@quartz:~/svn/fsp/cron-apt$ echo "2815760522 512" | cut -c"1-5"
28157
ola@quartz:~/svn/fsp/cron-apt$ echo $((2815760522 % 3600))
2522
ola@quartz:~/svn/fsp/cron-apt$ echo $((28157 % 3600))
2957

As you can see it gives different output. I do not really think that is
a real problem, but I think you two should have the possibility to comment
it before I apply the patch.

Thanks,

// Ola

On Fri, May 24, 2013 at 01:01:20PM +0200, Ola Lundqvist wrote:
> Hi Marc
> 
> Thanks. Ah, yes I did not think of that case. Will apply.
> 
> // Ola
> 
> On Sun, Oct 07, 2012 at 07:08:22PM +0200, Marc Haber wrote:
> > Package: cron-apt
> > Severity: normal
> > 
> > Please consider the following patch:
> > 
> > --- cron-apt.orig       2012-10-07 19:07:15.772153360 +0200
> > +++ cron-apt    2012-10-07 19:07:32.748173175 +0200
> > @@ -299,7 +299,7 @@
> >      if [ $RUNSLEEP -gt 0 ] ; then
> >         if [ -z "$RANDOM" ] ; then
> >              # A fix for shells that do not have this bash feature.
> > -           RANDOM=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut 
> > -c"1-5")
> > +           RANDOM=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut 
> > -d' ' -f1)
> >         fi
> >         TIME=$(($RANDOM % $RUNSLEEP))
> >         sleep $TIME                                                         
> >     
> >     
> > which will help cron-apt to gracefully handle the case where the
> > checksum returned by cksum is shorter than four digits.
> > 
> > Greetings
> > Marc
> > 
> > 
> > -- System Information:
> > Debian Release: wheezy/sid
> >   APT prefers unstable
> >   APT policy: (500, 'unstable')
> > Architecture: amd64 (x86_64)
> > Foreign Architectures: i386
> > 
> > Kernel: Linux 3.5.4-zgws1 (SMP w/8 CPU cores; PREEMPT)
> > Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
> > Shell: /bin/sh linked to /bin/dash
> > 
> 
> -- 
>  --------------------- Ola Lundqvist ---------------------------
> /  o...@debian.org                     Annebergsslingan 37      \
> |  o...@inguza.com                      654 65 KARLSTAD          |
> |  http://inguza.com/                  +46 (0)70-332 1551       |
> \  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
>  ---------------------------------------------------------------
> 

-- 
 --------------------- Ola Lundqvist ---------------------------
/  o...@debian.org                     Annebergsslingan 37      \
|  o...@inguza.com                      654 65 KARLSTAD          |
|  http://inguza.com/                  +46 (0)70-332 1551       |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
 ---------------------------------------------------------------


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to