You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jw...@apache.org on 2002/05/29 01:15:10 UTC

cvs commit: apr CHANGES configure.in

jwoolley    02/05/28 16:15:10

  Modified:    .        CHANGES configure.in
  Log:
  Added --with-devrandom=[DEV] configure flag which allows a particular
  "/dev/random"-compatible device to be specified, overriding the
  default search path (/dev/random then /dev/arandom then /dev/urandom).
  Also, if --with-egd=<path> is specified, it now implies
  --without-devrandom.
  
  Revision  Changes    Path
  1.291     +6 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.290
  retrieving revision 1.291
  diff -u -d -u -r1.290 -r1.291
  --- CHANGES	22 May 2002 11:15:29 -0000	1.290
  +++ CHANGES	28 May 2002 23:15:10 -0000	1.291
  @@ -1,5 +1,11 @@
   Changes with APR b1
   
  +  *) Added --with-devrandom=[DEV] configure flag which allows a particular
  +     "/dev/random"-compatible device to be specified, overriding the
  +     default search path (/dev/random then /dev/arandom then /dev/urandom).
  +     Also, if --with-egd=<path> is specified, it now implies
  +     --without-devrandom.  [Cliff Woolley]
  +
     *) Darwin/Mac OS X: Don't leave zombie processes when the app calls
        apr_signal(SIGCHLD, SIG_IGN).  This fixes a problem with Apache's
        mod_cgid.  PR 9168.  [Jeff Trawick]
  
  
  
  1.450     +42 -19    apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.449
  retrieving revision 1.450
  diff -u -d -u -r1.449 -r1.450
  --- configure.in	14 May 2002 07:38:16 -0000	1.449
  +++ configure.in	28 May 2002 23:15:10 -0000	1.450
  @@ -1525,17 +1525,50 @@
   fi
   
   dnl #----------------------------- Checking for /dev/random 
  -AC_MSG_CHECKING(for /dev/random)
  +AC_MSG_CHECKING(for entropy source)
   
  -if test -r "/dev/random"; then
  -    AC_DEFINE(DEV_RANDOM, [/dev/random])
  -    AC_MSG_RESULT(/dev/random)
  -    rand="1"
  -elif test -r "/dev/urandom"; then
  -    AC_DEFINE(DEV_RANDOM, [/dev/urandom])
  -    AC_MSG_RESULT(/dev/urandom)
  +AC_ARG_WITH(egd, 
  +  [  --with-egd=<path>       use egd-compatible socket],
  +  [ if test "$withval" = "yes"; then
  +      AC_ERROR([You must specify a default EGD socket path.])
  +    fi
  +    AC_DEFINE(HAVE_EGD)
  +    AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval])
  +    AC_MSG_RESULT(EGD-compatible daemon)
       rand="1"
  -else
  +  ])
  +
  +if test "$rand" != "1"; then
  +  AC_ARG_WITH(devrandom,
  +    [  --with-devrandom[[=DEV]]  use /dev/random or compatible [[searches by default]]],
  +    [ apr_devrandom="$withval" ], [ apr_devrandom="yes" ])
  +
  +  if test "$apr_devrandom" = "yes"; then
  +    if test -r "/dev/random"; then
  +      AC_DEFINE(DEV_RANDOM, [/dev/random])
  +      AC_MSG_RESULT(/dev/random)
  +      rand="1"
  +    elif test -r "/dev/arandom"; then
  +      AC_DEFINE(DEV_RANDOM, [/dev/arandom])
  +      AC_MSG_RESULT(/dev/arandom)
  +      rand="1"
  +    elif test -r "/dev/urandom"; then
  +      AC_DEFINE(DEV_RANDOM, [/dev/urandom])
  +      AC_MSG_RESULT(/dev/urandom)
  +      rand="1"
  +    fi
  +  elif test "$apr_devrandom" != "no"; then
  +    if test -r "$apr_devrandom"; then
  +      AC_DEFINE(DEV_RANDOM, [$apr_devrandom])
  +      AC_MSG_RESULT($apr_devrandom)
  +      rand="1"
  +    else
  +      AC_ERROR([$apr_devrandom not found or unreadable.])
  +    fi
  +  fi
  +fi
  +
  +if test "$rand" != "1"; then
       case $host in
           # we have built in support for OS/2
           *-os2*)
  @@ -1543,16 +1576,6 @@
               rand="1"
               ;;
           *)
  -            AC_ARG_WITH(egd, 
  -              [  --with-egd=<path>       use egd-compatible socket],
  -              [ if test "$withval" = "yes"; then
  -                  AC_ERROR([You must specify a default EGD socket path.])
  -                fi
  -                AC_DEFINE(HAVE_EGD)
  -                AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval])
  -                AC_MSG_RESULT(EGD-compatible daemon)
  -                rand="1"
  -              ])
               if test "$rand" != "1"; then
                 if test "$ac_cv_lib_truerand_main" = "yes"; then
                   AC_DEFINE(HAVE_TRUERAND)
  
  
  

Re: cvs commit: apr CHANGES configure.in

Posted by Ben Laurie <be...@algroup.co.uk>.
Cliff Woolley wrote:
> On 28 May 2002 jwoolley@apache.org wrote:
> 
> 
>>jwoolley    02/05/28 16:15:10
>>
>>  Modified:    .        CHANGES configure.in
>>  Log:
>>  Added --with-devrandom=[DEV] configure flag which allows a particular
>>  "/dev/random"-compatible device to be specified, overriding the
>>  default search path (/dev/random then /dev/arandom then /dev/urandom).
>>  Also, if --with-egd=<path> is specified, it now implies
>>  --without-devrandom.
> 
> 
> Okay, Ben, I believe this patch implements what you've said you prefer,
> and it makes a lot of sense to me as well.  Here's what we have now:
> 
> 1) If --with-egd=<path> is specified, --without-devrandom is assumed
>    and the EGD socket is used as the source of entropy.
> 
> 2) Otherwise, if --with-devrandom=<DEV> is specified with a particular
>    device, that device is used as the source of entropy.
> 
> 3) Otherwise, if --with-devrandom (with no =<DEV>) is specified or
>    --with-devrandom is not specified at all, we search
>       /dev/random
>       /dev/arandom
>       /dev/urandom
>    in that order.
> 
> 4) If the search in #3 fails, we try looking for the truerand library.
> 
> 5) If none of the above is usable, we have no source of entropy.
> 
> Does that sound right?

I still say it needs to be configurable at runtime as well. Apart from 
that, yes.

Cheers,

Ben.

-- 
http://www.apache-ssl.org/ben.html       http://www.thebunker.net/

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff


Re: cvs commit: apr CHANGES configure.in

Posted by Cliff Woolley <jw...@virginia.edu>.
Oops, I missed one thing:


On Tue, 28 May 2002, Cliff Woolley wrote:

> 1) If --with-egd=<path> is specified, --without-devrandom is assumed
>    and the EGD socket is used as the source of entropy.
>
> 2) Otherwise, if --with-devrandom=<DEV> is specified with a particular
>    device, that device is used as the source of entropy.
>
> 3) Otherwise, if --with-devrandom (with no =<DEV>) is specified or
>    --with-devrandom is not specified at all, we search
>       /dev/random
>       /dev/arandom
>       /dev/urandom
>    in that order.
>
> 4) If the search in #3 fails,

...or if --without-devrandom was specified

> we try looking for the truerand library.
>
> 5) If none of the above is usable, we have no source of entropy.


Re: cvs commit: apr CHANGES configure.in

Posted by Cliff Woolley <jw...@virginia.edu>.
On 28 May 2002 jwoolley@apache.org wrote:

> jwoolley    02/05/28 16:15:10
>
>   Modified:    .        CHANGES configure.in
>   Log:
>   Added --with-devrandom=[DEV] configure flag which allows a particular
>   "/dev/random"-compatible device to be specified, overriding the
>   default search path (/dev/random then /dev/arandom then /dev/urandom).
>   Also, if --with-egd=<path> is specified, it now implies
>   --without-devrandom.

Okay, Ben, I believe this patch implements what you've said you prefer,
and it makes a lot of sense to me as well.  Here's what we have now:

1) If --with-egd=<path> is specified, --without-devrandom is assumed
   and the EGD socket is used as the source of entropy.

2) Otherwise, if --with-devrandom=<DEV> is specified with a particular
   device, that device is used as the source of entropy.

3) Otherwise, if --with-devrandom (with no =<DEV>) is specified or
   --with-devrandom is not specified at all, we search
      /dev/random
      /dev/arandom
      /dev/urandom
   in that order.

4) If the search in #3 fails, we try looking for the truerand library.

5) If none of the above is usable, we have no source of entropy.

Does that sound right?

--Cliff