[Pkg-cups-devel] Bug#380640: cupsys - blocks on read of /dev/random

Kenshi Muto kmuto at debian.org
Mon Jul 31 15:04:01 UTC 2006


At Mon, 31 Jul 2006 13:58:20 +0000,
Bastian Blank wrote:
> Package: cupsys
> Version: 1.2.1-3
> Severity: important
> 
> cupsd blocks if it can't read enough from /dev/random on startup.

Could you tell me how to reproduce it?

I think the relational code is in scheduler/cert.c:
-------------------------------
  if ((fp = cupsFileOpen("/dev/urandom", "rb")) == NULL)
  {
   /*
    * Get the time in usecs and use it as the initial seed...
    */

    gettimeofday(&tod, NULL);

    seed = (unsigned)(tod.tv_sec + tod.tv_usec);
  }
  else
  {
   /*
    * Read 4 random characters from the random device and use
    * them as the seed...
    */

    seed = cupsFileGetChar(fp);
    seed = (seed << 8) | cupsFileGetChar(fp);
    seed = (seed << 8) | cupsFileGetChar(fp);
    seed = (seed << 8) | cupsFileGetChar(fp);

    cupsFileClose(fp);
  }
-------------------------------


Thanks,
-- 
Kenshi Muto
kmuto at debian.org




More information about the Pkg-cups-devel mailing list