httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r629164 - /httpd/httpd/trunk/support/htpasswd.c
Date Tue, 19 Feb 2008 20:28:51 GMT


On 02/19/2008 06:05 PM, pquerna@apache.org wrote:
> Author: pquerna
> Date: Tue Feb 19 09:05:26 2008
> New Revision: 629164
> 
> URL: http://svn.apache.org/viewvc?rev=629164&view=rev
> Log:
> Improve generation of the seed to rand, by using apr_generate_random_bytes, 
> rather than the current time as a seed.
> 
> PR: 31440
> 
> Modified:
>     httpd/httpd/trunk/support/htpasswd.c
> 
> Modified: httpd/httpd/trunk/support/htpasswd.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/support/htpasswd.c?rev=629164&r1=629163&r2=629164&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/support/htpasswd.c (original)
> +++ httpd/httpd/trunk/support/htpasswd.c Tue Feb 19 09:05:26 2008
> @@ -126,6 +126,18 @@
>      }
>  }
>  
> +static apr_status_t seed_rand()
> +{
> +    int seed = 0;
> +    apr_status_t rv;
> +    rv = apr_generate_random_bytes((unsigned char*) &seed, sizeof(seed));
> +    if (rv) {
> +        apr_file_printf(errfile, "Unable to generate random bytes: %pm" NL, rv);

This creates the following compiler warning:

htpasswd.c:135: warning: format '%p' expects type 'void *', but argument 3 has type 'apr_status_t'

Regards

RĂ¼diger

Mime
View raw message