;; IPv6 patch for cyrus-imapd-2.0.17 ;; Dec 5, 2002 by Hajimu UMEMOTO ;; Index: acconfig.h =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/acconfig.h,v retrieving revision 1.1.1.5 retrieving revision 1.7 diff -u -r1.1.1.5 -r1.7 --- acconfig.h 27 Apr 2001 10:22:30 -0000 1.1.1.5 +++ acconfig.h 27 Apr 2001 11:49:13 -0000 1.7 @@ -111,6 +111,12 @@ /* do we have rlim_t? */ #undef HAVE_RLIM_T +/* is IPv6 enabled? */ +#undef INET6 + +/* Define if you have ss_family in struct sockaddr_storage. */ +#undef HAVE_SS_FAMILY + @BOTTOM@ #ifndef __GNUC__ Index: aclocal.m4 =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/aclocal.m4,v retrieving revision 1.1.1.6 retrieving revision 1.8 diff -u -r1.1.1.6 -r1.8 --- aclocal.m4 28 Jul 2001 14:27:10 -0000 1.1.1.6 +++ aclocal.m4 28 Jul 2001 14:50:33 -0000 1.8 @@ -291,3 +291,71 @@ AC_SUBST(LIB_UCDSNMP) ]) +dnl See whether we can use IPv6 related functions +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_DEFINE_UNQUOTED($ac_tr_lib) + ac_cv_lib_socket_$1=no + ac_cv_lib_inet6_$1=no +], [dnl + AC_CHECK_LIB(socket, $1, [dnl + AC_DEFINE_UNQUOTED($ac_tr_lib) + LIBS="$LIBS -lsocket" + ac_cv_lib_inet6_$1=no + ], [dnl + AC_MSG_CHECKING([whether your system has IPv6 directory]) + AC_CACHE_VAL(ipv6_cv_dir, [dnl + for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do + if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then + break + fi + done])dnl + AC_MSG_RESULT($ipv6_cv_dir) + if test $ipv6_cv_dir = no; then + ac_cv_lib_inet6_$1=no + else + if test x$ipv6_libinet6 = x; then + ipv6_libinet6=no + SAVELDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$ipv6_cv_dir/lib" + fi + AC_CHECK_LIB(inet6, $1, [dnl + AC_DEFINE_UNQUOTED($ac_tr_lib) + if test $ipv6_libinet6 = no; then + ipv6_libinet6=yes + LIBS="$LIBS -linet6" + fi],)dnl + if test $ipv6_libinet6 = no; then + LDFLAGS="$SAVELDFLAGS" + fi + fi])dnl +])dnl +if test $ac_cv_func_$1 = yes -o $ac_cv_lib_socket_$1 = yes \ + -o $ac_cv_lib_inet6_$1 = yes +then + ipv6_cv_$1=yes + ifelse([$2], , :, [$2]) +else + ipv6_cv_$1=no + ifelse([$3], , :, [$3]) +fi]) + +dnl See whether we have ss_family in sockaddr_storage +AC_DEFUN(IPv6_CHECK_SS_FAMILY, [ +AC_MSG_CHECKING([whether you have ss_family in struct sockaddr_storage]) +AC_CACHE_VAL(ipv6_cv_ss_family, [dnl +AC_TRY_COMPILE([#include +#include ], + [struct sockaddr_storage ss; int i = ss.ss_family;], + [ipv6_cv_ss_family=yes], [ipv6_cv_ss_family=no])])dnl +if test $ipv6_cv_ss_family = yes; then + ifelse([$1], , AC_DEFINE(HAVE_SS_FAMILY), [$1]) +else + ifelse([$2], , :, [$2]) +fi +AC_MSG_RESULT($ipv6_cv_ss_family)]) + Index: config.h.in =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/config.h.in,v retrieving revision 1.1.1.8 retrieving revision 1.10 diff -u -r1.1.1.8 -r1.10 --- config.h.in 5 Dec 2002 06:32:57 -0000 1.1.1.8 +++ config.h.in 5 Dec 2002 07:30:01 -0000 1.10 @@ -134,6 +134,12 @@ /* Define if you have the dns_lookup function. */ #undef HAVE_DNS_LOOKUP +/* is IPv6 enabled? */ +#undef INET6 + +/* Define if you have ss_family in struct sockaddr_storage. */ +#undef HAVE_SS_FAMILY + /* Define if you have the ftruncate function. */ #undef HAVE_FTRUNCATE Index: configure =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/configure,v retrieving revision 1.1.1.9 retrieving revision 1.11 diff -u -r1.1.1.9 -r1.11 --- configure 28 Jul 2001 14:27:12 -0000 1.1.1.9 +++ configure 28 Jul 2001 14:50:33 -0000 1.11 @@ -64,6 +64,8 @@ --with-libwrap=DIR use libwrap (rooted in DIR) [yes] " ac_help="$ac_help --with-ucdsnmp=DIR use ucd snmp (rooted in DIR) [yes] " +ac_help="$ac_help + --disable-ipv6 Don't compile in IPv6 support" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -601,7 +603,7 @@ fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:605: checking host system type" >&5 +echo "configure:607: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -625,7 +627,7 @@ # Extract the first word of "makedepend", so it can be a program name with args. set dummy makedepend; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:629: checking for $ac_word" >&5 +echo "configure:631: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEDEPEND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -715,7 +717,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:719: checking for $ac_word" >&5 +echo "configure:721: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -745,7 +747,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:749: checking for $ac_word" >&5 +echo "configure:751: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -796,7 +798,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:800: checking for $ac_word" >&5 +echo "configure:802: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -828,7 +830,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:832: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:834: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -839,12 +841,12 @@ cat > conftest.$ac_ext << EOF -#line 843 "configure" +#line 845 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -870,12 +872,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:874: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:876: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:879: checking whether we are using GNU C" >&5 +echo "configure:881: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -884,7 +886,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -903,7 +905,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:907: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:909: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -937,7 +939,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:941: checking for $ac_word" >&5 +echo "configure:943: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -965,7 +967,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:969: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:971: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1003,7 +1005,7 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1007: checking for a BSD compatible install" >&5 +echo "configure:1009: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1056,7 +1058,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1060: checking how to run the C preprocessor" >&5 +echo "configure:1062: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1071,13 +1073,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1088,13 +1090,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1105,13 +1107,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1136,9 +1138,9 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1140: checking for AIX" >&5 +echo "configure:1142: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:1165: checking for strerror in -lcposix" >&5 +echo "configure:1167: checking for strerror in -lcposix" >&5 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1169,7 +1171,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1207,7 +1209,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1211: checking for $ac_word" >&5 +echo "configure:1213: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1237,12 +1239,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1241: checking for working const" >&5 +echo "configure:1243: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1312,7 +1314,7 @@ fi echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:1316: checking for long file names" >&5 +echo "configure:1318: checking for long file names" >&5 if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1362,7 +1364,7 @@ # CMU GUESS RUNPATH SWITCH echo $ac_n "checking for runpath switch""... $ac_c" 1>&6 -echo "configure:1366: checking for runpath switch" >&5 +echo "configure:1368: checking for runpath switch" >&5 if eval "test \"`echo '$''{'andrew_runpath_switch'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1371,14 +1373,14 @@ SAVE_LDFLAGS="${LDFLAGS}" LDFLAGS="-R /usr/lib" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* andrew_runpath_switch="-R" else @@ -1388,14 +1390,14 @@ LDFLAGS="-Wl,-rpath,/usr/lib" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* andrew_runpath_switch="-Wl,-rpath," else @@ -1427,17 +1429,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1431: checking for $ac_hdr" >&5 +echo "configure:1433: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1441: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1466,12 +1468,12 @@ for ac_func in memmove strcasecmp ftruncate strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1470: checking for $ac_func" >&5 +echo "configure:1472: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1525,12 +1527,12 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1529: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1531: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1538,7 +1540,7 @@ DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1563,7 +1565,7 @@ # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1567: checking for opendir in -ldir" >&5 +echo "configure:1569: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1571,7 +1573,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1604,7 +1606,7 @@ else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1608: checking for opendir in -lx" >&5 +echo "configure:1610: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1612,7 +1614,7 @@ ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1647,12 +1649,12 @@ echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:1651: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:1653: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1660,7 +1662,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:1664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -1681,12 +1683,12 @@ fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:1685: checking for tm_zone in struct tm" >&5 +echo "configure:1687: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -1694,7 +1696,7 @@ struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:1698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -1714,12 +1716,12 @@ else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:1718: checking for tzname" >&5 +echo "configure:1720: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -1729,7 +1731,7 @@ atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -1757,12 +1759,12 @@ echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1761: checking for vprintf" >&5 +echo "configure:1763: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -1809,12 +1811,12 @@ if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:1813: checking for _doprnt" >&5 +echo "configure:1815: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -1895,7 +1897,7 @@ for dbname in db-3.2 db3.2 db-3.1 db3.1 db-3 db3 db do echo $ac_n "checking for db_create in -l$dbname""... $ac_c" 1>&6 -echo "configure:1899: checking for db_create in -l$dbname" >&5 +echo "configure:1901: checking for db_create in -l$dbname" >&5 ac_lib_var=`echo $dbname'_'db_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1903,7 +1905,7 @@ ac_save_LIBS="$LIBS" LIBS="-l$dbname $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1972,7 +1974,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1976: checking for $ac_word" >&5 +echo "configure:1978: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2005,7 +2007,7 @@ # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2009: checking for $ac_word" >&5 +echo "configure:2011: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2039,7 +2041,7 @@ *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:2043: checking for yywrap in -l$ac_lib" >&5 +echo "configure:2045: checking for yywrap in -l$ac_lib" >&5 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2047,7 +2049,7 @@ ac_save_LIBS="$LIBS" LIBS="-l$ac_lib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2081,7 +2083,7 @@ fi echo $ac_n "checking for main in -lfl""... $ac_c" 1>&6 -echo "configure:2085: checking for main in -lfl" >&5 +echo "configure:2087: checking for main in -lfl" >&5 ac_lib_var=`echo fl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2089,14 +2091,14 @@ ac_save_LIBS="$LIBS" LIBS="-lfl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2126,14 +2128,14 @@ echo $ac_n "checking for library containing regcomp""... $ac_c" 1>&6 -echo "configure:2130: checking for library containing regcomp" >&5 +echo "configure:2132: checking for library containing regcomp" >&5 if eval "test \"`echo '$''{'ac_cv_search_regcomp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_regcomp="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_regcomp="none required" else @@ -2155,7 +2157,7 @@ test "$ac_cv_search_regcomp" = "no" && for i in rx regex; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_regcomp="-l$i" break @@ -2188,17 +2190,17 @@ ac_safe=`echo "rxposix.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for rxposix.h""... $ac_c" 1>&6 -echo "configure:2192: checking for rxposix.h" >&5 +echo "configure:2194: checking for rxposix.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2248,7 +2250,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2252: checking for $ac_word" >&5 +echo "configure:2254: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2295,12 +2297,12 @@ fi echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:2299: checking for strerror" >&5 +echo "configure:2301: checking for strerror" >&5 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strerror=yes" else @@ -2354,17 +2356,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2358: checking for $ac_hdr" >&5 +echo "configure:2360: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2368: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2393,12 +2395,12 @@ for ac_func in setrlimit do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2397: checking for $ac_func" >&5 +echo "configure:2399: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2447,7 +2449,7 @@ cat > conftest.$ac_ext < EOF @@ -2462,7 +2464,7 @@ rm -f conftest* cat > conftest.$ac_ext < EOF @@ -2479,12 +2481,12 @@ spt_type="" echo $ac_n "checking for setproctitle""... $ac_c" 1>&6 -echo "configure:2483: checking for setproctitle" >&5 +echo "configure:2485: checking for setproctitle" >&5 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_setproctitle=yes" else @@ -2528,7 +2530,7 @@ if test "$spt_type" = ""; then echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6 -echo "configure:2532: checking for setproctitle in -lutil" >&5 +echo "configure:2534: checking for setproctitle in -lutil" >&5 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2536,7 +2538,7 @@ ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2572,17 +2574,17 @@ if test "$spt_type" = ""; then ac_safe=`echo "sys/pstat.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/pstat.h""... $ac_c" 1>&6 -echo "configure:2576: checking for sys/pstat.h" >&5 +echo "configure:2578: checking for sys/pstat.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2588: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2607,17 +2609,17 @@ if test "$spt_type" = ""; then ac_safe=`echo "sys/sysnews.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/sysnews.h""... $ac_c" 1>&6 -echo "configure:2611: checking for sys/sysnews.h" >&5 +echo "configure:2613: checking for sys/sysnews.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2621: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2641,12 +2643,12 @@ fi if test "$spt_type" = ""; then echo $ac_n "checking for PS_STRINGS""... $ac_c" 1>&6 -echo "configure:2645: checking for PS_STRINGS" >&5 +echo "configure:2647: checking for PS_STRINGS" >&5 if eval "test \"`echo '$''{'cyrus_cv_sys_psstrings'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2656,7 +2658,7 @@ #endif EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2662: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2678,12 +2680,12 @@ fi if test "$spt_type" = ""; then echo $ac_n "checking for SCO""... $ac_c" 1>&6 -echo "configure:2682: checking for SCO" >&5 +echo "configure:2684: checking for SCO" >&5 if eval "test \"`echo '$''{'cyrus_cv_sys_sco'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2713,12 +2715,12 @@ fi if test "$spt_type" = ""; then echo $ac_n "checking for setproctitle usability""... $ac_c" 1>&6 -echo "configure:2717: checking for setproctitle usability" >&5 +echo "configure:2719: checking for setproctitle usability" >&5 if eval "test \"`echo '$''{'cyrus_cv_sys_setproctitle'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2754,12 +2756,12 @@ fi echo $ac_n "checking nonblocking method""... $ac_c" 1>&6 -echo "configure:2758: checking nonblocking method" >&5 +echo "configure:2760: checking nonblocking method" >&5 if eval "test \"`echo '$''{'cyrus_cv_sys_nonblock'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2771,7 +2773,7 @@ fcntl(0, F_GETFL, 0)&FNDELAY ; return 0; } EOF -if { (eval echo configure:2775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cyrus_cv_sys_nonblock=fcntl else @@ -2788,12 +2790,12 @@ echo "$ac_t""$WITH_NONBLOCK" 1>&6 echo $ac_n "checking timezone GMT offset method""... $ac_c" 1>&6 -echo "configure:2792: checking timezone GMT offset method" >&5 +echo "configure:2794: checking timezone GMT offset method" >&5 if eval "test \"`echo '$''{'cyrus_cv_struct_sys_gmtoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2803,7 +2805,7 @@ ; return 0; } EOF -if { (eval echo configure:2807: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cyrus_cv_struct_sys_gmtoff=tm else @@ -2819,7 +2821,7 @@ echo "$ac_t""$WITH_GMTOFF" 1>&6 echo $ac_n "checking for shared mmap""... $ac_c" 1>&6 -echo "configure:2823: checking for shared mmap" >&5 +echo "configure:2825: checking for shared mmap" >&5 if eval "test \"`echo '$''{'cyrus_cv_func_mmap_shared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2827,7 +2829,7 @@ cyrus_cv_func_mmap_shared=no else cat > conftest.$ac_ext < @@ -2855,7 +2857,7 @@ exit(0);} EOF -if { (eval echo configure:2859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cyrus_cv_func_mmap_shared=yes else @@ -2874,7 +2876,7 @@ WITH_MAP="shared" else echo $ac_n "checking for stupid shared mmap""... $ac_c" 1>&6 -echo "configure:2878: checking for stupid shared mmap" >&5 +echo "configure:2880: checking for stupid shared mmap" >&5 if eval "test \"`echo '$''{'cyrus_cv_func_mmap_stupidshared'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2882,7 +2884,7 @@ cyrus_cv_func_mmap_stupidshared=no else cat > conftest.$ac_ext < @@ -2911,7 +2913,7 @@ exit(0);} EOF -if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cyrus_cv_func_mmap_stupidshared=yes else @@ -2942,12 +2944,12 @@ WITH_LOCK="$withval" else echo $ac_n "checking for flock""... $ac_c" 1>&6 -echo "configure:2946: checking for flock" >&5 +echo "configure:2948: checking for flock" >&5 if eval "test \"`echo '$''{'ac_cv_func_flock'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_flock=yes" else @@ -3000,12 +3002,12 @@ else echo $ac_n "checking for sigvec""... $ac_c" 1>&6 -echo "configure:3004: checking for sigvec" >&5 +echo "configure:3006: checking for sigvec" >&5 if eval "test \"`echo '$''{'ac_cv_func_sigvec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sigvec=yes" else @@ -3049,7 +3051,7 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for sigvec in -lBSD""... $ac_c" 1>&6 -echo "configure:3053: checking for sigvec in -lBSD" >&5 +echo "configure:3055: checking for sigvec in -lBSD" >&5 ac_lib_var=`echo BSD'_'sigvec | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3057,7 +3059,7 @@ ac_save_LIBS="$LIBS" LIBS="-lBSD $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3090,7 +3092,7 @@ SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="-L/usr/ucblib -R/usr/ucblib $LDFLAGS" echo $ac_n "checking for sigvec in -lucb""... $ac_c" 1>&6 -echo "configure:3094: checking for sigvec in -lucb" >&5 +echo "configure:3096: checking for sigvec in -lucb" >&5 ac_lib_var=`echo ucb'_'sigvec | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3098,7 +3100,7 @@ ac_save_LIBS="$LIBS" LIBS="-lucb $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3194,16 +3196,16 @@ SAVE_LIBS="$LIBS" LIBS="$AFS_LIBS" echo $ac_n "checking if AFS libraries have pr_End""... $ac_c" 1>&6 -echo "configure:3198: checking if AFS libraries have pr_End" >&5 +echo "configure:3200: checking if AFS libraries have pr_End" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -3236,16 +3238,16 @@ SAVE_LIBS="$LIBS" LIBS="${with_afs}/lib/liblwp.a" echo $ac_n "checking if AFS libraries need sigvec""... $ac_c" 1>&6 -echo "configure:3240: checking if AFS libraries need sigvec" >&5 +echo "configure:3242: checking if AFS libraries need sigvec" >&5 cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""no" 1>&6 @@ -3301,7 +3303,7 @@ if test "$WITH_AUTH" = "krb" -o "$WITH_AUTH" = "krb_pts" ; then echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6 -echo "configure:3305: checking for res_search in -lresolv" >&5 +echo "configure:3307: checking for res_search in -lresolv" >&5 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3309,7 +3311,7 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3349,7 +3351,7 @@ echo $ac_n "checking for des_ecb_encrypt in -ldes""... $ac_c" 1>&6 -echo "configure:3353: checking for des_ecb_encrypt in -ldes" >&5 +echo "configure:3355: checking for des_ecb_encrypt in -ldes" >&5 ac_lib_var=`echo des'_'des_ecb_encrypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3357,7 +3359,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldes $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3392,7 +3394,7 @@ if test -d ${with_krb}; then echo $ac_n "checking for Kerberos includes""... $ac_c" 1>&6 -echo "configure:3396: checking for Kerberos includes" >&5 +echo "configure:3398: checking for Kerberos includes" >&5 if eval "test \"`echo '$''{'cyrus_krbinclude'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3418,17 +3420,17 @@ if test "$with_des" != no; then ac_safe=`echo "krb.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for krb.h""... $ac_c" 1>&6 -echo "configure:3422: checking for krb.h" >&5 +echo "configure:3424: checking for krb.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3445,7 +3447,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for krb_mk_priv in -lkrb""... $ac_c" 1>&6 -echo "configure:3449: checking for krb_mk_priv in -lkrb" >&5 +echo "configure:3451: checking for krb_mk_priv in -lkrb" >&5 ac_lib_var=`echo krb'_'krb_mk_priv | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3453,7 +3455,7 @@ ac_save_LIBS="$LIBS" LIBS="-lkrb -ldes $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3524,7 +3526,7 @@ ""|yes) LIB_RSAREF="" echo $ac_n "checking for RSAPublicEncrypt in -lrsaref""... $ac_c" 1>&6 -echo "configure:3528: checking for RSAPublicEncrypt in -lrsaref" >&5 +echo "configure:3530: checking for RSAPublicEncrypt in -lrsaref" >&5 ac_lib_var=`echo rsaref'_'RSAPublicEncrypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3532,7 +3534,7 @@ ac_save_LIBS="$LIBS" LIBS="-lrsaref $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3567,7 +3569,7 @@ with_openssl="yes" echo $ac_n "checking for BIO_accept in -lcrypto""... $ac_c" 1>&6 -echo "configure:3571: checking for BIO_accept in -lcrypto" >&5 +echo "configure:3573: checking for BIO_accept in -lcrypto" >&5 ac_lib_var=`echo crypto'_'BIO_accept | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3575,7 +3577,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIB_RSAREF $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3608,7 +3610,7 @@ fi echo $ac_n "checking for SSL_CTX_new in -lssl""... $ac_c" 1>&6 -echo "configure:3612: checking for SSL_CTX_new in -lssl" >&5 +echo "configure:3614: checking for SSL_CTX_new in -lssl" >&5 ac_lib_var=`echo ssl'_'SSL_CTX_new | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3616,7 +3618,7 @@ ac_save_LIBS="$LIBS" LIBS="-lssl -lcrypto $LIB_RSAREF $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3656,7 +3658,7 @@ esac echo $ac_n "checking for openssl""... $ac_c" 1>&6 -echo "configure:3660: checking for openssl" >&5 +echo "configure:3662: checking for openssl" >&5 echo "$ac_t""$with_openssl" 1>&6 if test "$with_openssl" != "no"; then @@ -3684,7 +3686,7 @@ case "$with_zephyr" in no) true;; ""|yes) echo $ac_n "checking for ZInitialize in -lzephyr""... $ac_c" 1>&6 -echo "configure:3688: checking for ZInitialize in -lzephyr" >&5 +echo "configure:3690: checking for ZInitialize in -lzephyr" >&5 ac_lib_var=`echo zephyr'_'ZInitialize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3692,7 +3694,7 @@ ac_save_LIBS="$LIBS" LIBS="-lzephyr $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3788,7 +3790,7 @@ if test -z "$with_com_err"; then # no value supplied echo $ac_n "checking for com_err in -lcom_err""... $ac_c" 1>&6 -echo "configure:3792: checking for com_err in -lcom_err" >&5 +echo "configure:3794: checking for com_err in -lcom_err" >&5 ac_lib_var=`echo com_err'_'com_err | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3796,7 +3798,7 @@ ac_save_LIBS="$LIBS" LIBS="-lcom_err $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3830,7 +3832,7 @@ # Extract the first word of "compile_et", so it can be a program name with args. set dummy compile_et; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3834: checking for $ac_word" >&5 +echo "configure:3836: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_COMPILE_ET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3872,7 +3874,7 @@ # Extract the first word of "/usr/local/bin/compile_et", so it can be a program name with args. set dummy /usr/local/bin/compile_et; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3876: checking for $ac_word" >&5 +echo "configure:3878: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_COMPILE_ET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3957,12 +3959,12 @@ echo $ac_n "checking for modern syslog""... $ac_c" 1>&6 -echo "configure:3961: checking for modern syslog" >&5 +echo "configure:3963: checking for modern syslog" >&5 if eval "test \"`echo '$''{'cyrus_cv_lib_syslog'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef LOG_LOCAL6 @@ -3970,7 +3972,7 @@ #endif EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3996,12 +3998,12 @@ for ac_func in getdtablesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4000: checking for $ac_func" >&5 +echo "configure:4002: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4073,12 +4075,12 @@ echo $ac_n "checking for dlopen""... $ac_c" 1>&6 -echo "configure:4077: checking for dlopen" >&5 +echo "configure:4079: checking for dlopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_dlopen=yes" else @@ -4119,7 +4121,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:4123: checking for dlopen in -ldl" >&5 +echo "configure:4125: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4127,7 +4129,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4195,17 +4197,17 @@ ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sasl.h""... $ac_c" 1>&6 -echo "configure:4199: checking for sasl.h" >&5 +echo "configure:4201: checking for sasl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4222,7 +4224,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for sasl_getprop in -lsasl""... $ac_c" 1>&6 -echo "configure:4226: checking for sasl_getprop in -lsasl" >&5 +echo "configure:4228: checking for sasl_getprop in -lsasl" >&5 ac_lib_var=`echo sasl'_'sasl_getprop | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4230,7 +4232,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsasl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4287,7 +4289,7 @@ fi echo $ac_n "checking for sasl_checkapop in -lsasl""... $ac_c" 1>&6 -echo "configure:4291: checking for sasl_checkapop in -lsasl" >&5 +echo "configure:4293: checking for sasl_checkapop in -lsasl" >&5 ac_lib_var=`echo sasl'_'sasl_checkapop | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4295,7 +4297,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsasl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4337,12 +4339,12 @@ save_LIBS="$LIBS" LIB_SOCKET="" echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:4341: checking for connect" >&5 +echo "configure:4343: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4383,7 +4385,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4387: checking for gethostbyname in -lnsl" >&5 +echo "configure:4389: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4391,7 +4393,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4423,7 +4425,7 @@ fi echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:4427: checking for connect in -lsocket" >&5 +echo "configure:4429: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4431,7 +4433,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4467,12 +4469,12 @@ LIBS="$LIB_SOCKET $save_LIBS" echo $ac_n "checking for res_search""... $ac_c" 1>&6 -echo "configure:4471: checking for res_search" >&5 +echo "configure:4473: checking for res_search" >&5 if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_res_search=yes" else @@ -4513,7 +4515,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6 -echo "configure:4517: checking for res_search in -lresolv" >&5 +echo "configure:4519: checking for res_search in -lresolv" >&5 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4521,7 +4523,7 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4559,12 +4561,12 @@ for ac_func in dn_expand dns_lookup do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4563: checking for $ac_func" >&5 +echo "configure:4565: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4631,7 +4633,7 @@ fi cmu_save_LIBS="$LIBS" echo $ac_n "checking for request_init in -lwrap""... $ac_c" 1>&6 -echo "configure:4635: checking for request_init in -lwrap" >&5 +echo "configure:4637: checking for request_init in -lwrap" >&5 ac_lib_var=`echo wrap'_'request_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4639,7 +4641,7 @@ ac_save_LIBS="$LIBS" LIBS="-lwrap ${LIB_SOCKET} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4667,17 +4669,17 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "tcpd.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for tcpd.h""... $ac_c" 1>&6 -echo "configure:4671: checking for tcpd.h" >&5 +echo "configure:4673: checking for tcpd.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4707,7 +4709,7 @@ LIBS="$cmu_save_LIBS" fi echo $ac_n "checking libwrap support""... $ac_c" 1>&6 -echo "configure:4711: checking libwrap support" >&5 +echo "configure:4713: checking libwrap support" >&5 echo "$ac_t""$with_libwrap" 1>&6 LIB_WRAP="" if test "$with_libwrap" != no; then @@ -4717,7 +4719,7 @@ LIB_WRAP="-lwrap" echo $ac_n "checking for yp_get_default_domain in -lnsl""... $ac_c" 1>&6 -echo "configure:4721: checking for yp_get_default_domain in -lnsl" >&5 +echo "configure:4723: checking for yp_get_default_domain in -lnsl" >&5 ac_lib_var=`echo nsl'_'yp_get_default_domain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4725,7 +4727,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4776,7 +4778,7 @@ fi cmu_save_LIBS="$LIBS" echo $ac_n "checking for sprint_objid in -lsnmp""... $ac_c" 1>&6 -echo "configure:4780: checking for sprint_objid in -lsnmp" >&5 +echo "configure:4782: checking for sprint_objid in -lsnmp" >&5 ac_lib_var=`echo snmp'_'sprint_objid | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4784,7 +4786,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsnmp ${LIB_SOCKET} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4812,17 +4814,17 @@ echo "$ac_t""yes" 1>&6 ac_safe=`echo "ucd-snmp/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for ucd-snmp/version.h""... $ac_c" 1>&6 -echo "configure:4816: checking for ucd-snmp/version.h" >&5 +echo "configure:4818: checking for ucd-snmp/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4852,7 +4854,7 @@ LIBS="$cmu_save_LIBS" fi echo $ac_n "checking UCD SNMP libraries""... $ac_c" 1>&6 -echo "configure:4856: checking UCD SNMP libraries" >&5 +echo "configure:4858: checking UCD SNMP libraries" >&5 echo "$ac_t""$with_ucdsnmp" 1>&6 LIB_UCDSNMP="" if test "$with_ucdsnmp" != no; then @@ -4866,6 +4868,238 @@ LIBS="$LIBS ${LIB_SOCKET}" + +# Check whether --enable-ipv6 or --disable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then + enableval="$enable_ipv6" + ipv6="$enableval" +else + ipv6="yes" +fi + +if test "$ipv6" != "yes"; then + echo "$ac_t""IPv6 support is disabled" 1>&6 +else + +ac_tr_lib=HAVE_`echo getaddrinfo | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` +echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6 +echo "configure:4888: checking for getaddrinfo" >&5 +if eval "test \"`echo '$''{'ac_cv_func_getaddrinfo'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getaddrinfo(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_getaddrinfo) || defined (__stub___getaddrinfo) +choke me +#else +getaddrinfo(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_getaddrinfo=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_getaddrinfo=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'getaddrinfo`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <&6 + echo $ac_n "checking for getaddrinfo in -lsocket""... $ac_c" 1>&6 +echo "configure:4940: checking for getaddrinfo in -lsocket" >&5 +ac_lib_var=`echo socket'_'getaddrinfo | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <&6 + echo $ac_n "checking whether your system has IPv6 directory""... $ac_c" 1>&6 +echo "configure:4984: checking whether your system has IPv6 directory" >&5 + if eval "test \"`echo '$''{'ipv6_cv_dir'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do + if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then + break + fi + done +fi + echo "$ac_t""$ipv6_cv_dir" 1>&6 + if test $ipv6_cv_dir = no; then + ac_cv_lib_inet6_getaddrinfo=no + else + if test x$ipv6_libinet6 = x; then + ipv6_libinet6=no + SAVELDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$ipv6_cv_dir/lib" + fi + echo $ac_n "checking for getaddrinfo in -linet6""... $ac_c" 1>&6 +echo "configure:5004: checking for getaddrinfo in -linet6" >&5 +ac_lib_var=`echo inet6'_'getaddrinfo | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-linet6 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <&6 +fi + if test $ipv6_libinet6 = no; then + LDFLAGS="$SAVELDFLAGS" + fi + fi +fi + +fi +if test $ac_cv_func_getaddrinfo = yes -o $ac_cv_lib_socket_getaddrinfo = yes \ + -o $ac_cv_lib_inet6_getaddrinfo = yes +then + ipv6_cv_getaddrinfo=yes + cat >> confdefs.h <<\EOF +#define INET6 1 +EOF + +else + ipv6_cv_getaddrinfo=no + : +fi + +echo $ac_n "checking whether you have ss_family in struct sockaddr_storage""... $ac_c" 1>&6 +echo "configure:5070: checking whether you have ss_family in struct sockaddr_storage" >&5 +if eval "test \"`echo '$''{'ipv6_cv_ss_family'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +int main() { +struct sockaddr_storage ss; int i = ss.ss_family; +; return 0; } +EOF +if { (eval echo configure:5083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ipv6_cv_ss_family=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ipv6_cv_ss_family=no +fi +rm -f conftest* +fi +if test $ipv6_cv_ss_family = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SS_FAMILY 1 +EOF + +else + : +fi +echo "$ac_t""$ipv6_cv_ss_family" 1>&6 +fi # Figure out what directories we're linking against. # Lots of fun for the whole family. Index: configure.in =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/configure.in,v retrieving revision 1.1.1.8 retrieving revision 1.9 diff -u -r1.1.1.8 -r1.9 --- configure.in 7 Jul 2001 22:10:26 -0000 1.1.1.8 +++ configure.in 8 Jul 2001 08:47:32 -0000 1.9 @@ -737,6 +737,15 @@ LIBS="$LIBS ${LIB_SOCKET}" +AC_ARG_ENABLE(ipv6, [ --disable-ipv6 Don't compile in IPv6 support], + ipv6="$enableval", ipv6="yes") +if test "$ipv6" != "yes"; then + AC_MSG_RESULT(IPv6 support is disabled) +else + IPv6_CHECK_FUNC(getaddrinfo, AC_DEFINE(INET6)) + IPv6_CHECK_SS_FAMILY() +fi + # Figure out what directories we're linking against. # Lots of fun for the whole family. # This probably chokes on anything with spaces in it. Index: acap/acap.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/acap/acap.c,v retrieving revision 1.1.1.3 retrieving revision 1.2 diff -u -r1.1.1.3 -r1.2 --- acap/acap.c 21 Feb 2001 16:59:30 -0000 1.1.1.3 +++ acap/acap.c 18 Jan 2002 08:37:59 -0000 1.2 @@ -245,6 +245,34 @@ static int acap_conn_do_connect(acap_conn_t *conn, char *host, char *port) { +#ifdef INET6 + struct addrinfo hints, *res0 = NULL, *res; + int err; + int sock = -1; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_CANONNAME; + if ((err = getaddrinfo(host, port, &hints, &res0)) != 0) { + return ACAP_NO_CONNECTION; + } + conn->host = strdup(res0->ai_canonname ? res0->ai_canonname : host); + + for (res = res0; res; res = res->ai_next) { + sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (sock < 0) + continue; + if (connect(sock, res->ai_addr, res->ai_addrlen) >= 0) + break; + close(sock); + sock = -1; + } + freeaddrinfo(res0); + if (sock < 0) { + return ACAP_NO_CONNECTION; + } +#else struct sockaddr_in addr; struct hostent *hp; struct servent *service; @@ -273,6 +301,7 @@ if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) { return ACAP_NO_CONNECTION; } +#endif conn->sock = sock; @@ -408,7 +437,11 @@ const char *mechs, sasl_callback_t *cb) { +#ifdef INET6 + struct sockaddr_storage sin; +#else struct sockaddr_in sin; +#endif sasl_security_properties_t *secprops=NULL; const char *mech; char *str; Index: imap/fud.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/imap/fud.c,v retrieving revision 1.1.1.6 retrieving revision 1.6 diff -u -r1.1.1.6 -r1.6 --- imap/fud.c 5 Dec 2002 06:33:08 -0000 1.1.1.6 +++ imap/fud.c 5 Dec 2002 07:30:04 -0000 1.6 @@ -83,12 +83,21 @@ extern char *optarg; /* forward decls */ +#ifdef INET6 +int handle_request(const char *who, const char *name, + struct sockaddr_storage sfrom); + +void send_reply(struct sockaddr_storage sfrom, int status, + const char *user, const char *mbox, + int numrecent, time_t lastread, time_t lastarrived); +#else int handle_request(const char *who, const char *name, struct sockaddr_in sfrom); void send_reply(struct sockaddr_in sfrom, int status, const char *user, const char *mbox, int numrecent, time_t lastread, time_t lastarrived); +#endif int soc; @@ -104,7 +113,11 @@ int begin_handling(void) { +#ifdef INET6 + struct sockaddr_storage sfrom; +#else struct sockaddr_in sfrom; +#endif socklen_t sfromsiz = sizeof(sfrom); int r; char buf[MAXLOGNAME + MAX_MAILBOX_NAME + 1]; @@ -189,8 +202,13 @@ shut_down(0); } +#ifdef INET6 +int handle_request(const char *who, const char *name, + struct sockaddr_storage sfrom) +#else int handle_request(const char *who, const char *name, struct sockaddr_in sfrom) +#endif { int r; struct mailbox mailbox; @@ -276,9 +294,15 @@ } void +#ifdef INET6 +send_reply(struct sockaddr_storage sfrom, int status, + const char *user, const char *mbox, + int numrecent, time_t lastread, time_t lastarrived) +#else send_reply(struct sockaddr_in sfrom, int status, const char *user, const char *mbox, int numrecent, time_t lastread, time_t lastarrived) +#endif { char buf[MAX_MAILBOX_PATH + 16 + 9]; int siz; Index: imap/imapd.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/imap/imapd.c,v retrieving revision 1.1.1.9 retrieving revision 1.13 diff -u -r1.1.1.9 -r1.13 --- imap/imapd.c 5 Dec 2002 06:33:07 -0000 1.1.1.9 +++ imap/imapd.c 5 Dec 2002 07:30:04 -0000 1.13 @@ -94,6 +94,15 @@ #include "tls.h" #endif /* HAVE_SSL */ +#ifdef INET6 +#ifndef NI_WITHSCOPEID +#define NI_WITHSCOPEID 0 +#endif +#ifndef HAVE_SS_FAMILY +#define ss_family __ss_family +#endif +#endif + extern int optind; extern char *optarg; extern int errno; @@ -105,7 +114,11 @@ /* per-user/session state */ struct protstream *imapd_out, *imapd_in; +#ifdef INET6 +static char imapd_clienthost[NI_MAXHOST*2+1] = "[local]"; +#else static char imapd_clienthost[250] = "[local]"; +#endif static time_t imapd_logtime; static int imapd_logfd = -1; char *imapd_userid; @@ -470,11 +483,16 @@ int service_main(int argc, char **argv, char **envp) { socklen_t salen; - struct hostent *hp; int timeout; sasl_security_properties_t *secprops = NULL; sasl_external_properties_t extprops; +#ifdef INET6 + char hbuf[NI_MAXHOST]; + struct sockaddr_storage imapd_localaddr, imapd_remoteaddr; +#else + struct hostent *hp; struct sockaddr_in imapd_localaddr, imapd_remoteaddr; +#endif int imapd_haveaddr = 0; signals_poll(); @@ -492,6 +510,28 @@ /* Find out name of client host */ salen = sizeof(imapd_remoteaddr); +#ifdef INET6 + if (getpeername(0, (struct sockaddr *)&imapd_remoteaddr, &salen) == 0 && + (imapd_remoteaddr.ss_family == AF_INET || + imapd_remoteaddr.ss_family == AF_INET6)) { + if (getnameinfo((struct sockaddr *)&imapd_remoteaddr, salen, + hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD) == 0) { + strncpy(imapd_clienthost, hbuf, sizeof(hbuf)); + } + else { + imapd_clienthost[0] = '\0'; + } + getnameinfo((struct sockaddr *)&imapd_remoteaddr, salen, hbuf, + sizeof(hbuf), NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); + strcat(imapd_clienthost, "["); + strcat(imapd_clienthost, hbuf); + strcat(imapd_clienthost, "]"); + salen = sizeof(imapd_localaddr); + if (getsockname(0, (struct sockaddr *)&imapd_localaddr, &salen) == 0) { + imapd_haveaddr = 1; + } + } +#else if (getpeername(0, (struct sockaddr *)&imapd_remoteaddr, &salen) == 0 && imapd_remoteaddr.sin_family == AF_INET) { hp = gethostbyaddr((char *)&imapd_remoteaddr.sin_addr, @@ -510,6 +550,7 @@ imapd_haveaddr = 1; } } +#endif /* create the SASL connection */ if (sasl_server_new("imap", config_servername, Index: imap/lmtpengine.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/imap/lmtpengine.c,v retrieving revision 1.1.1.7 retrieving revision 1.12 diff -u -r1.1.1.7 -r1.12 --- imap/lmtpengine.c 5 Dec 2002 06:33:07 -0000 1.1.1.7 +++ imap/lmtpengine.c 5 Dec 2002 07:48:55 -0000 1.12 @@ -87,6 +87,15 @@ #define RCPT_GROW 30 +#ifdef INET6 +#ifndef NI_WITHSCOPEID +#define NI_WITHSCOPEID 0 +#endif +#ifndef HAVE_SS_FAMILY +#define ss_family __ss_family +#endif +#endif + /* data per message */ struct Header { char *name; @@ -1005,7 +1014,11 @@ char *err; struct clientdata cd; +#ifdef INET6 + struct sockaddr_storage localaddr, remoteaddr; +#else struct sockaddr_in localaddr, remoteaddr; +#endif socklen_t salen; int secflags = 0; @@ -1038,8 +1051,25 @@ /* determine who we're talking to */ salen = sizeof(remoteaddr); r = getpeername(fd, (struct sockaddr *)&remoteaddr, &salen); - if (!r && remoteaddr.sin_family == AF_INET) { + if (!r && +#ifdef INET6 + (remoteaddr.ss_family == AF_INET || remoteaddr.ss_family == AF_INET6) +#else + remoteaddr.sin_family == AF_INET +#endif + ) { /* connected to an internet socket */ +#ifdef INET6 + char hbuf[NI_MAXHOST]; + getnameinfo((struct sockaddr *)&remoteaddr, salen, hbuf, sizeof(hbuf), + NULL, 0, NI_WITHSCOPEID); + strlcpy(cd.clienthost, hbuf, sizeof(cd.clienthost) - 30); + strlcat(cd.clienthost, " [", sizeof(cd.clienthost)); + getnameinfo((struct sockaddr *)&remoteaddr, salen, hbuf, sizeof(hbuf), + NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); + strlcat(cd.clienthost, hbuf, sizeof(cd.clienthost)); + strlcat(cd.clienthost, "]", sizeof(cd.clienthost)); +#else struct hostent *hp; hp = gethostbyaddr((char *)&remoteaddr.sin_addr, sizeof(remoteaddr.sin_addr), AF_INET); @@ -1053,6 +1083,7 @@ strlcat(cd.clienthost, inet_ntoa(remoteaddr.sin_addr), sizeof(cd.clienthost)); strlcat(cd.clienthost, "]", sizeof(cd.clienthost)); +#endif salen = sizeof(localaddr); if (!getsockname(fd, (struct sockaddr *)&localaddr, &salen)) { @@ -1646,18 +1677,59 @@ free(host); host = xstrdup(config_servername); } else { +#ifdef INET6 + struct addrinfo hints, *res0 = NULL, *res; + int err; +#else struct hostent *hp; struct sockaddr_in addr; struct servent *service; +#endif char *p; +#ifdef INET6 + if (*host == '[' && (p = strchr(host + 1, ']')) != NULL && + (*++p == '\0' || *p == ':')) { + host++; + *(p - 1) = '\0'; + if (*p != ':') + p = NULL; + } else + p = strchr(host, ':'); +#else p = strchr(host, ':'); +#endif if (p) { *p++ = '\0'; } else { p = "lmtp"; } +#ifdef INET6 + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + err = getaddrinfo(host, p, &hints, &res0); + if (err) { + syslog(LOG_ERR, "getaddrinfo(%s, %s) failed: %s", + host, p, gai_strerror(err)); + goto donesock; + } + for (res = res0; res; res = res->ai_next) { + sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (sock < 0) + continue; + if (connect(sock, res->ai_addr, res->ai_addrlen) >= 0) + break; + close(sock); + sock = -1; + } + freeaddrinfo(res0); + if (sock < 0) { + syslog(LOG_ERR, "connect(%s:%s) failed: %m", host, p); + goto donesock; + } +#else if ((hp = gethostbyname(host)) == NULL) { syslog(LOG_ERR, "gethostbyname(%s) failed", host); goto donesock; @@ -1687,6 +1759,7 @@ syslog(LOG_ERR, "connect(%s:%s) failed: %m", host, p); goto donesock; } +#endif } donesock: Index: imap/pop3d.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/imap/pop3d.c,v retrieving revision 1.1.1.9 retrieving revision 1.13 diff -u -r1.1.1.9 -r1.13 --- imap/pop3d.c 5 Dec 2002 06:33:06 -0000 1.1.1.9 +++ imap/pop3d.c 5 Dec 2002 07:30:04 -0000 1.13 @@ -94,6 +94,15 @@ #endif /* HAVE_KRB */ static int kflag = 0; +#ifdef INET6 +#ifndef NI_WITHSCOPEID +#define NI_WITHSCOPEID 0 +#endif +#ifndef HAVE_SS_FAMILY +#define ss_family __ss_family +#endif +#endif + extern int optind; extern char *optarg; extern int opterr; @@ -110,9 +119,17 @@ char *popd_userid = 0; struct mailbox *popd_mailbox = 0; +#ifdef INET6 +struct sockaddr_storage popd_localaddr, popd_remoteaddr; +#else struct sockaddr_in popd_localaddr, popd_remoteaddr; +#endif int popd_haveaddr = 0; +#ifdef INET6 +char popd_clienthost[NI_MAXHOST*2+1] = "[local]"; +#else char popd_clienthost[250] = "[local]"; +#endif struct protstream *popd_out, *popd_in; unsigned popd_exists = 0; unsigned popd_highest; @@ -264,7 +281,11 @@ int service_main(int argc, char **argv, char **envp) { socklen_t salen; +#ifdef INET6 + char hbuf[NI_MAXHOST]; +#else struct hostent *hp; +#endif int timeout; sasl_security_properties_t *secprops=NULL; @@ -275,6 +296,28 @@ /* Find out name of client host */ salen = sizeof(popd_remoteaddr); +#ifdef INET6 + if (getpeername(0, (struct sockaddr *)&popd_remoteaddr, &salen) == 0 && + (popd_remoteaddr.ss_family == AF_INET || + popd_remoteaddr.ss_family == AF_INET6)) { + if (getnameinfo((struct sockaddr *)&popd_remoteaddr, salen, + hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD) == 0) { + strncpy(popd_clienthost, hbuf, sizeof(hbuf)); + } + else { + popd_clienthost[0] = '\0'; + } + getnameinfo((struct sockaddr *)&popd_remoteaddr, salen, hbuf, + sizeof(hbuf), NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); + strcat(popd_clienthost, "["); + strcat(popd_clienthost, hbuf); + strcat(popd_clienthost, "]"); + salen = sizeof(popd_localaddr); + if (getsockname(0, (struct sockaddr *)&popd_localaddr, &salen) == 0) { + popd_haveaddr = 1; + } + } +#else if (getpeername(0, (struct sockaddr *)&popd_remoteaddr, &salen) == 0 && popd_remoteaddr.sin_family == AF_INET) { hp = gethostbyaddr((char *)&popd_remoteaddr.sin_addr, @@ -293,6 +336,7 @@ popd_haveaddr = 1; } } +#endif /* other params should be filled in */ if (sasl_server_new("pop", config_servername, NULL, Index: imap/pop3proxyd.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/imap/pop3proxyd.c,v retrieving revision 1.1.1.7 retrieving revision 1.11 diff -u -r1.1.1.7 -r1.11 --- imap/pop3proxyd.c 5 Dec 2002 06:33:06 -0000 1.1.1.7 +++ imap/pop3proxyd.c 5 Dec 2002 07:30:04 -0000 1.11 @@ -91,6 +91,15 @@ #endif /* HAVE_KRB */ static int kflag = 0; +#ifdef INET6 +#ifndef NI_WITHSCOPEID +#define NI_WITHSCOPEID 0 +#endif +#ifndef HAVE_SS_FAMILY +#define ss_family __ss_family +#endif +#endif + extern int optind; extern char *optarg; extern int opterr; @@ -106,9 +115,17 @@ sasl_conn_t *popd_saslconn; /* the sasl connection context */ char *popd_userid = 0; +#ifdef INET6 +struct sockaddr_storage popd_localaddr, popd_remoteaddr; +#else struct sockaddr_in popd_localaddr, popd_remoteaddr; +#endif int popd_haveaddr = 0; +#ifdef INET6 +char popd_clienthost[NI_MAXHOST*2+1] = "[local]"; +#else char popd_clienthost[250] = "[local]"; +#endif struct protstream *popd_out, *popd_in; int popd_starttls_done = 0; int popd_auth_done = 0; @@ -189,7 +206,11 @@ int pop3s = 0; int opt; socklen_t salen; +#ifdef INET6 + char hbuf[NI_MAXHOST]; +#else struct hostent *hp; +#endif int timeout; sasl_security_properties_t *secprops=NULL; @@ -220,6 +241,28 @@ /* Find out name of client host */ salen = sizeof(popd_remoteaddr); +#ifdef INET6 + if (getpeername(0, (struct sockaddr *)&popd_remoteaddr, &salen) == 0 && + (popd_remoteaddr.ss_family == AF_INET || + popd_remoteaddr.ss_family == AF_INET6)) { + if (getnameinfo((struct sockaddr *)&popd_remoteaddr, salen, + hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD) == 0) { + strncpy(popd_clienthost, hbuf, sizeof(hbuf)); + } + else { + popd_clienthost[0] = '\0'; + } + getnameinfo((struct sockaddr *)&popd_remoteaddr, salen, hbuf, + sizeof(hbuf), NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); + strcat(popd_clienthost, "["); + strcat(popd_clienthost, hbuf); + strcat(popd_clienthost, "]"); + salen = sizeof(popd_localaddr); + if (getsockname(0, (struct sockaddr *)&popd_localaddr, &salen) == 0) { + popd_haveaddr = 1; + } + } +#else if (getpeername(0, (struct sockaddr *)&popd_remoteaddr, &salen) == 0 && popd_remoteaddr.sin_family == AF_INET) { hp = gethostbyaddr((char *)&popd_remoteaddr.sin_addr, @@ -238,6 +281,7 @@ popd_haveaddr = 1; } } +#endif /* other params should be filled in */ if (sasl_server_new("pop", config_servername, NULL, @@ -1022,11 +1066,19 @@ { int r; sasl_security_properties_t *secprops = NULL; +#ifdef INET6 + struct sockaddr *saddr_l = + (struct sockaddr *) malloc(sizeof(struct sockaddr_storage)); + struct sockaddr *saddr_r = + (struct sockaddr *) malloc(sizeof(struct sockaddr_storage)); + socklen_t addrsize = sizeof(struct sockaddr_storage); +#else struct sockaddr_in *saddr_l = (struct sockaddr_in *) malloc(sizeof(struct sockaddr_in)); struct sockaddr_in *saddr_r = (struct sockaddr_in *) malloc(sizeof(struct sockaddr_in)); socklen_t addrsize = sizeof(struct sockaddr_in); +#endif sasl_callback_t *cb; char buf[2048]; char optstr[128]; @@ -1063,7 +1115,11 @@ r = sasl_setprop(backend_saslconn, SASL_IP_REMOTE, saddr_r); if (r != SASL_OK) return r; +#ifdef INET6 + addrsize=sizeof(struct sockaddr_storage); +#else addrsize=sizeof(struct sockaddr_in); +#endif if (getsockname(backend_sock, (struct sockaddr *)saddr_l,&addrsize)!=0) return SASL_FAIL; r = sasl_setprop(backend_saslconn, SASL_IP_LOCAL, saddr_l); @@ -1135,8 +1191,12 @@ static void openproxy(void) { +#ifdef INET6 + struct addrinfo hints, *res0 = NULL, *res; +#else struct hostent *hp; struct sockaddr_in sin; +#endif char inboxname[MAX_MAILBOX_PATH]; int r; char *server; @@ -1147,6 +1207,28 @@ r = mboxlist_lookup(inboxname, &server, NULL, NULL); if (!r) fatal("couldn't find backend server", EC_CONFIG); +#ifdef INET6 + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + if (getaddrinfo(server, "110", &hints, &res0)) + fatal("getaddrinfo failed", EC_CONFIG); + for (res = res0; res; res = res->ai_next) { + backend_sock = socket(res->ai_family, res->ai_socktype, + res->ai_protocol); + if (backend_sock < 0) + continue; + if (connect(backend_sock, res->ai_addr, res->ai_addrlen) >= 0) + break; + close(backend_sock); + backend_sock = -1; + } + freeaddrinfo(res0); + if (backend_sock < 0) { + syslog(LOG_ERR, "connect() failed: %m"); + fatal("connect failed", 1); + } +#else hp = gethostbyname(server); if (!hp) fatal("gethostbyname failed", EC_CONFIG); sin.sin_family = AF_INET; @@ -1161,6 +1243,7 @@ syslog(LOG_ERR, "connect() failed: %m"); fatal("connect failed", 1); } +#endif backend_in = prot_new(backend_sock, 0); backend_out = prot_new(backend_sock, 1); Index: imap/proxyd.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/imap/proxyd.c,v retrieving revision 1.1.1.6 retrieving revision 1.10 diff -u -r1.1.1.6 -r1.10 --- imap/proxyd.c 5 Dec 2002 06:33:06 -0000 1.1.1.6 +++ imap/proxyd.c 5 Dec 2002 07:30:04 -0000 1.10 @@ -93,6 +93,15 @@ #include "pushstats.h" #include "telemetry.h" +#ifdef INET6 +#ifndef NI_WITHSCOPEID +#define NI_WITHSCOPEID 0 +#endif +#ifndef HAVE_SS_FAMILY +#define ss_family __ss_family +#endif +#endif + /* PROXY STUFF */ /* we want a list of our outgoing connections here and which one we're currently piping */ @@ -103,7 +112,11 @@ struct backend { char *hostname; +#ifdef INET6 + struct sockaddr_storage addr; +#else struct sockaddr_in addr; +#endif int sock; struct prot_waitevent *timeout; @@ -155,9 +168,17 @@ char *proxyd_userid; struct auth_state *proxyd_authstate = 0; int proxyd_userisadmin; +#ifdef INET6 +struct sockaddr_storage proxyd_localaddr, proxyd_remoteaddr; +#else struct sockaddr_in proxyd_localaddr, proxyd_remoteaddr; +#endif int proxyd_haveaddr = 0; +#ifdef INET6 +char proxyd_clienthost[NI_MAXHOST*2+1] = "[local]"; +#else char proxyd_clienthost[250] = "[local]"; +#endif struct protstream *proxyd_out, *proxyd_in; time_t proxyd_logtime; static char shutdownfilename[1024]; @@ -543,11 +564,19 @@ { int r; sasl_security_properties_t *secprops = NULL; +#ifdef INET6 + struct sockaddr *saddr_l = + (struct sockaddr *) malloc(sizeof(struct sockaddr_storage)); + struct sockaddr *saddr_r = + (struct sockaddr *) malloc(sizeof(struct sockaddr_storage)); + socklen_t addrsize = sizeof(struct sockaddr_storage); +#else struct sockaddr_in *saddr_l = (struct sockaddr_in *) malloc(sizeof(struct sockaddr_in)); struct sockaddr_in *saddr_r = (struct sockaddr_in *) malloc(sizeof(struct sockaddr_in)); socklen_t addrsize = sizeof(struct sockaddr_in); +#endif sasl_callback_t *cb; char mytag[128]; char buf[2048]; @@ -585,7 +614,11 @@ r = sasl_setprop(s->saslconn, SASL_IP_REMOTE, saddr_r); if (r == SASL_OK) { +#ifdef INET6 + addrsize=sizeof(struct sockaddr_storage); +#else addrsize=sizeof(struct sockaddr_in); +#endif if (getsockname(s->sock, (struct sockaddr *)saddr_l,&addrsize)!=0) return SASL_FAIL; r = sasl_setprop(s->saslconn, SASL_IP_LOCAL, saddr_l); @@ -745,11 +778,14 @@ } if (!ret) { +#ifndef INET6 struct hostent *hp; +#endif ret = xmalloc(sizeof(struct backend)); memset(ret, 0, sizeof(struct backend)); ret->hostname = xstrdup(server); +#ifndef INET6 if ((hp = gethostbyname(server)) == NULL) { syslog(LOG_ERR, "gethostbyname(%s) failed: %m", server); free(ret); @@ -758,15 +794,45 @@ ret->addr.sin_family = AF_INET; memcpy(&ret->addr.sin_addr, hp->h_addr, hp->h_length); ret->addr.sin_port = htons(143); +#endif ret->timeout = NULL; } if (!ret->timeout) { /* need to (re)establish connection to server or create one */ - int sock; + int sock = -1; int r; - +#ifdef INET6 + int err; + struct addrinfo hints, *res0 = NULL, *res; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + err = getaddrinfo(server, "143", &hints, &res0); + if (err) { + syslog(LOG_ERR, "getaddrinfo(%s) failed: %s", + server, gai_strerror(err)); + free(ret); + return NULL; + } + for (res = res0; res; res = res->ai_next) { + sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (sock < 0) + continue; + if (connect(sock, res->ai_addr, res->ai_addrlen) >= 0) + break; + close(sock); + sock = -1; + } + freeaddrinfo(res0); + if (sock < 0) { + syslog(LOG_ERR, "connect(%s) failed: %m", server); + free(ret); + return NULL; + } +#else if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { syslog(LOG_ERR, "socket() failed: %m"); free(ret); @@ -778,6 +844,7 @@ free(ret); return NULL; } +#endif ret->in = prot_new(sock, 0); ret->out = prot_new(sock, 1); @@ -1030,7 +1097,11 @@ int imaps = 0; int opt; socklen_t salen; +#ifdef INET6 + char hbuf[NI_MAXHOST]; +#else struct hostent *hp; +#endif int timeout; sasl_security_properties_t *secprops = NULL; sasl_external_properties_t extprops; @@ -1070,6 +1141,29 @@ /* Find out name of client host */ salen = sizeof(proxyd_remoteaddr); +#ifdef INET6 + if (getpeername(0, (struct sockaddr *)&proxyd_remoteaddr, &salen) == 0 && + (proxyd_remoteaddr.ss_family == AF_INET || + proxyd_remoteaddr.ss_family == AF_INET6)) { + if (getnameinfo((struct sockaddr *)&proxyd_remoteaddr, salen, + hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD) == 0) { + strncpy(proxyd_clienthost, hbuf, sizeof(hbuf)); + } + else { + proxyd_clienthost[0] = '\0'; + } + getnameinfo((struct sockaddr *)&proxyd_remoteaddr, salen, hbuf, + sizeof(hbuf), NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); + strcat(proxyd_clienthost, "["); + strcat(proxyd_clienthost, hbuf); + strcat(proxyd_clienthost, "]"); + salen = sizeof(proxyd_localaddr); + if (getsockname(0, (struct sockaddr *)&proxyd_localaddr, + &salen) == 0) { + proxyd_haveaddr = 1; + } + } +#else if (getpeername(0, (struct sockaddr *)&proxyd_remoteaddr, &salen) == 0 && proxyd_remoteaddr.sin_family == AF_INET) { hp = gethostbyaddr((char *)&proxyd_remoteaddr.sin_addr, @@ -1089,6 +1183,7 @@ proxyd_haveaddr = 1; } } +#endif /* create the SASL connection */ /* Make a SASL connection and setup some properties for it */ Index: imtest/imtest.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/imtest/imtest.c,v retrieving revision 1.1.1.6 retrieving revision 1.6 diff -u -r1.1.1.6 -r1.6 --- imtest/imtest.c 27 Apr 2001 10:22:48 -0000 1.1.1.6 +++ imtest/imtest.c 27 Apr 2001 11:49:41 -0000 1.6 @@ -571,13 +571,23 @@ * Initialize SASL and set necessary options */ +#ifdef INET6 +static int init_sasl(char *serverFQDN, char *port, int minssf, int maxssf) +#else static int init_sasl(char *serverFQDN, int port, int minssf, int maxssf) +#endif { int saslresult; sasl_security_properties_t *secprops=NULL; +#ifdef INET6 + socklen_t addrsize=sizeof(struct sockaddr_storage); + struct sockaddr *saddr_l=malloc(sizeof(struct sockaddr_storage)); + struct sockaddr *saddr_r=malloc(sizeof(struct sockaddr_storage)); +#else socklen_t addrsize=sizeof(struct sockaddr_in); struct sockaddr_in *saddr_l=malloc(sizeof(struct sockaddr_in)); struct sockaddr_in *saddr_r=malloc(sizeof(struct sockaddr_in)); +#endif /* attempt to start sasl */ saslresult=sasl_client_init(callbacks); @@ -607,7 +617,11 @@ if (sasl_setprop(conn, SASL_IP_REMOTE, saddr_r)!=SASL_OK) return IMTEST_FAIL; +#ifdef INET6 + addrsize=sizeof(struct sockaddr_storage); +#else addrsize=sizeof(struct sockaddr_in); +#endif if (getsockname(sock,(struct sockaddr *)saddr_l,&addrsize)!=0) return IMTEST_FAIL; @@ -852,6 +866,37 @@ } /* initialize the network */ +#ifdef INET6 +int init_net(char *serverFQDN, char *port) +{ + struct addrinfo hints, *res0 = NULL, *res; + int err; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_CANONNAME; + if ((err = getaddrinfo(serverFQDN, port, &hints, &res0)) != 0) { + fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(err)); + return IMTEST_FAIL; + } + if (res0->ai_canonname) + strncpy(serverFQDN, res0->ai_canonname, 1023); + for (res = res0; res; res = res->ai_next) { + sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (sock < 0) + continue; + if (connect(sock, res->ai_addr, res->ai_addrlen) >= 0) + break; + close(sock); + sock = -1; + } + freeaddrinfo(res0); + if (sock < 0) { + perror("connect"); + return IMTEST_FAIL; + } +#else int init_net(char *serverFQDN, int port) { struct sockaddr_in addr; @@ -876,6 +921,7 @@ perror("connect"); return IMTEST_FAIL; } +#endif return IMTEST_OK; } @@ -1179,7 +1225,9 @@ char *tls_keyfile=""; char *port = "imap"; struct servent *serv; +#ifndef INET6 int servport; +#endif int run_stress_test=0; int dotls=0; int server_supports_tls; @@ -1243,6 +1291,15 @@ /* last arg is server name */ strncpy(servername, argv[optind], 1023); +#ifdef INET6 + if (init_net(servername, port) != IMTEST_OK) { + imtest_fatal("Network initialization"); + } + + if (init_sasl(servername, port, minssf, maxssf) != IMTEST_OK) { + imtest_fatal("SASL initialization"); + } +#else /* map port -> num */ serv = getservbyname(port, "tcp"); if (serv == NULL) { @@ -1258,6 +1315,7 @@ if (init_sasl(servername, servport, minssf, maxssf) != IMTEST_OK) { imtest_fatal("SASL initialization"); } +#endif /* set up the prot layer */ pin = prot_new(sock, 0); Index: lib/imclient.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/lib/imclient.c,v retrieving revision 1.1.1.7 retrieving revision 1.6 diff -u -r1.1.1.7 -r1.6 --- lib/imclient.c 28 Jul 2001 14:27:33 -0000 1.1.1.7 +++ lib/imclient.c 28 Jul 2001 14:50:36 -0000 1.6 @@ -214,14 +214,40 @@ const char *port, sasl_callback_t *cbs) { - int s; + int s = -1; +#ifdef INET6 + struct addrinfo hints, *res0 = NULL, *res; + int err; +#else struct hostent *hp; struct servent *sp; struct sockaddr_in addr; +#endif static struct imclient zeroimclient; int saslresult; static didinit; +#ifdef INET6 + if (!port) + port = "143"; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_CANONNAME; + if (getaddrinfo(host, port, &hints, &res0)) + return -1; + for (res = res0; res; res = res->ai_next) { + s = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (s < 0) + continue; + if (connect(s, res->ai_addr, res->ai_addrlen) >= 0) + break; + close(s); + s = -1; + } + if (s < 0) + return errno; +#else hp = gethostbyname(host); if (!hp) return -1; @@ -244,13 +270,20 @@ if (connect(s, (struct sockaddr *)&addr, sizeof(addr)) == -1) { return errno; } +#endif /* nonblock(s, 1); */ *imclient = (struct imclient *)xmalloc(sizeof(struct imclient)); **imclient = zeroimclient; (*imclient)->fd = s; (*imclient)->saslconn = NULL; (*imclient)->saslcompleted = 0; +#ifdef INET6 + (*imclient)->servername = xstrdup(res0->ai_canonname ? + res0->ai_canonname : host); + freeaddrinfo(res0); +#else (*imclient)->servername = xstrdup(hp->h_name); +#endif (*imclient)->outptr = (*imclient)->outstart = (*imclient)->outbuf; (*imclient)->outleft = (*imclient)->maxplain = sizeof((*imclient)->outbuf); imclient_addcallback(*imclient, Index: master/master.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/master/master.c,v retrieving revision 1.1.1.8 retrieving revision 1.18 diff -u -r1.1.1.8 -r1.18 --- master/master.c 28 Jul 2001 14:27:44 -0000 1.1.1.8 +++ master/master.c 28 Jul 2001 14:50:39 -0000 1.18 @@ -78,6 +78,12 @@ #define INADDR_ANY 0x00000000 #endif +#ifdef INET6 +#if !defined(IPV6_V6ONLY) && defined(IPV6_BINDV6ONLY) +#define IPV6_V6ONLY IPV6_BINDV6ONLY +#endif +#endif + #ifdef HAVE_UCDSNMP #include #include @@ -240,6 +246,22 @@ return port; } +char *parse_host(char *listen) +{ + char *cp; + + /* do we have a hostname, or IP number? */ + /* XXX are brackets necessary, like for IPv6 later? */ + if (*listen == '[') { + listen++; /* skip first bracket */ + if ((cp = strrchr(listen,']')) != NULL) { + *cp = '\0'; + } + } + return listen; +} + +#ifndef INET6 /* set sin_port accordingly. return of 0 indicates failure. */ int resolve_port(char *port, struct service *s, struct sockaddr_in *sin) { @@ -264,16 +286,8 @@ int resolve_host(char *listen, struct sockaddr_in *sin) { struct hostent *hp; - char *cp; - /* do we have a hostname, or IP number? */ - /* XXX are brackets necessary, like for IPv6 later? */ - if (*listen == '[') { - listen++; /* skip first bracket */ - if ((cp = strrchr(listen,']')) != NULL) { - *cp = '\0'; - } - } + listen = parse_host(listen); sin->sin_addr.s_addr = inet_addr(listen); if ((sin->sin_addr.s_addr == INADDR_NONE) || (sin->sin_addr.s_addr == 0)) { /* looks like it isn't an IP address, so look up the host */ @@ -293,16 +307,171 @@ } return 1; } +#endif void service_create(struct service *s) { +#ifdef INET6 + struct service service0, service; + struct addrinfo hints, *res0, *res; + struct sockaddr_storage sin; + int error, nsocket = 0; +#else struct sockaddr_in sin; - struct sockaddr_un sunsock; struct sockaddr *sa; + int salen; +#endif + struct sockaddr_un sunsock; mode_t oldumask; - int on = 1, salen; + int on = 1; int r; +#ifdef INET6 + if (s->associate) + return; /* service is already activated */ + + if (s->listen[0] == '/') { /* unix socket */ + res0 = (struct addrinfo *)malloc(sizeof(struct addrinfo)); + if (!res0) + fatal("out of memory", EX_UNAVAILABLE); + memset(res0, 0, sizeof(struct addrinfo)); + res0->ai_flags = AI_PASSIVE; + res0->ai_family = PF_UNIX; + res0->ai_socktype = SOCK_STREAM; + res0->ai_addr = (struct sockaddr *)&sunsock; + res0->ai_addrlen = sizeof(sunsock.sun_family) + strlen(s->listen) + 1; +#ifdef SIN6_LEN + res0->ai_addrlen += sizeof(sunsock.sun_len); + sunsock.sun_len = res0->ai_addrlen; +#endif + sunsock.sun_family = AF_UNIX; + strcpy(sunsock.sun_path, s->listen); + unlink(s->listen); + } else { /* inet socket */ + char *listen, *port; + char *listen_addr; + + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_PASSIVE; + hints.ai_family = PF_UNSPEC; + if (!strcmp(s->proto, "tcp")) + hints.ai_socktype = SOCK_STREAM; + else if (!strcmp(s->proto, "udp")) + hints.ai_socktype = SOCK_DGRAM; + else { + syslog(LOG_INFO, "invalid proto '%s', disabling %s", + s->proto, s->name); + s->exec = NULL; + return; + } + + /* parse_listen() and resolve_host() are destructive, + * so make a work copy of s->listen + */ + listen = strdup(s->listen); + + if ((port = parse_listen(listen)) == NULL) { + /* listen IS the port */ + port = listen; + listen_addr = NULL; + + } else { + /* s->listen is now just the address */ + listen_addr = parse_host(listen); + if (*listen_addr == '\0') + listen_addr = NULL; + } + error = getaddrinfo(listen_addr, port, &hints, &res0); + + free(listen); + + if (error) { + syslog(LOG_INFO, "%s, disabling %s", gai_strerror(error), s->name); + s->exec = NULL; + return; + } + } + + memcpy(&service0, s, sizeof(struct service)); + + for (res = res0; res; res = res->ai_next) { + if (s->socket > 0) { + memcpy(&service, &service0, sizeof(struct service)); + s = &service; + s->associate = 1; + } + + s->socket = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (s->socket < 0) { + s->socket = 0; + if (verbose > 2) + syslog(LOG_ERR, "unable to open %s socket: %m", s->name); + continue; + } + + /* allow reuse of address */ + r = setsockopt(s->socket, SOL_SOCKET, SO_REUSEADDR, + (void *) &on, sizeof(on)); + if (r < 0) { + syslog(LOG_ERR, "unable to setsocketopt(SO_REUSEADDR): %m"); + } + +#if defined(IPV6_V6ONLY) && !(defined(__FreeBSD__) && __FreeBSD__ < 3) + if (res->ai_family == AF_INET6) { + r = setsockopt(s->socket, IPPROTO_IPV6, IPV6_V6ONLY, + (void *) &on, sizeof(on)); + if (r < 0) { + syslog(LOG_ERR, "unable to setsocketopt(IPV6_V6ONLY): %m"); + } + } +#endif + + oldumask = umask((mode_t) 0); /* for linux */ + r = bind(s->socket, res->ai_addr, res->ai_addrlen); + umask(oldumask); + if (r < 0) { + close(s->socket); + s->socket = 0; + if (verbose > 2) + syslog(LOG_ERR, "unable to bind to %s socket: %m", s->name); + continue; + } + + if (s->listen[0] == '/') { /* unix socket */ + /* for DUX, where this isn't the default. + (harmlessly fails on some systems) */ + chmod(s->listen, (mode_t) 0777); + } + + if (listen(s->socket, listen_queue_backlog) < 0) { + syslog(LOG_ERR, "unable to listen to %s socket: %m", s->name); + close(s->socket); + s->socket = 0; + continue; + } + + s->ready_workers = 0; + + get_statsock(s->stat); + + if (s == &service) { + if (nservices == allocservices) { + Services = realloc(Services, + (allocservices+=5) * sizeof(struct service)); + if (!Services) fatal("out of memory", EX_UNAVAILABLE); + } + memcpy(&Services[nservices++], s, sizeof(struct service)); + } + nsocket++; + } + if (res0) + freeaddrinfo(res0); + if (nsocket <= 0) { + syslog(LOG_ERR, "unable to create %s listener socket: %m", s->name); + s->exec = NULL; + return; + } +#else memset(&sin, 0, sizeof(sin)); if (s->listen[0] == '/') { /* unix socket */ @@ -391,6 +560,7 @@ s->ready_workers = 0; get_statsock(s->stat); +#endif } void run_startup(char **cmd) @@ -804,6 +974,9 @@ char *proto = mystrdup(masterconf_getstring(e, "proto", "tcp")); char *max = mystrdup(masterconf_getstring(e, "maxchild", "-1")); int i; +#ifdef INET6 + int j; +#endif if (!cmd || !listen) { char buf[256]; @@ -814,6 +987,10 @@ /* see if we have an existing entry for this service */ for (i = 0; i < nservices; i++) { +#ifdef INET6 + if (Services[i].associate) + continue; +#endif if (Services[i].name && !strcmp(Services[i].name, name)) break; } @@ -827,6 +1004,17 @@ Services[i].desired_workers = prefork; Services[i].max_workers = (unsigned int) atoi(max); +#ifdef INET6 + for (j = 0; j < nservices; j++) { + if (Services[j].associate && + Services[j].name && !strcmp(Services[j].name, name)) { + Services[j].exec = Services[i].exec; + Services[j].desired_workers = Services[i].desired_workers; + Services[j].max_workers = Services[i].max_workers; + } + } +#endif + if (verbose > 2) syslog(LOG_DEBUG, "reconfig: service %s (%s, %s/%s, %d, %d)", Services[i].name, cmd, @@ -861,6 +1049,10 @@ Services[nservices].nforks = 0; Services[nservices].nactive = 0; +#ifdef INET6 + Services[nservices].associate = 0; +#endif + if (verbose > 2) syslog(LOG_DEBUG, "add: service %s (%s, %s/%s, %d, %d)", Services[nservices].name, cmd, @@ -950,15 +1142,27 @@ syslog(LOG_DEBUG, "disable: service %s socket %d pipe %d %d", Services[i].name, Services[i].socket, Services[i].stat[0], Services[i].stat[1]); +#ifdef INET6 + if (!Services[i].associate) { + free(Services[i].name); + free(Services[i].listen); + free(Services[i].proto); + } + Services[i].name = NULL; +#else free(Services[i].name); Services[i].name = NULL; free(Services[i].listen); free(Services[i].proto); +#endif Services[i].desired_workers = 0; Services[i].nforks = 0; Services[i].nactive = 0; /* close all listeners */ - if (Services[i].socket > 0) close(Services[i].socket); + if (Services[i].socket > 0) { + shutdown(Services[i].socket, SHUT_RDWR); + close(Services[i].socket); + } Services[i].socket = 0; Services[i].saddr = NULL; @@ -1169,7 +1373,7 @@ int y = Services[i].socket; int j; - if (FD_ISSET(x, &rfds)) { + if (x > 0 && FD_ISSET(x, &rfds)) { r = read(x, &msg, sizeof(int)); if (r != sizeof(int)) { syslog(LOG_ERR, "got weird response from child: %x", i); @@ -1189,7 +1393,7 @@ } if (Services[i].ready_workers == 0 && - FD_ISSET(y, &rfds)) { + y > 0 && FD_ISSET(y, &rfds)) { /* huh, someone wants to talk to us */ spawn_service(&Services[i]); } Index: master/master.h =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/master/master.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- master/master.h 27 Apr 2001 10:22:59 -0000 1.1.1.2 +++ master/master.h 8 Jul 2001 21:59:36 -0000 1.2 @@ -19,6 +19,10 @@ /* stats */ int nforks; int nactive; + +#ifdef INET6 + int associate; +#endif }; extern struct service *Services; Index: master/service.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/master/service.c,v retrieving revision 1.1.1.6 retrieving revision 1.5 diff -u -r1.1.1.6 -r1.5 --- master/service.c 5 Dec 2002 06:33:01 -0000 1.1.1.6 +++ master/service.c 5 Dec 2002 07:30:06 -0000 1.5 @@ -95,12 +95,16 @@ static int libwrap_ask(struct request_info *r, int fd) { int a; +#ifdef INET6 + struct sockaddr_storage sin; +#else struct sockaddr_in sin; +#endif socklen_t len = sizeof(sin); /* is this a connection from the local host? */ if (getpeername(fd, (struct sockaddr *) &sin, &len) == 0) { - if (sin.sin_family == AF_UNIX) { + if (((struct sockaddr *)&sin)->sa_family == AF_UNIX) { return 1; } } Index: perl/sieve/lib/isieve.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/perl/sieve/lib/isieve.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- perl/sieve/lib/isieve.c 25 Dec 2000 05:20:36 -0000 1.1.1.2 +++ perl/sieve/lib/isieve.c 11 Jul 2001 13:22:49 -0000 1.2 @@ -78,10 +78,40 @@ /* initialize the network */ int init_net(char *serverFQDN, int port, isieve_t **obj) { +#ifdef INET6 + struct addrinfo hints, *res0, *res; + int err; + char portstr[6]; +#else struct sockaddr_in addr; struct hostent *hp; +#endif int sock; +#ifdef INET6 + snprintf(portstr, sizeof(portstr), "%d", port); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + if ((err = getaddrinfo(serverFQDN, portstr, &hints, &res0)) != 0) { + fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(err)); + return -1; + } + for (res = res0; res; res = res->ai_next) { + sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); + if (sock < 0) + continue; + if (connect(sock, res->ai_addr, res->ai_addrlen) >= 0) + break; + close(sock); + sock = -1; + } + freeaddrinfo(res0); + if (sock < 0) { + perror("connect"); + return -1; + } +#else if ((hp = gethostbyname(serverFQDN)) == NULL) { perror("gethostbyname"); return -1; @@ -100,6 +130,7 @@ perror("connect"); return -1; } +#endif *obj = (isieve_t *) malloc(sizeof(isieve_t)); if (!*obj) return -1; @@ -143,9 +174,15 @@ { int saslresult; sasl_security_properties_t *secprops=NULL; +#ifdef INET6 + int addrsize=sizeof(struct sockaddr_storage); + struct sockaddr *saddr_l=(struct sockaddr *)malloc(sizeof(struct sockaddr_storage)); + struct sockaddr *saddr_r=(struct sockaddr *)malloc(sizeof(struct sockaddr_storage)); +#else socklen_t addrsize=sizeof(struct sockaddr_in); struct sockaddr_in *saddr_l=malloc(sizeof(struct sockaddr_in)); struct sockaddr_in *saddr_r=malloc(sizeof(struct sockaddr_in)); +#endif /* attempt to start sasl */ saslresult=sasl_client_init(callbacks); @@ -175,12 +212,20 @@ if (sasl_setprop(obj->conn, SASL_IP_REMOTE, saddr_r)!=SASL_OK) return -1; +#ifdef INET6 + addrsize=sizeof(struct sockaddr_storage); +#else addrsize=sizeof(struct sockaddr_in); +#endif if (getsockname(obj->sock,(struct sockaddr *)saddr_l,&addrsize)!=0) return -1; /* set the port manually since getsockname is stupid and doesn't */ +#ifdef INET6 + ((struct sockaddr_in *)saddr_l)->sin_port = htons(obj->port); +#else saddr_l->sin_port = htons(obj->port); +#endif if (sasl_setprop(obj->conn, SASL_IP_LOCAL, saddr_l)!=SASL_OK) return -1; Index: timsieved/timsieved.c =================================================================== RCS file: /usr/home/ume/ncvs/src/cyrus-imapd/timsieved/timsieved.c,v retrieving revision 1.1.1.5 retrieving revision 1.6 diff -u -r1.1.1.5 -r1.6 --- timsieved/timsieved.c 21 Feb 2001 16:59:25 -0000 1.1.1.5 +++ timsieved/timsieved.c 21 Feb 2001 17:13:14 -0000 1.6 @@ -81,19 +81,36 @@ #include "auth.h" +#ifdef INET6 +#ifndef NI_WITHSCOPEID +#define NI_WITHSCOPEID 0 +#endif +#ifndef HAVE_SS_FAMILY +#define ss_family __ss_family +#endif +#endif sasl_conn_t *sieved_saslconn; /* the sasl connection context */ struct auth_state *sieved_authstate = 0; +#ifdef INET6 +struct sockaddr_storage sieved_localaddr; +struct sockaddr_storage sieved_remoteaddr; +#else struct sockaddr_in sieved_localaddr; struct sockaddr_in sieved_remoteaddr; +#endif struct protstream *sieved_out; struct protstream *sieved_in; int sieved_haveaddr = 0; +#ifdef INET6 +char sieved_clienthost[NI_MAXHOST*2+1] = "[local]"; +#else char sieved_clienthost[250] = "[local]"; +#endif int sieved_userisadmin; @@ -231,6 +248,9 @@ int timeout; int secflags = 0; sasl_security_properties_t *secprops = NULL; +#ifdef INET6 + char hbuf[NI_MAXHOST]; +#endif /* set up the prot streams */ sieved_in = prot_new(0, 0); @@ -248,6 +268,28 @@ /* Find out name of client host */ salen = sizeof(sieved_remoteaddr); +#ifdef INET6 + if (getpeername(0, (struct sockaddr *)&sieved_remoteaddr, &salen) == 0 && + (sieved_remoteaddr.ss_family == AF_INET || + sieved_remoteaddr.ss_family == AF_INET6)) { + if (getnameinfo((struct sockaddr *)&sieved_remoteaddr, salen, + hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD) == 0) { + strncpy(sieved_clienthost, hbuf, sizeof(hbuf)); + } + else { + sieved_clienthost[0] = '\0'; + } + getnameinfo((struct sockaddr *)&sieved_remoteaddr, salen, hbuf, + sizeof(hbuf), NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID); + strcat(sieved_clienthost, "["); + strcat(sieved_clienthost, hbuf); + strcat(sieved_clienthost, "]"); + salen = sizeof(sieved_localaddr); + if (getsockname(0, (struct sockaddr *)&sieved_localaddr, &salen) == 0) { + sieved_haveaddr = 1; + } + } +#else if (getpeername(0, (struct sockaddr *)&sieved_remoteaddr, &salen) == 0 && sieved_remoteaddr.sin_family == AF_INET) { if ((hp = gethostbyaddr((char *)&sieved_remoteaddr.sin_addr, @@ -266,6 +308,7 @@ sieved_haveaddr = 1; } } +#endif /* set the SASL allocation functions */ sasl_set_alloc((sasl_malloc_t *) &xmalloc,