Re: NGINX 1.0.3 compile error: src/core/ngx_crypt.c: In function ‘ngx_crypt_apr1’

Maxim Dounin mdounin at mdounin.ru
Fri May 27 16:07:47 MSD 2011


Hello!

On Fri, May 27, 2011 at 01:57:45PM +0400, Igor Sysoev wrote:

> On Fri, May 27, 2011 at 11:30:17AM +0200, Dalibor Jotanovic wrote:
> > Hi,
> >  
> > i'm having problems compiling the latest stable source 1.0.3.
> >  
> > How to reproduce:
> >  
> > cd <sourcedirectory>
> > ./configure
> > make
> >  
> > make output is attached in log.txt
> >  
> > I do not have any problems compiling stable source 1.0.2
> >  
> > Is suspect this issue beeing a bug. Can somebody confirm this?
> 
> > gcc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g  -I src/core -I 
> > src/event -I src/event/modules -I src/os/unix -I objs \
> > 		-o objs/src/core/ngx_crypt.o \
> > 		src/core/ngx_crypt.c
> > cc1: warnings being treated as errors
> > src/core/ngx_crypt.c: In function Б─≤ngx_crypt_apr1Б─≥:
> > src/core/ngx_crypt.c:76: warning: pointer targets in passing argument 2 of Б─≤ngx_md5_updateБ─≥ differ in signedness
> 
> Thank you for the report.
> The attached patch should fix the issue.
> 
> 
> -- 
> Igor Sysoev

> Index: src/core/ngx_md5.c
> ===================================================================
> --- src/core/ngx_md5.c	(revision 3927)
> +++ src/core/ngx_md5.c	(working copy)
> @@ -32,7 +32,7 @@
>  
>  
>  void
> -ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size)
> +ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size)

$ grep MD5Update /usr/include/sys/md5.h
void   MD5Update (MD5_CTX *, const unsigned char *, unsigned int);

So this is required anyway:

diff --git a/src/core/ngx_crypt.c b/src/core/ngx_crypt.c
--- a/src/core/ngx_crypt.c
+++ b/src/core/ngx_crypt.c
@@ -74,7 +74,7 @@ ngx_crypt_apr1(ngx_pool_t *pool, u_char

     ngx_md5_init(&md5);
     ngx_md5_update(&md5, key, keylen);
-    ngx_md5_update(&md5, "$apr1$", sizeof("$apr1$") - 1);
+    ngx_md5_update(&md5, (u_char *) "$apr1$", sizeof("$apr1$") - 1);
     ngx_md5_update(&md5, salt, saltlen);

     ngx_md5_init(&ctx1);

Sorry for the breakage.  BTW, it's probably good idea to finally 
branch stable-1.0 and start releasing 1.1.*.

Maxim Dounin



More information about the nginx mailing list