Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

sync.c:local_addr() use

sync.c:local_addr() use

2005-03-26 by Ranko Zivojnovic

Greetings,

Apparently there is a slight problem in the way the local_addr()
function in sync.c is being used.

I have set up v1.6 in a test mode on a couple of Solaris boxes to
evaluate the possibility of using milter-greylist for our production
machines.

After running the milter for a while, I started getting the following
errors in my mail log:
peer x.x.x.x queue overflow (1024 entries), discarding new entry

After looking for a while through the source code and attaching the
process in the debugger, I've found that my peer that I've specified in
the config, is flagged with the P_LOCAL flag.

Looking further through the code, I saw that local_addr() function can
return three values: 1, 0 and -1, but it is used in the code as "true" -
"false" kind of call:
   if(local_addr(...)) {
     ...
   }

Then I went back couple of days in my logs and found the following
error:
local_addr: bind failed: Bad file number

Clearly, having failed to bind to the given IP address should indicate
that the address is NOT a local address, the function should have
returned 0 rather than -1. But since it did return -1, my peer got
flagged as P_LOCAL and has never got an update.

I did fix it localy to return 0 rather than -1, however I thought I
should let you know of the issue and you might want to reconsider the
use of local_addr() in a different way.

The same issue also exists in 2.0b3 code.

Best regards,

Ranko

-- 
Ranko Zivojnovic,
IT Director/CTO          ranko@...

Spidernet Services Ltd., Tel: +357 22 844844
Nicosia, Cyprus          FAX: +357 22 669470

Re: [milter-greylist] sync.c:local_addr() use

2005-03-26 by manu@netbsd.org

Ranko Zivojnovic <ranko@...> wrote:

> Looking further through the code, I saw that local_addr() function can
> return three values: 1, 0 and -1, but it is used in the code as "true" -
> "false" kind of call:
>    if(local_addr(...)) {
>      ...
>    }
> 
> Then I went back couple of days in my logs and found the following
> error:
> local_addr: bind failed: Bad file number
(snip)
> I did fix it localy to return 0 rather than -1, however I thought I
> should let you know of the issue and you might want to reconsider the
> use of local_addr() in a different way.

I think your fix just ignore if the address is local or not, and force
it to be non local. 

Here socket() returned a positive file descriptor, but it's still a bad
file descriptor. Bad file number is EBADF, right? Anyone used to Solaris
can comment on this?

-- 
Emmanuel Dreyfus
Un bouquin en français sur BSD:
http://www.eyrolles.com/Informatique/Livre/9782212114638/livre-bsd.php
manu@netbsd.org

Re: sync.c:local_addr() use

2005-03-26 by ranko_z

--- In milter-greylist@yahoogroups.com, manu@n... wrote:
> Ranko Zivojnovic <ranko@s...> wrote:
> 
> > Looking further through the code, I saw that local_addr()
function can
> > return three values: 1, 0 and -1, but it is used in the code as
"true" -
> > "false" kind of call:
> >    if(local_addr(...)) {
> >      ...
> >    }
> > 
> > Then I went back couple of days in my logs and found the following
> > error:
> > local_addr: bind failed: Bad file number
> (snip)
> > I did fix it localy to return 0 rather than -1, however I thought
I
> > should let you know of the issue and you might want to reconsider
the
> > use of local_addr() in a different way.
> 
> I think your fix just ignore if the address is local or not, and
force
> it to be non local. 
> 
> Here socket() returned a positive file descriptor, but it's still a
bad
> file descriptor. Bad file number is EBADF, right? Anyone used to
Solaris
> can comment on this?

True. bind() should have set errno to EADDRNOTAVAIL, however (here at
least) to me it _always_ gives EBADF, on both systems, so what I've
changed was:
  if (errno != EADDRNOTAVAIL)

to 
  if (errno != EADDRNOTAVAIL && errno != EBADF)

... in order to bypass the problem.

I did however further tests with regards to the behavior on Solaris
and in all the tests I did, errno was always set to EADDRNOTAVAIL as
it should. I could not reproduce (yet) the case outside sync.c code
where bind() would give me EBADF on a valid socket.

Something is really strange here...

R.

Re: sync.c:local_addr() use

2005-03-26 by ranko_z

--- In milter-greylist@yahoogroups.com, "ranko_z" <ranko@s...> wrote:
> 
> Something is really strange here...
>

Ok, I have figured it out where the actual problem is:
The code is threaded, however the _REENTRANT define is not declared
anywhere during the compilation, thus errno was inspected as a simple
integer instead as the TLS variable.

Once I have added to -D_REENTRANT to the Makefile, all worked well
plus a bunch of compile warnings related to strtok_r disappeard.

R.

Re: [milter-greylist] Re: sync.c:local_addr() use

2005-03-26 by manu@netbsd.org

ranko_z <ranko@...> wrote:

> Once I have added to -D_REENTRANT to the Makefile, all worked well
> plus a bunch of compile warnings related to strtok_r disappeard.

Excellent. 

Would you contribute a configure test for that? Build a test with
strtok_r with and without -D_REENTRANT, using -Werror, and if the second
fail, add -D_REENTRANT to CFLAGS. There is a similar test in
configure.ac for -D__EXTENSIONS__, you just have to copy/paste it.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] Re: sync.c:local_addr() use

2005-03-26 by manu@netbsd.org

Emmanuel Dreyfus <manu@...> wrote:

> Would you contribute a configure test for that? Build a test with
> strtok_r with and without -D_REENTRANT, using -Werror, and if the second
> fail, add -D_REENTRANT to CFLAGS. There is a similar test in
> configure.ac for -D__EXTENSIONS__, you just have to copy/paste it.

Hum, the -D_REENTRANT test is already there, but it was buggy. Try this
patch, run autoconf and rebuild.

Index: configure.ac
===================================================================
RCS file: /cvsroot/milter-greylist/configure.ac,v
retrieving revision 1.142
diff -U2 -r1.142 configure.ac
--- configure.ac        19 Mar 2005 07:41:09 -0000      1.142
+++ configure.ac        26 Mar 2005 15:45:40 -0000
@@ -287,5 +288,5 @@
        ],[[
 
-               (void)localtime(NULL);
+               (void)localtime_r(NULL);
        ]])], [dreentrant=no],
                [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
@@ -293,5 +294,5 @@
                                #include <stdio.h>
                        ],[[
-                               (void)localtime(NULL);
+                               (void)localtime_r(NULL);
                        ]])], 
                        [SAVEDCFLAGS=$SAVEDCFLAGS" -D_REENTRANT"; 
 

-- 
Emmanuel Dreyfus
Publicité subliminale: achetez ce livre!
http://www.eyrolles.com/Informatique/Livre/9782212114638/livre-bsd.php
manu@...

configure.ac _REENTRANT issue (was: sync.c:local_addr() use)

2005-03-26 by ranko_z

--- In milter-greylist@yahoogroups.com, manu@n... wrote:
> Emmanuel Dreyfus <manu@n...> wrote:
> Hum, the -D_REENTRANT test is already there, but it was buggy. Try this
> patch, run autoconf and rebuild.

Still buggy. 

The following patch (for 2.0b3) fixes the config problem. It removes 
the part that defines twice both HAVE_GETADDRINFO and HAVE_GETNAMEINFO
and that consequently fails few checks that depend on -Werror. In
addition __EXTENSIONS__ and _REENTRANT checks are swapped. This is
needed because __EXTENSIONS__ will define localtime_r and will not
detect the need for _REENTRANT. Also, localtime_r takes two args and
also the second check was including stdio.h instead of time.h.

It should be noted that v1.6 is not suitable for Solaris as there is 
no check for _REENTRANT.

Best regards,

R.

*** a/configure.ac        Sat Mar 19 09:41:09 2005
--- b/configure.ac        Sat Mar 26 21:22:58 2005
***************
*** 210,219 ****
  fi
  if test $ipv6_cv_$1 = yes; then
    AC_DEFINE_UNQUOTED($ac_tr_lib)
-   ifelse([$2], , :, [$2])
  else
    ifelse([$3], , :, [$3])
  fi])

  IPv6_CHECK_FUNC(getaddrinfo,
      AC_DEFINE([HAVE_GETADDRINFO], [],
--- 210,219 ----
  fi
  if test $ipv6_cv_$1 = yes; then
    AC_DEFINE_UNQUOTED($ac_tr_lib)
  else
    ifelse([$3], , :, [$3])
  fi])
+ #  ifelse([$2], , :, [$2])

  IPv6_CHECK_FUNC(getaddrinfo,
      AC_DEFINE([HAVE_GETADDRINFO], [],
***************
*** 253,258 ****
--- 253,280 ----
            [], [<time.h> defines timeradd]) timeradd=no])
  AC_MSG_RESULT([$timeradd])

+ # Check if -D_REENTRANT is needed for localtime_r, gmtime_r
+ SAVEDCFLAGS=$CFLAGS
+ CFLAGS=$CFLAGS" -ansi -Wall -Werror"
+ AC_MSG_CHECKING([if -D_REENTRANT is needed to use localtime_r])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+               #include <time.h>
+       ],[[
+
+               (void)localtime_r(NULL, NULL);
+       ]])], [dreentrant=no],
+               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+                               #define _REENTRANT
+                               #include <time.h>
+                       ],[[
+                                (void)localtime_r(NULL, NULL);
+                       ]])],
+                       [SAVEDCFLAGS=$SAVEDCFLAGS" -D_REENTRANT";
+                        dreentrant=yes], [dreentrant=no])
+       ])
+ AC_MSG_RESULT([$dreentrant])
+ CFLAGS=$SAVEDCFLAGS
+
  # Check if -D__EXTENSIONS__ is needed for snprintf, getopt, seteuid...
  SAVEDCFLAGS=$CFLAGS
  CFLAGS=$CFLAGS" -ansi -Wall -Werror"
***************
*** 278,305 ****
  AC_MSG_RESULT([$dextensions])
  CFLAGS=$SAVEDCFLAGS

- # Check if -D_REENTRANT is needed for localtime_r, gmtime_r
- SAVEDCFLAGS=$CFLAGS
- CFLAGS=$CFLAGS" -ansi -Wall -Werror"
- AC_MSG_CHECKING([if -D_REENTRANT is needed to use localtime_r])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-               #include <time.h>
-       ],[[
-
-               (void)localtime(NULL);
-       ]])], [dreentrant=no],
-               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-                               #define _REENTRANT
-                               #include <stdio.h>
-                       ],[[
-                                (void)localtime(NULL);
-                       ]])],
-                       [SAVEDCFLAGS=$SAVEDCFLAGS" -D_REENTRANT";
-                        dreentrant=yes], [dreentrant=no])
-       ])
- AC_MSG_RESULT([$dreentrant])
- CFLAGS=$SAVEDCFLAGS
-
  # Check for libpthread. On FreeBSD, the libc_r does the job.
  # On digitalUNIX, libpthreads (with a trailing s) is the library to use
  AC_CHECK_LIB([pthread], [pthread_create],
--- 300,305 ----

Re: [milter-greylist] configure.ac _REENTRANT issue (was: sync.c:local_addr() use)

2005-03-26 by manu@netbsd.org

ranko_z <ranko@...> wrote:

> *** 210,219 ****
>   fi
>   if test $ipv6_cv_$1 = yes; then
>     AC_DEFINE_UNQUOTED($ac_tr_lib)
> -   ifelse([$2], , :, [$2])
>   else
>     ifelse([$3], , :, [$3])
>   fi])
> 
>   IPv6_CHECK_FUNC(getaddrinfo,
>       AC_DEFINE([HAVE_GETADDRINFO], [],
> --- 210,219 ----
>   fi
>   if test $ipv6_cv_$1 = yes; then
>     AC_DEFINE_UNQUOTED($ac_tr_lib)
>   else
>     ifelse([$3], , :, [$3])
>   fi])
> + #  ifelse([$2], , :, [$2])
> 
>   IPv6_CHECK_FUNC(getaddrinfo,
>       AC_DEFINE([HAVE_GETADDRINFO], [],

What does this change do?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] configure.ac _REENTRANT issue (was: sync.c:local_addr() use)

2005-03-26 by Ranko Zivojnovic

On Sat, 2005-03-26 at 21:15 +0100, manu@... wrote:
> ranko_z <ranko@...> wrote:
> 
> > *** 210,219 ****
> >   fi
> >   if test $ipv6_cv_$1 = yes; then
> >     AC_DEFINE_UNQUOTED($ac_tr_lib)
> > -   ifelse([$2], , :, [$2])
> >   else
> >     ifelse([$3], , :, [$3])
> >   fi])
> > 
> >   IPv6_CHECK_FUNC(getaddrinfo,
> >       AC_DEFINE([HAVE_GETADDRINFO], [],
> > --- 210,219 ----
> >   fi
> >   if test $ipv6_cv_$1 = yes; then
> >     AC_DEFINE_UNQUOTED($ac_tr_lib)
> >   else
> >     ifelse([$3], , :, [$3])
> >   fi])
> > + #  ifelse([$2], , :, [$2])
> > 
> >   IPv6_CHECK_FUNC(getaddrinfo,
> >       AC_DEFINE([HAVE_GETADDRINFO], [],
> 
> What does this change do?

If you execute configure as it was you will notice in config.log that
HAVE_GETADDRINFO and HAVE_GETNAMEINFO do get declared twice in
confdefs.h as follows:
#define HAVE_GETADDRINFO
#define HAVE_GETADDRINFO 1
#define HAVE_GETNAMEINFO
#define HAVE_GETNAMEINFO 1

The above makes gcc to issue a warning message. Some checks, like the
one with localtime_r and snprintf, depend on gcc -Werror switch which
turns all warnings to errors and the above redefine makes the checks to
produce the wrong results.

What I have done above, I have removed the line that creates this
problem. I just did not remove it all the way. I've just shifted it out
of the IPv6_CHECK_FUNC declaration and commented it out.

Best regards,

Ranko

-- 
Ranko Zivojnovic,
IT Director/CTO          ranko@...

Spidernet Services Ltd., Tel: +357 22 844844
Nicosia, Cyprus          FAX: +357 22 669470

Re: [milter-greylist] configure.ac _REENTRANT issue (was: sync.c:local_addr() use)

2005-03-27 by Hajimu UMEMOTO

Hi,

>>>>> On Sat, 26 Mar 2005 23:18:12 +0200
>>>>> Ranko Zivojnovic <ranko@...> said:

ranko> On Sat, 2005-03-26 at 21:15 +0100, manu@... wrote:
> ranko_z <ranko@...> wrote:
> 
> > *** 210,219 ****
> >   fi
> >   if test $ipv6_cv_$1 = yes; then
> >     AC_DEFINE_UNQUOTED($ac_tr_lib)
> > -   ifelse([$2], , :, [$2])
> >   else
> >     ifelse([$3], , :, [$3])
> >   fi])
> > 
> >   IPv6_CHECK_FUNC(getaddrinfo,
> >       AC_DEFINE([HAVE_GETADDRINFO], [],
> > --- 210,219 ----
> >   fi
> >   if test $ipv6_cv_$1 = yes; then
> >     AC_DEFINE_UNQUOTED($ac_tr_lib)
> >   else
> >     ifelse([$3], , :, [$3])
> >   fi])
> > + #  ifelse([$2], , :, [$2])
> > 
> >   IPv6_CHECK_FUNC(getaddrinfo,
> >       AC_DEFINE([HAVE_GETADDRINFO], [],
> 
> What does this change do?

ranko> If you execute configure as it was you will notice in config.log that
ranko> HAVE_GETADDRINFO and HAVE_GETNAMEINFO do get declared twice in
ranko> confdefs.h as follows:
ranko> #define HAVE_GETADDRINFO
ranko> #define HAVE_GETADDRINFO 1
ranko> #define HAVE_GETNAMEINFO
ranko> #define HAVE_GETNAMEINFO 1

Your patch simply ignores the action.  The following change should be
better, IMHO:

Index: configure.ac
diff -u configure.ac.orig configure.ac
--- configure.ac.orig	Sat Mar 19 16:41:09 2005
+++ configure.ac	Sun Mar 27 21:02:28 2005
@@ -152,10 +152,6 @@
 
 # Check for getaddrinfo and getnameinfo
 AC_DEFUN([IPv6_CHECK_FUNC], [
-changequote(, )dnl
-ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-  -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-changequote([, ])dnl
 AC_CHECK_FUNC($1, [dnl
   ac_cv_lib_socket_$1=no
   ac_cv_lib_inet6_$1=no
@@ -209,17 +205,16 @@
   fi
 fi
 if test $ipv6_cv_$1 = yes; then
-  AC_DEFINE_UNQUOTED($ac_tr_lib)
   ifelse([$2], , :, [$2])
 else
   ifelse([$3], , :, [$3])
 fi])
 
 IPv6_CHECK_FUNC(getaddrinfo, 
-    AC_DEFINE([HAVE_GETADDRINFO], [], 
+    AC_DEFINE([HAVE_GETADDRINFO], [1], 
     [Define to 1 if you have the `getaddrinfo' function.]))
 IPv6_CHECK_FUNC(getnameinfo, 
-    AC_DEFINE([HAVE_GETNAMEINFO], [], 
+    AC_DEFINE([HAVE_GETNAMEINFO], [1], 
     [Define to 1 if you have the `getnameinfo' function.]))
 
 # Check if <syslog.h> defines LOG_PERROR

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@...  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

Re: [milter-greylist] configure.ac _REENTRANT issue (was: sync.c:local_addr() use)

2005-03-27 by Hajimu UMEMOTO

Hi,

>>> Sun, 27 Mar 2005 21:19:39 +0900,
>>> Hajimu UMEMOTO <ume@...> said:

ranko> If you execute configure as it was you will notice in config.log that
ranko> HAVE_GETADDRINFO and HAVE_GETNAMEINFO do get declared twice in
ranko> confdefs.h as follows:
ranko> #define HAVE_GETADDRINFO
ranko> #define HAVE_GETADDRINFO 1
ranko> #define HAVE_GETNAMEINFO
ranko> #define HAVE_GETNAMEINFO 1

ume> Your patch simply ignores the action.  The following change should be
ume> better, IMHO:

I reworked to use AH_TEMPLATE() macro.  Please use this instead:

Index: configure.ac
diff -u configure.ac.orig configure.ac
--- configure.ac.orig	Sat Mar 19 16:41:09 2005
+++ configure.ac	Mon Mar 28 01:04:28 2005
@@ -152,10 +152,7 @@
 
 # Check for getaddrinfo and getnameinfo
 AC_DEFUN([IPv6_CHECK_FUNC], [
-changequote(, )dnl
-ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-  -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-changequote([, ])dnl
+AH_TEMPLATE(AS_TR_CPP(HAVE_$1), [Define to 1 if you have the `]$1[' function.])
 AC_CHECK_FUNC($1, [dnl
   ac_cv_lib_socket_$1=no
   ac_cv_lib_inet6_$1=no
@@ -209,18 +206,14 @@
   fi
 fi
 if test $ipv6_cv_$1 = yes; then
-  AC_DEFINE_UNQUOTED($ac_tr_lib)
+  AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$1))
   ifelse([$2], , :, [$2])
 else
   ifelse([$3], , :, [$3])
 fi])
 
-IPv6_CHECK_FUNC(getaddrinfo, 
-    AC_DEFINE([HAVE_GETADDRINFO], [], 
-    [Define to 1 if you have the `getaddrinfo' function.]))
-IPv6_CHECK_FUNC(getnameinfo, 
-    AC_DEFINE([HAVE_GETNAMEINFO], [], 
-    [Define to 1 if you have the `getnameinfo' function.]))
+IPv6_CHECK_FUNC(getaddrinfo)
+IPv6_CHECK_FUNC(getnameinfo)
 
 # Check if <syslog.h> defines LOG_PERROR
 AC_MSG_CHECKING([if <syslog.h> defines LOG_PERROR])


--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@...  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

Re: [milter-greylist] configure.ac _REENTRANT issue (was: sync.c:local_addr() use)

2005-03-27 by Ranko Zivojnovic

On Sun, 2005-03-27 at 18:23 +0200, manu@... wrote:
> Hajimu UMEMOTO <ume@...> wrote:
> 
> > I reworked to use AH_TEMPLATE() macro.  Please use this instead:
> 
> Ranko, can you confirm that Hajimu's patch fixes everything at yours?

Yes. I applied it and it fixes the HAVE_GET{ADDR,NAME}INFO issue just
fine.

...
checking for getaddrinfo... yes
checking for getnameinfo... yes
checking if <syslog.h> defines LOG_PERROR... no
checking if <time.h> defines timeradd... no
checking if -D_REENTRANT is needed to use localtime_r... yes
checking if -D__EXTENSIONS__ is needed to use snprintf... yes
...

R.

milter-greylist 2.0beta4 released

2005-03-29 by Emmanuel Dreyfus

Enjoy:

http://ftp.espci.fr/pub/milter-greylist/milter-greylist-2.0b4.tgz
MD5 (milter-greylist-2.0b4.tgz) = a89b89a5dfd1a229ecde163c4c0e597c

Only one change from 2.0beta3:
2.0b4:
        Fix MX sync bug on Solaris, shut up warnings at build time

-- 
Emmanuel Dreyfus
manu@...

Re: milter-greylist 2.0beta4 released

2005-03-29 by ranko_z

Emanuel,

--- In milter-greylist@yahoogroups.com, Emmanuel Dreyfus <manu@n...>
wrote:
> Enjoy:
> 
> http://ftp.espci.fr/pub/milter-greylist/milter-greylist-2.0b4.tgz
> MD5 (milter-greylist-2.0b4.tgz) = a89b89a5dfd1a229ecde163c4c0e597c
> 
> Only one change from 2.0beta3:
> 2.0b4:
>         Fix MX sync bug on Solaris, shut up warnings at build time
> 

When you said that you have commited the changes, I thought that you
have also submitted the part that relates to the swap of the checks
for __EXTENSIONS__ and _REENTRANT. Without it (as it is now in 2.0b4)
the configure gives the following:

...
checking if -D__EXTENSIONS__ is needed to use snprintf... yes
checking if -D_REENTRANT is needed to use localtime_r... no
...

Whereas it should say (with the below patch enabled):

...
checking if -D_REENTRANT is needed to use localtime_r... yes
checking if -D__EXTENSIONS__ is needed to use snprintf... yes
...

Here is the patch that fixes the problem:

---CUT---
--- configure.ac-orig   2005-03-29 17:36:54.000000000 +0300
+++ configure.ac        2005-03-29 19:22:04.885469000 +0300
@@ -246,6 +246,28 @@
            [], [<time.h> defines timeradd]) timeradd=no])
 AC_MSG_RESULT([$timeradd])

+# Check if -D_REENTRANT is needed for localtime_r, gmtime_r
+SAVEDCFLAGS=$CFLAGS
+CFLAGS=$CFLAGS" -ansi -Wall -Werror"
+AC_MSG_CHECKING([if -D_REENTRANT is needed to use localtime_r])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+               #include <time.h>
+       ],[[
+
+               (void)localtime_r(NULL, NULL);
+       ]])], [dreentrant=no],
+               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+                               #define _REENTRANT
+                               #include <time.h>
+                       ],[[
+                                (void)localtime_r(NULL, NULL);
+                       ]])],
+                       [SAVEDCFLAGS=$SAVEDCFLAGS" -D_REENTRANT";
+                        dreentrant=yes], [dreentrant=no])
+       ])
+AC_MSG_RESULT([$dreentrant])
+CFLAGS=$SAVEDCFLAGS
+
 # Check if -D__EXTENSIONS__ is needed for snprintf, getopt, seteuid...
 SAVEDCFLAGS=$CFLAGS
 CFLAGS=$CFLAGS" -ansi -Wall -Werror"
@@ -271,28 +293,6 @@
 AC_MSG_RESULT([$dextensions])
 CFLAGS=$SAVEDCFLAGS

-# Check if -D_REENTRANT is needed for localtime_r, gmtime_r
-SAVEDCFLAGS=$CFLAGS
-CFLAGS=$CFLAGS" -ansi -Wall -Werror"
-AC_MSG_CHECKING([if -D_REENTRANT is needed to use localtime_r])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-               #include <time.h>
-       ],[[
-
-               (void)localtime(NULL);
-       ]])], [dreentrant=no],
-               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-                               #define _REENTRANT
-                               #include <stdio.h>
-                       ],[[
-                                (void)localtime(NULL);
-                       ]])],
-                       [SAVEDCFLAGS=$SAVEDCFLAGS" -D_REENTRANT";
-                        dreentrant=yes], [dreentrant=no])
-       ])
-AC_MSG_RESULT([$dreentrant])
-CFLAGS=$SAVEDCFLAGS
-
 # Check for libpthread. On FreeBSD, the libc_r does the job.
 # On digitalUNIX, libpthreads (with a trailing s) is the library to use
 AC_CHECK_LIB([pthread], [pthread_create],
---CUT---

I appologize if I have created the confusion.

Best regards,

Ranko

Re: [milter-greylist] Re: milter-greylist 2.0beta4 released

2005-03-29 by Emmanuel Dreyfus

On Tue, Mar 29, 2005 at 04:38:13PM -0000, ranko_z wrote:
> When you said that you have commited the changes, I thought that you
> have also submitted the part that relates to the swap of the checks
> for __EXTENSIONS__ and _REENTRANT. Without it (as it is now in 2.0b4)
> the configure gives the following:

No problem, let's roll out a beta5

-- 
Emmanuel Dreyfus
manu@...

Re: [milter-greylist] Re: milter-greylist 2.0beta4 released

2005-03-29 by manu@netbsd.org

ranko_z <ranko@...> wrote:

> I appologize if I have created the confusion.

Please check that this beta5 works as intended, and I'll make an
announce for it afterwards.

MD5 (milter-greylist-2.0b5.tgz) = 71349dc58661a46be78602ec1883d16c
http://ftp.espci.fr/pub/milter-greylist/milter-greylist-2.0b5.tgz

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] Re: milter-greylist 2.0beta4 released

2005-03-29 by manu@netbsd.org

Emmanuel Dreyfus <manu@...> wrote:

> Please check that this beta5 works as intended, and I'll make an
> announce for it afterwards.

Ooops, that was not meant to go public. Forget about it, everyone! :-)

-- 
Emmanuel Dreyfus
Un bouquin en français sur BSD:
http://www.eyrolles.com/Informatique/Livre/9782212114638/livre-bsd.php
manu@...

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.