Преглед изворни кода

* debian/apt.cron.daily:
- when reading from /dev/urandom, use less entropy and fix a rare
bug when the random number chksum is less than 1000.
Closes: #695285

Michael Vogt пре 13 година
родитељ
комит
50816ce744
2 измењених фајлова са 5 додато и 1 уклоњено
  1. 1 1
      debian/apt.cron.daily
  2. 4 0
      debian/changelog

+ 1 - 1
debian/apt.cron.daily

@@ -289,7 +289,7 @@ random_sleep()
     fi
     fi
     if [ -z "$RANDOM" ] ; then
     if [ -z "$RANDOM" ] ; then
         # A fix for shells that do not have this bash feature.
         # 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 bs=2 count=1 2> /dev/null | cksum | cut -d' ' -f1 | cut -c"1-5")
     fi
     fi
     TIME=$(($RANDOM % $RandomSleep))
     TIME=$(($RANDOM % $RandomSleep))
     debug_echo "sleeping for $TIME seconds"
     debug_echo "sleeping for $TIME seconds"

+ 4 - 0
debian/changelog

@@ -13,6 +13,10 @@ apt (0.9.7.8) UNRELEASED; urgency=low
       of e.g. apt-get update. While this adds new translatable strings,
       of e.g. apt-get update. While this adds new translatable strings,
       not having translations for them will not break anything.
       not having translations for them will not break anything.
       Thanks to Guillem Jover. Closes: #696225
       Thanks to Guillem Jover. Closes: #696225
+  * debian/apt.cron.daily:
+    - when reading from /dev/urandom, use less entropy and fix a rare
+      bug when the random number chksum is less than 1000.
+      Closes: #695285
 
 
  -- Christian Perrier <bubulle@debian.org>  Mon, 24 Dec 2012 07:01:20 +0100
  -- Christian Perrier <bubulle@debian.org>  Mon, 24 Dec 2012 07:01:20 +0100