Index: ncftp3/README.v6 diff -u /dev/null ncftp3/README.v6:1.1 --- /dev/null Mon Nov 9 21:52:32 2009 +++ ncftp3/README.v6 Tue Aug 6 14:06:35 2002 @@ -0,0 +1,2 @@ +If you have problem/trouble/suggestion for IPv6 related code, +Please contact to core@kame.net Index: ncftp3/config.h.in diff -u ncftp3/config.h.in:1.1.1.14 ncftp3/config.h.in:1.16 --- ncftp3/config.h.in:1.1.1.14 Thu Aug 21 15:41:48 2008 +++ ncftp3/config.h.in Thu Aug 21 15:49:46 2008 @@ -247,6 +247,9 @@ /* Define if you have the doupdate function. */ #undef HAVE_DOUPDATE +/* Define if you have the getaddrinfo function. */ +#undef HAVE_GETADDRINFO + /* Define if you have the fstat64 function. */ #undef HAVE_FSTAT64 @@ -268,6 +271,9 @@ /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME +/* Define if you have the getaddrname function. */ +#undef HAVE_GETNAMEINFO + /* Define if you have the getlogin_r function. */ #undef HAVE_GETLOGIN_R @@ -370,6 +376,9 @@ /* Define if you have the snprintf function. */ #undef HAVE_SNPRINTF +/* Define if sockaddr has sa_len member */ +#undef HAVE_SOCKADDR_SA_LEN + /* Define if you have the stat64 function. */ #undef HAVE_STAT64 @@ -525,3 +534,19 @@ /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET + +/* Define if you have the socks5 library (-lsocks5). */ +#undef HAVE_LIBSOCKS5 + +/* Define if you want IPv6 support. */ +#undef ENABLE_IPV6 + +/* Define if sockaddr has sa_len member */ +#undef HAVE_SOCKADDR_SA_LEN + +/* Define if sockaddr_storage has ss_family member */ +#undef HAVE_SOCKADDR_STORAGE_SS_FAMILY + +/* Define if sockaddr_storage has __ss_family member */ +#undef HAVE_SOCKADDR_STORAGE___SS_FAMILY + Index: ncftp3/configure diff -u ncftp3/configure:1.1.1.21 ncftp3/configure:1.36 --- ncftp3/configure:1.1.1.21 Thu Nov 5 16:20:41 2009 +++ ncftp3/configure Thu Nov 5 16:47:08 2009 @@ -27,6 +27,9 @@ --enable-ssp use stack smashing protection if available" ac_help="$ac_help --disable-universal disable production of universal binaries on Mac OS X" +ac_help="$ac_help + --enable-ipv6 Enable ipv6 (with ipv4) support + --disable-ipv6 Disable ipv6 support" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -44,6 +47,7 @@ program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -158,6 +162,7 @@ --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -328,6 +333,11 @@ -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -493,12 +503,16 @@ srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -631,30 +645,28 @@ - - echo $ac_n "checking if you set and exported the environment variable CC""... $ac_c" 1>&6 -echo "configure:638: checking if you set and exported the environment variable CC" >&5 +echo "configure:650: checking if you set and exported the environment variable CC" >&5 if test "x$CC" = x ; then echo "$ac_t""no (you may want to do that since configure scripts look for gcc first)" 1>&6 else echo "$ac_t""$CC" 1>&6 fi echo $ac_n "checking for environment variable CFLAGS""... $ac_c" 1>&6 -echo "configure:645: checking for environment variable CFLAGS" >&5 +echo "configure:657: checking for environment variable CFLAGS" >&5 if test "x$CFLAGS" = x ; then echo "$ac_t""no (we will choose a default set for you)" 1>&6 else echo "$ac_t""$CFLAGS" 1>&6 fi echo $ac_n "checking for environment variable CPPFLAGS""... $ac_c" 1>&6 -echo "configure:652: checking for environment variable CPPFLAGS" >&5 +echo "configure:664: checking for environment variable CPPFLAGS" >&5 echo "$ac_t""${CPPFLAGS-no}" 1>&6 echo $ac_n "checking for environment variable LDFLAGS""... $ac_c" 1>&6 -echo "configure:655: checking for environment variable LDFLAGS" >&5 +echo "configure:667: checking for environment variable LDFLAGS" >&5 echo "$ac_t""${LDFLAGS-no}" 1>&6 echo $ac_n "checking for environment variable LIBS""... $ac_c" 1>&6 -echo "configure:658: checking for environment variable LIBS" >&5 +echo "configure:670: checking for environment variable LIBS" >&5 echo "$ac_t""${LIBS-no}" 1>&6 @@ -1107,7 +1119,7 @@ echo $ac_n "checking platform""... $ac_c" 1>&6 -echo "configure:1111: checking platform" >&5 +echo "configure:1123: checking platform" >&5 echo "$ac_t"""$OS"" 1>&6 @@ -1140,7 +1152,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:1144: checking for $ac_word" >&5 +echo "configure:1156: 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 @@ -1170,7 +1182,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:1174: checking for $ac_word" >&5 +echo "configure:1186: 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 @@ -1221,7 +1233,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:1225: checking for $ac_word" >&5 +echo "configure:1237: 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 @@ -1253,7 +1265,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1257: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1269: 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. @@ -1264,12 +1276,12 @@ cat > conftest.$ac_ext << EOF -#line 1268 "configure" +#line 1280 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1285: \"$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 @@ -1295,12 +1307,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:1299: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1311: 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:1304: checking whether we are using GNU C" >&5 +echo "configure:1316: 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 @@ -1309,7 +1321,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1313: \"$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:1325: \"$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 @@ -1328,7 +1340,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1332: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1344: 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 @@ -1338,7 +1350,7 @@ else ac_cv_prog_cc_g=no fi -rm -rf conftest* +rm -f conftest* fi @@ -1361,7 +1373,7 @@ echo $ac_n "checking if the C compiler can use precompiled headers""... $ac_c" 1>&6 -echo "configure:1365: checking if the C compiler can use precompiled headers" >&5 +echo "configure:1377: checking if the C compiler can use precompiled headers" >&5 if eval "test \"`echo '$''{'wi_cv_cc_precomp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1405,14 +1417,14 @@ # echo "Successfully compiled pchtest.h into the precompiled header file pchtest.h.gch." >&5 cat > conftest.$ac_ext <<EOF -#line 1409 "configure" +#line 1421 "configure" #include "confdefs.h" #include "pchtest.h" int main() { if (FOOBAR == 33) exit(0) ; return 0; } EOF -if { (eval echo configure:1416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* result="yes" ; wi_cv_cc_precomp_type="gcc_gch_files" else @@ -1421,7 +1433,7 @@ rm -rf conftest* result="no" fi -rm -rf conftest* +rm -f conftest* else echo "This version of GCC did not compile pchtest.h into the precompiled header file pchtest.h.gch." >&5 # @@ -1431,14 +1443,14 @@ ${CC-cc} $CPPFLAGS -precomp pchtest.h -o pchtest.p >&5 2>&5 if test -s pchtest.p ; then cat > conftest.$ac_ext <<EOF -#line 1435 "configure" +#line 1447 "configure" #include "confdefs.h" #include "pchtest.h" int main() { if (FOOBAR == 33) exit(0) ; return 0; } EOF -if { (eval echo configure:1442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* result="yes" ; wi_cv_cc_precomp_type="gcc_dash_precomp" else @@ -1447,7 +1459,7 @@ rm -rf conftest* result="no" fi -rm -rf conftest* +rm -f conftest* fi fi elif test "${result}_${SYS-aix}_${GCC}" = "no_aix_no" ; then @@ -1516,7 +1528,7 @@ wi_request_no_y2k_warnings=yes echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1520: checking how to run the C preprocessor" >&5 +echo "configure:1532: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1531,13 +1543,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 1535 "configure" +#line 1547 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1553: \"$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 : @@ -1548,13 +1560,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 1552 "configure" +#line 1564 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1570: \"$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 : @@ -1565,13 +1577,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext <<EOF -#line 1569 "configure" +#line 1581 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1587: \"$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 : @@ -1582,11 +1594,11 @@ rm -rf conftest* CPP=/lib/cpp fi -rm -rf conftest* +rm -f conftest* fi -rm -rf conftest* +rm -f conftest* fi -rm -rf conftest* +rm -f conftest* ac_cv_prog_CPP="$CPP" fi CPP="$ac_cv_prog_CPP" @@ -1629,7 +1641,7 @@ if test "$GCC" = yes ; then echo $ac_n "checking the version of GCC""... $ac_c" 1>&6 -echo "configure:1633: checking the version of GCC" >&5 +echo "configure:1645: checking the version of GCC" >&5 if eval "test \"`echo '$''{'wi_cv_gcc_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1652,7 +1664,7 @@ wi_cv_sunwspro_cc_version2="0" else echo $ac_n "checking if the C compiler is Sun WorkShop C""... $ac_c" 1>&6 -echo "configure:1656: checking if the C compiler is Sun WorkShop C" >&5 +echo "configure:1668: checking if the C compiler is Sun WorkShop C" >&5 if eval "test \"`echo '$''{'wi_cv_cc_is_sunwspro_cc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1686,14 +1698,14 @@ echo "$ac_t""$wi_cv_cc_is_sunwspro_cc" 1>&6 if test "$wi_cv_cc_is_sunwspro_cc" = yes ; then echo $ac_n "checking output of "cc -V" to determine version of Sun WorkShop C""... $ac_c" 1>&6 -echo "configure:1690: checking output of "cc -V" to determine version of Sun WorkShop C" >&5 +echo "configure:1702: checking output of "cc -V" to determine version of Sun WorkShop C" >&5 echo "$ac_t"""version $wi_cv_sunwspro_cc_version"" 1>&6 fi fi echo $ac_n "checking if we should customize your CFLAGS environment variable""... $ac_c" 1>&6 -echo "configure:1697: checking if we should customize your CFLAGS environment variable" >&5 +echo "configure:1709: checking if we should customize your CFLAGS environment variable" >&5 wi_replace_O_with_g="no" case "$wi_orig_CFLAGS" in "") @@ -1899,14 +1911,14 @@ # accepts this flag... # cat > conftest.$ac_ext <<EOF -#line 1903 "configure" +#line 1915 "configure" #include "confdefs.h" int main() { int junk; ; return 0; } EOF -if { (eval echo configure:1910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -1914,7 +1926,7 @@ rm -rf conftest* CFLAGS="$oldCFLAGS" fi -rm -rf conftest* +rm -f conftest* unset oldCFLAGS ;; esac @@ -1924,7 +1936,7 @@ echo $ac_n "checking for ldd""... $ac_c" 1>&6 -echo "configure:1928: checking for ldd" >&5 +echo "configure:1940: checking for ldd" >&5 if eval "test \"`echo '$''{'wi_cv_prog_ldd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1959,7 +1971,7 @@ # try these CFLAGS="$CFLAGS $ac_cv_ssp_flags" cat > conftest.$ac_ext <<EOF -#line 1963 "configure" +#line 1975 "configure" #include "confdefs.h" #include <stdio.h> @@ -1971,7 +1983,7 @@ ; return 0; } EOF -if { (eval echo configure:1975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -1979,7 +1991,7 @@ rm -rf conftest* CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="no" fi -rm -rf conftest* +rm -f conftest* if test "$SYS" = macosx ; then if test "${use_macosx_universal}" != no ; then CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="not compatible with Mac OS X universal" @@ -1987,13 +1999,13 @@ fi unset oldCFLAGS echo $ac_n "checking if stack protection CFLAGS can be used""... $ac_c" 1>&6 -echo "configure:1991: checking if stack protection CFLAGS can be used" >&5 +echo "configure:2003: checking if stack protection CFLAGS can be used" >&5 echo "$ac_t""$ac_cv_ssp_flags" 1>&6 fi echo $ac_n "checking if compiled programs use a shared library version of libgcc""... $ac_c" 1>&6 -echo "configure:1997: checking if compiled programs use a shared library version of libgcc" >&5 +echo "configure:2009: checking if compiled programs use a shared library version of libgcc" >&5 if eval "test \"`echo '$''{'wi_cv_shared_libgcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2032,7 +2044,7 @@ # accepts this flag... # cat > conftest.$ac_ext <<EOF -#line 2036 "configure" +#line 2048 "configure" #include "confdefs.h" #include <stdio.h> @@ -2042,7 +2054,7 @@ strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF -if { (eval echo configure:2046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -2050,7 +2062,7 @@ rm -rf conftest* CFLAGS="$oldCFLAGS" fi -rm -rf conftest* +rm -f conftest* unset oldCFLAGS ;; esac @@ -2073,7 +2085,7 @@ # accepts this flag... # cat > conftest.$ac_ext <<EOF -#line 2077 "configure" +#line 2089 "configure" #include "confdefs.h" #include <stdio.h> @@ -2083,7 +2095,7 @@ strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF -if { (eval echo configure:2087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -2091,7 +2103,7 @@ rm -rf conftest* CFLAGS="$oldCFLAGS" fi -rm -rf conftest* +rm -f conftest* unset oldCFLAGS ;; esac @@ -2123,7 +2135,7 @@ # Was it ./configure --enable-debug ? # echo $ac_n "checking if this is a debug build""... $ac_c" 1>&6 -echo "configure:2127: checking if this is a debug build" >&5 +echo "configure:2139: checking if this is a debug build" >&5 if test "$DEBUGBUILD" = yes ; then echo "$ac_t""yes" 1>&6 CFLAGS="$DEBUGCFLAGS" @@ -2137,7 +2149,7 @@ CFLAGS=`echo "$CFLAGS" | sed s/-D__STDC_EXT__//g` echo $ac_n "checking if -D__STDC_EXT__ is needed with GCC on HP-UX""... $ac_c" 1>&6 -echo "configure:2141: checking if -D__STDC_EXT__ is needed with GCC on HP-UX" >&5 +echo "configure:2153: checking if -D__STDC_EXT__ is needed with GCC on HP-UX" >&5 if test "$cross_compiling" = yes; then # action if cross-compiling, guess @@ -2146,7 +2158,7 @@ else cat > conftest.$ac_ext <<EOF -#line 2150 "configure" +#line 2162 "configure" #include "confdefs.h" #include <stdio.h> @@ -2162,7 +2174,7 @@ #endif } EOF -if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -2195,17 +2207,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2199: checking for $ac_hdr" >&5 +echo "configure:2211: 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 -#line 2204 "configure" +#line 2216 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2221: \"$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* @@ -2217,7 +2229,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -2234,7 +2246,7 @@ if test "x$ac_cv_sizeof_stat_st_size" = x ; then echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6 -echo "configure:2238: checking size of st_size field in struct stat" >&5 +echo "configure:2250: checking size of st_size field in struct stat" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; } @@ -2249,7 +2261,7 @@ else cat > conftest.$ac_ext <<EOF -#line 2253 "configure" +#line 2265 "configure" #include "confdefs.h" /* program */ @@ -2279,7 +2291,7 @@ } EOF -if { (eval echo configure:2283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -2315,7 +2327,7 @@ if test "x$ac_cv_sizeof_off_t" = x ; then echo $ac_n "checking size of off_t""... $ac_c" 1>&6 -echo "configure:2319: checking size of off_t" >&5 +echo "configure:2331: checking size of off_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; } @@ -2330,7 +2342,7 @@ else cat > conftest.$ac_ext <<EOF -#line 2334 "configure" +#line 2346 "configure" #include "confdefs.h" /* program */ @@ -2360,7 +2372,7 @@ } EOF -if { (eval echo configure:2364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -2409,7 +2421,7 @@ wi_cv_lfs64="yes" fi echo $ac_n "checking if we should add CFLAGS for LFS64 support""... $ac_c" 1>&6 -echo "configure:2413: checking if we should add CFLAGS for LFS64 support" >&5 +echo "configure:2425: checking if we should add CFLAGS for LFS64 support" >&5 echo "$ac_t""$result" 1>&6 else @@ -2420,7 +2432,7 @@ if test "$GCC" = yes ; then echo $ac_n "checking the version of GCC""... $ac_c" 1>&6 -echo "configure:2424: checking the version of GCC" >&5 +echo "configure:2436: checking the version of GCC" >&5 if eval "test \"`echo '$''{'wi_cv_gcc_version'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2443,7 +2455,7 @@ wi_cv_sunwspro_cc_version2="0" else echo $ac_n "checking if the C compiler is Sun WorkShop C""... $ac_c" 1>&6 -echo "configure:2447: checking if the C compiler is Sun WorkShop C" >&5 +echo "configure:2459: checking if the C compiler is Sun WorkShop C" >&5 if eval "test \"`echo '$''{'wi_cv_cc_is_sunwspro_cc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2477,14 +2489,14 @@ echo "$ac_t""$wi_cv_cc_is_sunwspro_cc" 1>&6 if test "$wi_cv_cc_is_sunwspro_cc" = yes ; then echo $ac_n "checking output of "cc -V" to determine version of Sun WorkShop C""... $ac_c" 1>&6 -echo "configure:2481: checking output of "cc -V" to determine version of Sun WorkShop C" >&5 +echo "configure:2493: checking output of "cc -V" to determine version of Sun WorkShop C" >&5 echo "$ac_t"""version $wi_cv_sunwspro_cc_version"" 1>&6 fi fi echo $ac_n "checking if we should customize your CFLAGS environment variable""... $ac_c" 1>&6 -echo "configure:2488: checking if we should customize your CFLAGS environment variable" >&5 +echo "configure:2500: checking if we should customize your CFLAGS environment variable" >&5 wi_replace_O_with_g="no" case "$wi_orig_CFLAGS" in "") @@ -2690,14 +2702,14 @@ # accepts this flag... # cat > conftest.$ac_ext <<EOF -#line 2694 "configure" +#line 2706 "configure" #include "confdefs.h" int main() { int junk; ; return 0; } EOF -if { (eval echo configure:2701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -2705,7 +2717,7 @@ rm -rf conftest* CFLAGS="$oldCFLAGS" fi -rm -rf conftest* +rm -f conftest* unset oldCFLAGS ;; esac @@ -2715,7 +2727,7 @@ echo $ac_n "checking for ldd""... $ac_c" 1>&6 -echo "configure:2719: checking for ldd" >&5 +echo "configure:2731: checking for ldd" >&5 if eval "test \"`echo '$''{'wi_cv_prog_ldd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2750,7 +2762,7 @@ # try these CFLAGS="$CFLAGS $ac_cv_ssp_flags" cat > conftest.$ac_ext <<EOF -#line 2754 "configure" +#line 2766 "configure" #include "confdefs.h" #include <stdio.h> @@ -2762,7 +2774,7 @@ ; return 0; } EOF -if { (eval echo configure:2766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -2770,7 +2782,7 @@ rm -rf conftest* CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="no" fi -rm -rf conftest* +rm -f conftest* if test "$SYS" = macosx ; then if test "${use_macosx_universal}" != no ; then CFLAGS="$oldCFLAGS" ; ac_cv_ssp_flags="not compatible with Mac OS X universal" @@ -2778,13 +2790,13 @@ fi unset oldCFLAGS echo $ac_n "checking if stack protection CFLAGS can be used""... $ac_c" 1>&6 -echo "configure:2782: checking if stack protection CFLAGS can be used" >&5 +echo "configure:2794: checking if stack protection CFLAGS can be used" >&5 echo "$ac_t""$ac_cv_ssp_flags" 1>&6 fi echo $ac_n "checking if compiled programs use a shared library version of libgcc""... $ac_c" 1>&6 -echo "configure:2788: checking if compiled programs use a shared library version of libgcc" >&5 +echo "configure:2800: checking if compiled programs use a shared library version of libgcc" >&5 if eval "test \"`echo '$''{'wi_cv_shared_libgcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2823,7 +2835,7 @@ # accepts this flag... # cat > conftest.$ac_ext <<EOF -#line 2827 "configure" +#line 2839 "configure" #include "confdefs.h" #include <stdio.h> @@ -2833,7 +2845,7 @@ strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF -if { (eval echo configure:2837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -2841,7 +2853,7 @@ rm -rf conftest* CFLAGS="$oldCFLAGS" fi -rm -rf conftest* +rm -f conftest* unset oldCFLAGS ;; esac @@ -2864,7 +2876,7 @@ # accepts this flag... # cat > conftest.$ac_ext <<EOF -#line 2868 "configure" +#line 2880 "configure" #include "confdefs.h" #include <stdio.h> @@ -2874,7 +2886,7 @@ strncpy(testvar, "hello world", sizeof(testvar) - 1); ; return 0; } EOF -if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -2882,7 +2894,7 @@ rm -rf conftest* CFLAGS="$oldCFLAGS" fi -rm -rf conftest* +rm -f conftest* unset oldCFLAGS ;; esac @@ -2914,7 +2926,7 @@ # Was it ./configure --enable-debug ? # echo $ac_n "checking if this is a debug build""... $ac_c" 1>&6 -echo "configure:2918: checking if this is a debug build" >&5 +echo "configure:2930: checking if this is a debug build" >&5 if test "$DEBUGBUILD" = yes ; then echo "$ac_t""yes" 1>&6 CFLAGS="$DEBUGCFLAGS" @@ -2928,7 +2940,7 @@ CFLAGS=`echo "$CFLAGS" | sed s/-D__STDC_EXT__//g` echo $ac_n "checking if -D__STDC_EXT__ is needed with GCC on HP-UX""... $ac_c" 1>&6 -echo "configure:2932: checking if -D__STDC_EXT__ is needed with GCC on HP-UX" >&5 +echo "configure:2944: checking if -D__STDC_EXT__ is needed with GCC on HP-UX" >&5 if test "$cross_compiling" = yes; then # action if cross-compiling, guess @@ -2937,7 +2949,7 @@ else cat > conftest.$ac_ext <<EOF -#line 2941 "configure" +#line 2953 "configure" #include "confdefs.h" #include <stdio.h> @@ -2953,7 +2965,7 @@ #endif } EOF -if { (eval echo configure:2957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -2986,17 +2998,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2990: checking for $ac_hdr" >&5 +echo "configure:3002: 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 -#line 2995 "configure" +#line 3007 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3012: \"$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* @@ -3008,7 +3020,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -3025,7 +3037,7 @@ if test "x$ac_cv_sizeof_stat_st_size" = x ; then echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6 -echo "configure:3029: checking size of st_size field in struct stat" >&5 +echo "configure:3041: checking size of st_size field in struct stat" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; } @@ -3040,7 +3052,7 @@ else cat > conftest.$ac_ext <<EOF -#line 3044 "configure" +#line 3056 "configure" #include "confdefs.h" /* program */ @@ -3070,7 +3082,7 @@ } EOF -if { (eval echo configure:3074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -3106,7 +3118,7 @@ if test "x$ac_cv_sizeof_off_t" = x ; then echo $ac_n "checking size of off_t""... $ac_c" 1>&6 -echo "configure:3110: checking size of off_t" >&5 +echo "configure:3122: checking size of off_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; } @@ -3121,7 +3133,7 @@ else cat > conftest.$ac_ext <<EOF -#line 3125 "configure" +#line 3137 "configure" #include "confdefs.h" /* program */ @@ -3151,7 +3163,7 @@ } EOF -if { (eval echo configure:3155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -3201,13 +3213,13 @@ wi_cv_lfs="yes" fi echo $ac_n "checking if we should add CFLAGS for Large File Support""... $ac_c" 1>&6 -echo "configure:3205: checking if we should add CFLAGS for Large File Support" >&5 +echo "configure:3217: checking if we should add CFLAGS for Large File Support" >&5 echo "$ac_t""$result" 1>&6 if test "x$ac_cv_sizeof_off_t" = x ; then # Recheck, to see if the defines took effect. echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6 -echo "configure:3211: checking size of st_size field in struct stat" >&5 +echo "configure:3223: checking size of st_size field in struct stat" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; } @@ -3222,7 +3234,7 @@ else cat > conftest.$ac_ext <<EOF -#line 3226 "configure" +#line 3238 "configure" #include "confdefs.h" /* program */ @@ -3252,7 +3264,7 @@ } EOF -if { (eval echo configure:3256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -3286,7 +3298,7 @@ echo $ac_n "checking size of off_t""... $ac_c" 1>&6 -echo "configure:3290: checking size of off_t" >&5 +echo "configure:3302: checking size of off_t" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; } @@ -3301,7 +3313,7 @@ else cat > conftest.$ac_ext <<EOF -#line 3305 "configure" +#line 3317 "configure" #include "confdefs.h" /* program */ @@ -3331,7 +3343,7 @@ } EOF -if { (eval echo configure:3335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -3379,7 +3391,7 @@ ;; esac echo $ac_n "checking if we should add CFLAGS for reentrancy""... $ac_c" 1>&6 -echo "configure:3383: checking if we should add CFLAGS for reentrancy" >&5 +echo "configure:3395: checking if we should add CFLAGS for reentrancy" >&5 echo "$ac_t""$result" 1>&6 @@ -3388,7 +3400,7 @@ ac_cv_macosx_cflags=no ac_cv_macosx_ldflags=no echo $ac_n "checking if MACOSX_DEPLOYMENT_TARGET environment variable is set""... $ac_c" 1>&6 -echo "configure:3392: checking if MACOSX_DEPLOYMENT_TARGET environment variable is set" >&5 +echo "configure:3404: checking if MACOSX_DEPLOYMENT_TARGET environment variable is set" >&5 echo "$ac_t""${MACOSX_DEPLOYMENT_TARGET-no}" 1>&6 if test "${use_macosx_universal}" != no ; then macosx_sdk_path="/Developer/SDKs/MacOSX10.4u.sdk" @@ -3429,13 +3441,13 @@ # esac fi echo $ac_n "checking if we should add CFLAGS for Mac OS X""... $ac_c" 1>&6 -echo "configure:3433: checking if we should add CFLAGS for Mac OS X" >&5 +echo "configure:3445: checking if we should add CFLAGS for Mac OS X" >&5 echo "$ac_t""$ac_cv_macosx_cflags" 1>&6 fi echo $ac_n "checking for strip""... $ac_c" 1>&6 -echo "configure:3439: checking for strip" >&5 +echo "configure:3451: checking for strip" >&5 STRIP="strip" if [ "x$cross_compiling" = "xyes" ] ; then machine=`${CC-gcc} -dumpmachine 2>/dev/null` @@ -3489,16 +3501,13 @@ STRIPFLAG="$SFLAG" echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:3493: checking for object suffix" >&5 +echo "configure:3505: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - rm -rf conftest* -if test "x${SYS}" = "xmacosx" ; then - ac_cv_objext="o" -else + rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:3502: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -3508,8 +3517,7 @@ else { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } fi -fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_objext" 1>&6 @@ -3517,12 +3525,12 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3521: checking for Cygwin environment" >&5 +echo "configure:3529: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3526 "configure" +#line 3534 "configure" #include "confdefs.h" int main() { @@ -3533,7 +3541,7 @@ return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:3537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -3542,27 +3550,27 @@ rm -rf conftest* ac_cv_cygwin=no fi -rm -rf conftest* -rm -rf conftest* +rm -f conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3554: checking for mingw32 environment" >&5 +echo "configure:3562: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3559 "configure" +#line 3567 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:3566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3571,8 +3579,8 @@ rm -rf conftest* ac_cv_mingw32=no fi -rm -rf conftest* -rm -rf conftest* +rm -f conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_mingw32" 1>&6 @@ -3581,29 +3589,27 @@ echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3585: checking for executable suffix" >&5 +echo "configure:3593: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$CYGWIN" = yes || test "$MINGW32" = yes; then ac_cv_exeext=.exe -elif test "x${SYS}" = "xmacosx" ; then - ac_cv_exeext="" else - rm -rf conftest* + rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.C | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done else { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } fi - rm -rf conftest* + rm -f conftest* test x"${ac_cv_exeext}" = x && ac_cv_exeext=no fi fi @@ -3627,7 +3633,7 @@ if test "${SYS-sunos}" = sunos ; then echo $ac_n "checking for System V compatibility directories""... $ac_c" 1>&6 -echo "configure:3631: checking for System V compatibility directories" >&5 +echo "configure:3637: checking for System V compatibility directories" >&5 echo "$ac_t""" 1>&6 incdir=""/usr/5include"" @@ -3681,12 +3687,12 @@ echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3685: checking for ANSI C header files" >&5 +echo "configure:3691: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3690 "configure" +#line 3696 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -3694,7 +3700,7 @@ #include <float.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3704: \"$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* @@ -3706,12 +3712,12 @@ rm -rf conftest* ac_cv_header_stdc=no fi -rm -rf conftest* +rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3715 "configure" +#line 3721 "configure" #include "confdefs.h" #include <string.h> EOF @@ -3722,14 +3728,14 @@ rm -rf conftest* ac_cv_header_stdc=no fi -rm -rf conftest* +rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext <<EOF -#line 3733 "configure" +#line 3739 "configure" #include "confdefs.h" #include <stdlib.h> EOF @@ -3740,7 +3746,7 @@ rm -rf conftest* ac_cv_header_stdc=no fi -rm -rf conftest* +rm -f conftest* fi @@ -3750,7 +3756,7 @@ : else cat > conftest.$ac_ext <<EOF -#line 3754 "configure" +#line 3760 "configure" #include "confdefs.h" #include <ctype.h> #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3761,7 +3767,7 @@ exit (0); } EOF -if { (eval echo configure:3765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3788,17 +3794,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3792: checking for $ac_hdr" >&5 +echo "configure:3798: 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 -#line 3797 "configure" +#line 3803 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3808: \"$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* @@ -3810,7 +3816,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -3825,12 +3831,12 @@ done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3829: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3835: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3834 "configure" +#line 3840 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/time.h> @@ -3839,7 +3845,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3848,7 +3854,7 @@ rm -rf conftest* ac_cv_header_time=no fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_header_time" 1>&6 @@ -3870,17 +3876,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3874: checking for $ac_hdr" >&5 +echo "configure:3880: 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 -#line 3879 "configure" +#line 3885 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3890: \"$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* @@ -3892,7 +3898,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -3907,7 +3913,7 @@ done echo $ac_n "checking for UNIX domain sockets""... $ac_c" 1>&6 -echo "configure:3911: checking for UNIX domain sockets" >&5 +echo "configure:3917: checking for UNIX domain sockets" >&5 if eval "test \"`echo '$''{'wi_cv_unix_domain_sockets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3920,7 +3926,7 @@ else cat > conftest.$ac_ext <<EOF -#line 3924 "configure" +#line 3930 "configure" #include "confdefs.h" #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) @@ -3946,7 +3952,7 @@ exit(0); /* do have UNIX domain sockets */ } EOF -if { (eval echo configure:3950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -3980,13 +3986,13 @@ fi echo $ac_n "checking for sun_len field in struct sockaddr_un""... $ac_c" 1>&6 -echo "configure:3984: checking for sun_len field in struct sockaddr_un" >&5 +echo "configure:3990: checking for sun_len field in struct sockaddr_un" >&5 if eval "test \"`echo '$''{'wi_cv_sockaddr_un_sun_len'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3990 "configure" +#line 3996 "configure" #include "confdefs.h" /* includes */ @@ -4005,7 +4011,7 @@ ; return 0; } EOF -if { (eval echo configure:4009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_sockaddr_un_sun_len=yes @@ -4018,7 +4024,7 @@ wi_cv_sockaddr_un_sun_len=no fi -rm -rf conftest* +rm -f conftest* fi @@ -4047,12 +4053,12 @@ # Mostly for SunOS 4 -- needs to come first because other libs depend on it echo $ac_n "checking for strerror""... $ac_c" 1>&6 -echo "configure:4051: checking for strerror" >&5 +echo "configure:4057: 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 <<EOF -#line 4056 "configure" +#line 4062 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strerror(); below. */ @@ -4075,7 +4081,7 @@ ; return 0; } EOF -if { (eval echo configure:4079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4085: \"$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 @@ -4084,7 +4090,7 @@ rm -rf conftest* eval "ac_cv_func_strerror=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then @@ -4098,7 +4104,7 @@ if test "$a" = no ; then # Not in libc, try lib44bsd. echo $ac_n "checking for strerror in -l44bsd""... $ac_c" 1>&6 -echo "configure:4102: checking for strerror in -l44bsd" >&5 +echo "configure:4108: checking for strerror in -l44bsd" >&5 ac_lib_var=`echo 44bsd'_'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 @@ -4106,7 +4112,7 @@ ac_save_LIBS="$LIBS" LIBS="-l44bsd $LIBS" cat > conftest.$ac_ext <<EOF -#line 4110 "configure" +#line 4116 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4117,7 +4123,7 @@ strerror() ; return 0; } EOF -if { (eval echo configure:4121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4127: \"$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 @@ -4126,7 +4132,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4149,12 +4155,12 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:4153: checking for socket" >&5 +echo "configure:4159: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4158 "configure" +#line 4164 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket(); below. */ @@ -4177,7 +4183,7 @@ ; return 0; } EOF -if { (eval echo configure:4181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -4186,7 +4192,7 @@ rm -rf conftest* eval "ac_cv_func_socket=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then @@ -4200,7 +4206,7 @@ if test "$a" = no ; then # Not in libc, try libsocket. echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:4204: checking for socket in -lsocket" >&5 +echo "configure:4210: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4208,7 +4214,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF -#line 4212 "configure" +#line 4218 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4219,7 +4225,7 @@ socket() ; return 0; } EOF -if { (eval echo configure:4223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4229: \"$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 @@ -4228,7 +4234,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4254,7 +4260,7 @@ unixware2*) # So far, only UnixWare needs this. echo $ac_n "checking for syslog in -lgen""... $ac_c" 1>&6 -echo "configure:4258: checking for syslog in -lgen" >&5 +echo "configure:4264: checking for syslog in -lgen" >&5 ac_lib_var=`echo gen'_'syslog | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4262,7 +4268,7 @@ ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <<EOF -#line 4266 "configure" +#line 4272 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4273,7 +4279,7 @@ syslog() ; return 0; } EOF -if { (eval echo configure:4277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4283: \"$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 @@ -4282,7 +4288,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4320,12 +4326,12 @@ # AC_CHECK_FUNC(socket,[a=yes],[a=no]) # echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:4324: checking for socket" >&5 +echo "configure:4330: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4329 "configure" +#line 4335 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char socket(); below. */ @@ -4348,7 +4354,7 @@ ; return 0; } EOF -if { (eval echo configure:4352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -4357,7 +4363,7 @@ rm -rf conftest* eval "ac_cv_func_socket=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then @@ -4381,7 +4387,7 @@ hpux1123456789*) # HP-UX 11 uses NSL for YP services echo $ac_n "checking for getpwent in -lnsl""... $ac_c" 1>&6 -echo "configure:4385: checking for getpwent in -lnsl" >&5 +echo "configure:4391: checking for getpwent in -lnsl" >&5 ac_lib_var=`echo nsl'_'getpwent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4389,7 +4395,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4393 "configure" +#line 4399 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4400,7 +4406,7 @@ getpwent() ; return 0; } EOF -if { (eval echo configure:4404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4410: \"$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 @@ -4409,7 +4415,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4431,12 +4437,12 @@ *) echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:4435: checking for gethostbyname" >&5 +echo "configure:4441: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4440 "configure" +#line 4446 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname(); below. */ @@ -4459,7 +4465,7 @@ ; return 0; } EOF -if { (eval echo configure:4463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4468,7 +4474,7 @@ rm -rf conftest* eval "ac_cv_func_gethostbyname=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then @@ -4482,7 +4488,7 @@ if test "$a" = no ; then # Not in libc, try libnsl. echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4486: checking for gethostbyname in -lnsl" >&5 +echo "configure:4492: 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 @@ -4490,7 +4496,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF -#line 4494 "configure" +#line 4500 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4501,7 +4507,7 @@ gethostbyname() ; return 0; } EOF -if { (eval echo configure:4505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4511: \"$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 @@ -4510,7 +4516,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4537,7 +4543,7 @@ # See if we could access two well-known sites without help of any special # libraries, like resolv. echo $ac_n "checking if we need to look for a separate DNS resolver library""... $ac_c" 1>&6 -echo "configure:4541: checking if we need to look for a separate DNS resolver library" >&5 +echo "configure:4547: checking if we need to look for a separate DNS resolver library" >&5 if eval "test \"`echo '$''{'wi_cv_look_for_resolv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4555,7 +4561,7 @@ else cat > conftest.$ac_ext <<EOF -#line 4559 "configure" +#line 4565 "configure" #include "confdefs.h" #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) @@ -4582,7 +4588,7 @@ exit(0); } EOF -if { (eval echo configure:4586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -4610,7 +4616,7 @@ if test "$wi_cv_look_for_resolv" = yes ; then echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 -echo "configure:4614: checking for main in -lresolv" >&5 +echo "configure:4620: checking for main in -lresolv" >&5 ac_lib_var=`echo resolv'_'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 @@ -4618,14 +4624,14 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <<EOF -#line 4622 "configure" +#line 4628 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4635: \"$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 @@ -4634,7 +4640,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4676,7 +4682,7 @@ # if test "x$ac_cv_lib_db_main" = "x" ; then echo $ac_n "checking for main in -ldb""... $ac_c" 1>&6 -echo "configure:4680: checking for main in -ldb" >&5 +echo "configure:4686: checking for main in -ldb" >&5 ac_lib_var=`echo db'_'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 @@ -4684,14 +4690,14 @@ ac_save_LIBS="$LIBS" LIBS="-ldb $LIBS" cat > conftest.$ac_ext <<EOF -#line 4688 "configure" +#line 4694 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4701: \"$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 @@ -4700,7 +4706,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4714,7 +4720,7 @@ fi if test "x$ac_cv_lib_isode_main" = "x" ; then echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6 -echo "configure:4718: checking for main in -lisode" >&5 +echo "configure:4724: checking for main in -lisode" >&5 ac_lib_var=`echo isode'_'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 @@ -4722,14 +4728,14 @@ ac_save_LIBS="$LIBS" LIBS="-lisode $LIBS" cat > conftest.$ac_ext <<EOF -#line 4726 "configure" +#line 4732 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4739: \"$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 @@ -4738,7 +4744,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4752,7 +4758,7 @@ fi if test "x$ac_cv_lib_com_err_main" = "x" ; then echo $ac_n "checking for main in -lcom_err""... $ac_c" 1>&6 -echo "configure:4756: checking for main in -lcom_err" >&5 +echo "configure:4762: checking for main in -lcom_err" >&5 ac_lib_var=`echo com_err'_'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 @@ -4760,14 +4766,14 @@ ac_save_LIBS="$LIBS" LIBS="-lcom_err $LIBS" cat > conftest.$ac_ext <<EOF -#line 4764 "configure" +#line 4770 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4777: \"$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 +4782,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4790,7 +4796,7 @@ fi if test "x$ac_cv_lib_crypto_main" = "x" ; then echo $ac_n "checking for main in -lcrypto""... $ac_c" 1>&6 -echo "configure:4794: checking for main in -lcrypto" >&5 +echo "configure:4800: checking for main in -lcrypto" >&5 ac_lib_var=`echo crypto'_'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 @@ -4798,14 +4804,14 @@ ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <<EOF -#line 4802 "configure" +#line 4808 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4815: \"$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 @@ -4814,7 +4820,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4828,7 +4834,7 @@ fi if test "x$ac_cv_lib_krb5_main" = "x" ; then echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6 -echo "configure:4832: checking for main in -lkrb5" >&5 +echo "configure:4838: checking for main in -lkrb5" >&5 ac_lib_var=`echo krb5'_'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 @@ -4836,14 +4842,14 @@ ac_save_LIBS="$LIBS" LIBS="-lkrb5 $LIBS" cat > conftest.$ac_ext <<EOF -#line 4840 "configure" +#line 4846 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4853: \"$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 @@ -4852,7 +4858,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4866,7 +4872,7 @@ fi if test "x$ac_cv_lib_gssapi_krb5_main" = "x" ; then echo $ac_n "checking for main in -lgssapi_krb5""... $ac_c" 1>&6 -echo "configure:4870: checking for main in -lgssapi_krb5" >&5 +echo "configure:4876: checking for main in -lgssapi_krb5" >&5 ac_lib_var=`echo gssapi_krb5'_'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 @@ -4874,14 +4880,14 @@ ac_save_LIBS="$LIBS" LIBS="-lgssapi_krb5 $LIBS" cat > conftest.$ac_ext <<EOF -#line 4878 "configure" +#line 4884 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:4885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4891: \"$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 @@ -4890,7 +4896,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4904,7 +4910,7 @@ fi echo $ac_n "checking for SOCKSinit in -lsocks5""... $ac_c" 1>&6 -echo "configure:4908: checking for SOCKSinit in -lsocks5" >&5 +echo "configure:4914: checking for SOCKSinit in -lsocks5" >&5 ac_lib_var=`echo socks5'_'SOCKSinit | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4912,7 +4918,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocks5 $LIBS" cat > conftest.$ac_ext <<EOF -#line 4916 "configure" +#line 4922 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -4923,7 +4929,7 @@ SOCKSinit() ; return 0; } EOF -if { (eval echo configure:4927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4933: \"$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 @@ -4932,7 +4938,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -4947,17 +4953,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4951: checking for $ac_hdr" >&5 +echo "configure:4957: 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 -#line 4956 "configure" +#line 4962 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4961: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4967: \"$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* @@ -4969,7 +4975,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -4996,7 +5002,7 @@ fi fi echo $ac_n "checking if SOCKS5 will be used""... $ac_c" 1>&6 -echo "configure:5000: checking if SOCKS5 will be used" >&5 +echo "configure:5006: checking if SOCKS5 will be used" >&5 echo "$ac_t""$ac_cv_lib_socks5_SOCKSinit" 1>&6 @@ -5005,23 +5011,23 @@ echo $ac_n "checking for curses library headers""... $ac_c" 1>&6 -echo "configure:5009: checking for curses library headers" >&5 +echo "configure:5015: checking for curses library headers" >&5 if test "$wi_cv_ncurses" != "no" ; then for ac_hdr in ncurses.h curses.h termios.h termio.h sgtty.h sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5015: checking for $ac_hdr" >&5 +echo "configure:5021: 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 -#line 5020 "configure" +#line 5026 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5031: \"$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* @@ -5033,7 +5039,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -5052,17 +5058,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5056: checking for $ac_hdr" >&5 +echo "configure:5062: 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 -#line 5061 "configure" +#line 5067 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5066: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5072: \"$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* @@ -5074,7 +5080,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -5100,7 +5106,7 @@ fi echo $ac_n "checking for curses library""... $ac_c" 1>&6 -echo "configure:5104: checking for curses library" >&5 +echo "configure:5110: checking for curses library" >&5 wi_cv_lib_curses=no wi_cv_lib_curses_result=no @@ -5113,7 +5119,7 @@ fi LIBS="$ac_save_LIBS $LIBCURSES" cat > conftest.$ac_ext <<EOF -#line 5117 "configure" +#line 5123 "configure" #include "confdefs.h" /* includes */ @@ -5135,7 +5141,7 @@ ; return 0; } EOF -if { (eval echo configure:5139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* linked_with_LIBCURSES=yes @@ -5148,7 +5154,7 @@ linked_with_LIBCURSES=no fi -rm -rf conftest* +rm -f conftest* if test "x$linked_with_LIBCURSES" != "xyes" ; then continue ; fi if test "$cross_compiling" = yes; then @@ -5159,7 +5165,7 @@ else cat > conftest.$ac_ext <<EOF -#line 5163 "configure" +#line 5169 "configure" #include "confdefs.h" /* program */ @@ -5184,7 +5190,7 @@ } EOF -if { (eval echo configure:5188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -5251,12 +5257,12 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5255: checking for working const" >&5 +echo "configure:5261: 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 <<EOF -#line 5260 "configure" +#line 5266 "configure" #include "confdefs.h" int main() { @@ -5305,7 +5311,7 @@ ; return 0; } EOF -if { (eval echo configure:5309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5315: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5314,7 +5320,7 @@ rm -rf conftest* ac_cv_c_const=no fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 @@ -5326,12 +5332,12 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:5330: checking for size_t" >&5 +echo "configure:5336: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5335 "configure" +#line 5341 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5347,7 +5353,7 @@ rm -rf conftest* ac_cv_type_size_t=no fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_type_size_t" 1>&6 @@ -5359,12 +5365,12 @@ fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:5363: checking for off_t" >&5 +echo "configure:5369: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5368 "configure" +#line 5374 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5380,7 +5386,7 @@ rm -rf conftest* ac_cv_type_off_t=no fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_type_off_t" 1>&6 @@ -5392,12 +5398,12 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:5396: checking for mode_t" >&5 +echo "configure:5402: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5401 "configure" +#line 5407 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5413,7 +5419,7 @@ rm -rf conftest* ac_cv_type_mode_t=no fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_type_mode_t" 1>&6 @@ -5425,12 +5431,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5429: checking for pid_t" >&5 +echo "configure:5435: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5434 "configure" +#line 5440 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -5446,7 +5452,7 @@ rm -rf conftest* ac_cv_type_pid_t=no fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_type_pid_t" 1>&6 @@ -5458,12 +5464,12 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:5462: checking for uid_t in sys/types.h" >&5 +echo "configure:5468: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 5467 "configure" +#line 5473 "configure" #include "confdefs.h" #include <sys/types.h> EOF @@ -5475,7 +5481,7 @@ rm -rf conftest* ac_cv_type_uid_t=no fi -rm -rf conftest* +rm -f conftest* fi @@ -5493,7 +5499,7 @@ echo $ac_n "checking what type main() should return""... $ac_c" 1>&6 -echo "configure:5497: checking what type main() should return" >&5 +echo "configure:5503: checking what type main() should return" >&5 if eval "test \"`echo '$''{'wi_cv_main_void_return_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5520,7 +5526,7 @@ fi echo $ac_n "checking for 64-bit integral type: long long""... $ac_c" 1>&6 -echo "configure:5524: checking for 64-bit integral type: long long" >&5 +echo "configure:5530: checking for 64-bit integral type: long long" >&5 LONGEST_INT="long" if test "$cross_compiling" = yes; then @@ -5531,7 +5537,7 @@ else cat > conftest.$ac_ext <<EOF -#line 5535 "configure" +#line 5541 "configure" #include "confdefs.h" /* program */ @@ -5559,7 +5565,7 @@ EOF -if { (eval echo configure:5563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -5585,7 +5591,7 @@ if test "$wi_cv_type_long_long" = yes ; then echo $ac_n "checking how to print a 64-bit integral type""... $ac_c" 1>&6 -echo "configure:5589: checking how to print a 64-bit integral type" >&5 +echo "configure:5595: checking how to print a 64-bit integral type" >&5 wi_cv_printf_long_long=fail if test "$cross_compiling" = yes; then @@ -5596,7 +5602,7 @@ else cat > conftest.$ac_ext <<EOF -#line 5600 "configure" +#line 5606 "configure" #include "confdefs.h" /* program */ @@ -5625,7 +5631,7 @@ } EOF -if { (eval echo configure:5629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -5655,7 +5661,7 @@ else cat > conftest.$ac_ext <<EOF -#line 5659 "configure" +#line 5665 "configure" #include "confdefs.h" /* program */ @@ -5684,7 +5690,7 @@ } EOF -if { (eval echo configure:5688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -5714,7 +5720,7 @@ echo $ac_n "checking how to scan a 64-bit integral type""... $ac_c" 1>&6 -echo "configure:5718: checking how to scan a 64-bit integral type" >&5 +echo "configure:5724: checking how to scan a 64-bit integral type" >&5 wi_cv_scanf_long_long=fail if test "$cross_compiling" = yes; then @@ -5725,7 +5731,7 @@ else cat > conftest.$ac_ext <<EOF -#line 5729 "configure" +#line 5735 "configure" #include "confdefs.h" /* program */ @@ -5757,7 +5763,7 @@ } EOF -if { (eval echo configure:5761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -5787,7 +5793,7 @@ else cat > conftest.$ac_ext <<EOF -#line 5791 "configure" +#line 5797 "configure" #include "confdefs.h" /* program */ @@ -5819,7 +5825,7 @@ } EOF -if { (eval echo configure:5823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -5850,7 +5856,7 @@ fi echo $ac_n "checking if everything was available to use the 64-bit integral type""... $ac_c" 1>&6 -echo "configure:5854: checking if everything was available to use the 64-bit integral type" >&5 +echo "configure:5860: checking if everything was available to use the 64-bit integral type" >&5 if test "$wi_cv_type_long_long" = no ; then wi_cv_use_long_long_msg_result="no (long long type not available)" @@ -5929,7 +5935,7 @@ wi_struct_timeval_field_checks="cached" echo $ac_n "checking what type the tv_sec field of struct timeval is""... $ac_c" 1>&6 -echo "configure:5933: checking what type the tv_sec field of struct timeval is" >&5 +echo "configure:5939: checking what type the tv_sec field of struct timeval is" >&5 if eval "test \"`echo '$''{'wi_cv_struct_timeval_tv_sec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5950,7 +5956,7 @@ else cat > conftest.$ac_ext <<EOF -#line 5954 "configure" +#line 5960 "configure" #include "confdefs.h" /* program */ @@ -6030,7 +6036,7 @@ } EOF -if { (eval echo configure:6034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -6064,12 +6070,12 @@ if test "$wi_struct_timeval_field_checks" = "uncached" ; then guess="$guess2" echo $ac_n "checking what type the tv_usec field of struct timeval is""... $ac_c" 1>&6 -echo "configure:6068: checking what type the tv_usec field of struct timeval is" >&5 +echo "configure:6074: checking what type the tv_usec field of struct timeval is" >&5 echo "$ac_t""$guess$wi_cv_struct_timeval_tv_usec" 1>&6 else guess="$guess2" echo $ac_n "checking what type the tv_usec field of struct timeval is""... $ac_c" 1>&6 -echo "configure:6073: checking what type the tv_usec field of struct timeval is" >&5 +echo "configure:6079: checking what type the tv_usec field of struct timeval is" >&5 if eval "test \"`echo '$''{'wi_cv_struct_timeval_tv_usec'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6093,7 +6099,7 @@ # Extract the first word of ""perl"", so it can be a program name with args. set dummy "perl"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6097: checking for $ac_word" >&5 +echo "configure:6103: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6131,7 +6137,7 @@ # Extract the first word of ""mktemp"", so it can be a program name with args. set dummy "mktemp"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:6135: checking for $ac_word" >&5 +echo "configure:6141: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MKTEMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6176,7 +6182,7 @@ fi echo $ac_n "checking for return type from write""... $ac_c" 1>&6 -echo "configure:6180: checking for return type from write" >&5 +echo "configure:6186: checking for return type from write" >&5 if eval "test \"`echo '$''{'wi_cv_write_return_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6487,35 +6493,35 @@ echo "$ac_t""$wi_cv_write_return_t" 1>&6 if test "x$used_cache_for_wi_unistd_fpt" = "xno" ; then echo $ac_n "checking for size parameter to write""... $ac_c" 1>&6 -echo "configure:6491: checking for size parameter to write" >&5 +echo "configure:6497: checking for size parameter to write" >&5 echo "$ac_t""$wi_cv_write_size_t" 1>&6 echo $ac_n "checking for return type from send""... $ac_c" 1>&6 -echo "configure:6494: checking for return type from send" >&5 +echo "configure:6500: checking for return type from send" >&5 echo "$ac_t""$wi_cv_send_return_t" 1>&6 echo $ac_n "checking for size parameter to send""... $ac_c" 1>&6 -echo "configure:6497: checking for size parameter to send" >&5 +echo "configure:6503: checking for size parameter to send" >&5 echo "$ac_t""$wi_cv_send_size_t" 1>&6 echo $ac_n "checking for size parameter to connect""... $ac_c" 1>&6 -echo "configure:6500: checking for size parameter to connect" >&5 +echo "configure:6506: checking for size parameter to connect" >&5 echo "$ac_t""$wi_cv_sockaddr_size_t" 1>&6 echo $ac_n "checking for size parameter to setsockopt""... $ac_c" 1>&6 -echo "configure:6503: checking for size parameter to setsockopt" >&5 +echo "configure:6509: checking for size parameter to setsockopt" >&5 echo "$ac_t""$wi_cv_sockopt_size_t" 1>&6 echo $ac_n "checking for backlog parameter to listen""... $ac_c" 1>&6 -echo "configure:6506: checking for backlog parameter to listen" >&5 +echo "configure:6512: checking for backlog parameter to listen" >&5 echo "$ac_t""$wi_cv_listen_backlog_t" 1>&6 echo $ac_n "checking for seconds parameter to alarm""... $ac_c" 1>&6 -echo "configure:6509: checking for seconds parameter to alarm" >&5 +echo "configure:6515: checking for seconds parameter to alarm" >&5 echo "$ac_t""$wi_cv_alarm_time_t" 1>&6 echo $ac_n "checking for address parameter to gethostbyaddr""... $ac_c" 1>&6 -echo "configure:6512: checking for address parameter to gethostbyaddr" >&5 +echo "configure:6518: checking for address parameter to gethostbyaddr" >&5 echo "$ac_t""$wi_cv_gethost_addrptr_t" 1>&6 echo $ac_n "checking for size parameter to gethostname""... $ac_c" 1>&6 -echo "configure:6515: checking for size parameter to gethostname" >&5 +echo "configure:6521: checking for size parameter to gethostname" >&5 echo "$ac_t""$wi_cv_gethostname_size_t" 1>&6 else echo $ac_n "checking for size parameter to write""... $ac_c" 1>&6 -echo "configure:6519: checking for size parameter to write" >&5 +echo "configure:6525: checking for size parameter to write" >&5 if eval "test \"`echo '$''{'wi_cv_write_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6524,7 +6530,7 @@ echo "$ac_t""$wi_cv_write_size_t" 1>&6 echo $ac_n "checking for return type from send""... $ac_c" 1>&6 -echo "configure:6528: checking for return type from send" >&5 +echo "configure:6534: checking for return type from send" >&5 if eval "test \"`echo '$''{'wi_cv_send_return_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6533,7 +6539,7 @@ echo "$ac_t""$wi_cv_send_return_t" 1>&6 echo $ac_n "checking for size parameter to send""... $ac_c" 1>&6 -echo "configure:6537: checking for size parameter to send" >&5 +echo "configure:6543: checking for size parameter to send" >&5 if eval "test \"`echo '$''{'wi_cv_send_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6542,7 +6548,7 @@ echo "$ac_t""$wi_cv_send_size_t" 1>&6 echo $ac_n "checking for size parameter to connect""... $ac_c" 1>&6 -echo "configure:6546: checking for size parameter to connect" >&5 +echo "configure:6552: checking for size parameter to connect" >&5 if eval "test \"`echo '$''{'wi_cv_sockaddr_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6551,7 +6557,7 @@ echo "$ac_t""$wi_cv_sockaddr_size_t" 1>&6 echo $ac_n "checking for size parameter to setsockopt""... $ac_c" 1>&6 -echo "configure:6555: checking for size parameter to setsockopt" >&5 +echo "configure:6561: checking for size parameter to setsockopt" >&5 if eval "test \"`echo '$''{'wi_cv_sockopt_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6560,7 +6566,7 @@ echo "$ac_t""$wi_cv_sockopt_size_t" 1>&6 echo $ac_n "checking for backlog parameter to listen""... $ac_c" 1>&6 -echo "configure:6564: checking for backlog parameter to listen" >&5 +echo "configure:6570: checking for backlog parameter to listen" >&5 if eval "test \"`echo '$''{'wi_cv_listen_backlog_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6569,7 +6575,7 @@ echo "$ac_t""$wi_cv_listen_backlog_t" 1>&6 echo $ac_n "checking for seconds parameter to alarm""... $ac_c" 1>&6 -echo "configure:6573: checking for seconds parameter to alarm" >&5 +echo "configure:6579: checking for seconds parameter to alarm" >&5 if eval "test \"`echo '$''{'wi_cv_alarm_time_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6578,7 +6584,7 @@ echo "$ac_t""$wi_cv_alarm_time_t" 1>&6 echo $ac_n "checking for address parameter to gethostbyaddr""... $ac_c" 1>&6 -echo "configure:6582: checking for address parameter to gethostbyaddr" >&5 +echo "configure:6588: checking for address parameter to gethostbyaddr" >&5 if eval "test \"`echo '$''{'wi_cv_gethost_addrptr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6587,7 +6593,7 @@ echo "$ac_t""$wi_cv_gethost_addrptr_t" 1>&6 echo $ac_n "checking for size parameter to gethostname""... $ac_c" 1>&6 -echo "configure:6591: checking for size parameter to gethostname" >&5 +echo "configure:6597: checking for size parameter to gethostname" >&5 if eval "test \"`echo '$''{'wi_cv_gethostname_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6661,7 +6667,7 @@ fi echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6 -echo "configure:6665: checking types of arguments for select()" >&5 +echo "configure:6671: checking types of arguments for select()" >&5 if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6675,7 +6681,7 @@ for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do cat > conftest.$ac_ext <<EOF -#line 6679 "configure" +#line 6685 "configure" #include "confdefs.h" #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) /* MG */ # define _ALL_SOURCE 1 /* MG */ @@ -6694,7 +6700,7 @@ ; return 0; } EOF -if { (eval echo configure:6698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_not_found=no ; break 3 else @@ -6703,7 +6709,7 @@ rm -rf conftest* ac_not_found=yes fi -rm -rf conftest* +rm -f conftest* done done done @@ -6735,14 +6741,14 @@ if test "$wi_cv_lfs64" != "yes" ; then echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 -echo "configure:6739: checking for struct stat64" >&5 +echo "configure:6745: checking for struct stat64" >&5 echo "$ac_t""not needed" 1>&6 wi_cv_struct_stat64=no else echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 -echo "configure:6744: checking for struct stat64" >&5 +echo "configure:6750: checking for struct stat64" >&5 cat > conftest.$ac_ext <<EOF -#line 6746 "configure" +#line 6752 "configure" #include "confdefs.h" /* includes */ @@ -6759,7 +6765,7 @@ ; return 0; } EOF -if { (eval echo configure:6763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_struct_stat64=yes @@ -6776,7 +6782,7 @@ wi_cv_struct_stat64=no fi -rm -rf conftest* +rm -f conftest* echo "$ac_t""$wi_cv_struct_stat64" 1>&6 fi @@ -6787,9 +6793,9 @@ fi echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6 -echo "configure:6791: checking for sig_atomic_t" >&5 +echo "configure:6797: checking for sig_atomic_t" >&5 cat > conftest.$ac_ext <<EOF -#line 6793 "configure" +#line 6799 "configure" #include "confdefs.h" /* includes */ @@ -6814,7 +6820,7 @@ ; return 0; } EOF -if { (eval echo configure:6818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_type_sig_atomic_t=yes @@ -6827,7 +6833,7 @@ ac_cv_type_sig_atomic_t=no fi -rm -rf conftest* +rm -f conftest* echo "$ac_t""$ac_cv_type_sig_atomic_t" 1>&6 if test $ac_cv_type_sig_atomic_t = no ; then cat >> confdefs.h <<\EOF @@ -6838,7 +6844,7 @@ echo $ac_n "checking how to access getopt() global variables""... $ac_c" 1>&6 -echo "configure:6842: checking how to access getopt() global variables" >&5 +echo "configure:6848: checking how to access getopt() global variables" >&5 if eval "test \"`echo '$''{'wi_cv_getopt_decl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6849,7 +6855,7 @@ fi cat > conftest.$ac_ext <<EOF -#line 6853 "configure" +#line 6859 "configure" #include "confdefs.h" /* includes */ @@ -6868,7 +6874,7 @@ ; return 0; } EOF -if { (eval echo configure:6872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wi_cv_getopt_decl="automatic" else @@ -6877,13 +6883,13 @@ rm -rf conftest* wi_cv_getopt_decl="unknown" fi -rm -rf conftest* +rm -f conftest* if test "$wi_cv_getopt_decl" = unknown ; then cat > conftest.$ac_ext <<EOF -#line 6887 "configure" +#line 6893 "configure" #include "confdefs.h" /* includes */ @@ -6903,7 +6909,7 @@ ; return 0; } EOF -if { (eval echo configure:6907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6913: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # @@ -6921,7 +6927,7 @@ wi_cv_getopt_decl="manual" fi -rm -rf conftest* +rm -f conftest* fi fi @@ -6941,9 +6947,9 @@ echo $ac_n "checking for useable _res global variable""... $ac_c" 1>&6 -echo "configure:6945: checking for useable _res global variable" >&5 +echo "configure:6951: checking for useable _res global variable" >&5 cat > conftest.$ac_ext <<EOF -#line 6947 "configure" +#line 6953 "configure" #include "confdefs.h" /* includes */ @@ -6970,7 +6976,7 @@ ; return 0; } EOF -if { (eval echo configure:6974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv__res_defdname=yes @@ -6987,17 +6993,17 @@ wi_cv__res_defdname=no fi -rm -rf conftest* +rm -f conftest* echo "$ac_t""$wi_cv__res_defdname" 1>&6 echo $ac_n "checking for struct cmsghdr""... $ac_c" 1>&6 -echo "configure:6995: checking for struct cmsghdr" >&5 +echo "configure:7001: checking for struct cmsghdr" >&5 if eval "test \"`echo '$''{'wi_cv_struct_cmsghdr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7001 "configure" +#line 7007 "configure" #include "confdefs.h" /* includes */ @@ -7018,7 +7024,7 @@ ; return 0; } EOF -if { (eval echo configure:7022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_struct_cmsghdr=yes @@ -7031,7 +7037,7 @@ wi_cv_struct_cmsghdr=no fi -rm -rf conftest* +rm -f conftest* fi @@ -7044,13 +7050,13 @@ fi echo $ac_n "checking for msg_control field in struct msghdr""... $ac_c" 1>&6 -echo "configure:7048: checking for msg_control field in struct msghdr" >&5 +echo "configure:7054: checking for msg_control field in struct msghdr" >&5 if eval "test \"`echo '$''{'wi_cv_msghdr_control'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7054 "configure" +#line 7060 "configure" #include "confdefs.h" /* includes */ @@ -7070,7 +7076,7 @@ ; return 0; } EOF -if { (eval echo configure:7074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_msghdr_control=yes @@ -7083,7 +7089,7 @@ wi_cv_msghdr_control=no fi -rm -rf conftest* +rm -f conftest* fi @@ -7096,13 +7102,13 @@ fi echo $ac_n "checking for msg_accrights field in struct msghdr""... $ac_c" 1>&6 -echo "configure:7100: checking for msg_accrights field in struct msghdr" >&5 +echo "configure:7106: checking for msg_accrights field in struct msghdr" >&5 if eval "test \"`echo '$''{'wi_cv_msghdr_accrights'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 7106 "configure" +#line 7112 "configure" #include "confdefs.h" /* includes */ @@ -7122,7 +7128,7 @@ ; return 0; } EOF -if { (eval echo configure:7126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_msghdr_accrights=yes @@ -7135,7 +7141,7 @@ wi_cv_msghdr_accrights=no fi -rm -rf conftest* +rm -f conftest* fi @@ -7162,17 +7168,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7166: checking for $ac_hdr" >&5 +echo "configure:7172: 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 -#line 7171 "configure" +#line 7177 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:7182: \"$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* @@ -7184,7 +7190,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -7200,11 +7206,11 @@ if test "$ac_cv_header_sys_select_h" = yes ; then echo $ac_n "checking if <sys/select.h> is compatible with <sys/time.h>""... $ac_c" 1>&6 -echo "configure:7204: checking if <sys/select.h> is compatible with <sys/time.h>" >&5 +echo "configure:7210: checking if <sys/select.h> is compatible with <sys/time.h>" >&5 selecth=yes if test "$ac_cv_header_sys_time_h" = yes ; then cat > conftest.$ac_ext <<EOF -#line 7208 "configure" +#line 7214 "configure" #include "confdefs.h" #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__) @@ -7224,7 +7230,7 @@ tmval.tv_sec = 0; ; return 0; } EOF -if { (eval echo configure:7228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* selecth=yes else @@ -7233,7 +7239,7 @@ rm -rf conftest* selecth=no fi -rm -rf conftest* +rm -f conftest* fi if test "$selecth" = yes ; then cat >> confdefs.h <<\EOF @@ -7245,6 +7251,243 @@ fi +echo $ac_n "checking whether to enable ipv6""... $ac_c" 1>&6 +echo "configure:7256: checking whether to enable ipv6" >&5 +# Check whether --enable-ipv6 or --disable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then + enableval="$enable_ipv6" + case "$enableval" in + no) + echo "$ac_t""no" 1>&6 + ipv6=no + ;; + *) echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define ENABLE_IPV6 1 +EOF + + ipv6=yes + ;; + esac +else + if test "$cross_compiling" = yes; then + echo "$ac_t""no" 1>&6 + ipv6=no + +else + cat > conftest.$ac_ext <<EOF +#line 7280 "configure" +#include "confdefs.h" + /* AF_INET6 avalable check */ +#define INET6 +#include <sys/types.h> +#include <sys/socket.h> +main() +{ + if (socket(AF_INET6, SOCK_STREAM, 0) < 0) + exit(1); + else + exit(0); +} + +EOF +if { (eval echo configure:7295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define ENABLE_IPV6 1 +EOF + + ipv6=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + echo "$ac_t""no" 1>&6 + ipv6=no +fi +rm -fr conftest* +fi + +fi + + +echo $ac_n "checking for getaddrinfo""... $ac_c" 1>&6 +echo "configure:7317: 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 <<EOF +#line 7322 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getaddrinfo(); below. */ +#include <assert.h> +/* 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:7345: \"$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 <<\EOF +#define HAVE_GETADDRINFO 1 +EOF + +else + echo "$ac_t""no" 1>&6 + + LIBOBJS="$LIBOBJS getaddrinfo.o" + LIBSOBJS="$LIBSOBJS getaddrinfo.so" + +fi + + +echo $ac_n "checking for getnameinfo""... $ac_c" 1>&6 +echo "configure:7374: checking for getnameinfo" >&5 +if eval "test \"`echo '$''{'ac_cv_func_getnameinfo'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 7379 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getnameinfo(); below. */ +#include <assert.h> +/* 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 getnameinfo(); + +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_getnameinfo) || defined (__stub___getnameinfo) +choke me +#else +getnameinfo(); +#endif + +; return 0; } +EOF +if { (eval echo configure:7402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_getnameinfo=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_getnameinfo=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'getnameinfo`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + cat >> confdefs.h <<\EOF +#define HAVE_GETNAMEINFO 1 +EOF + +else + echo "$ac_t""no" 1>&6 + + LIBOBJS="$LIBOBJS getnameinfo.o" + LIBSOBJS="$LIBSOBJS getnameinfo.so" + +fi + + +# check if sockaddr has sa_len member +echo $ac_n "checking if sockaddr has sa_len member""... $ac_c" 1>&6 +echo "configure:7432: checking if sockaddr has sa_len member" >&5 +cat > conftest.$ac_ext <<EOF +#line 7434 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/socket.h> +int main() { +struct sockaddr x; +x.sa_len = 0; +; return 0; } +EOF +if { (eval echo configure:7443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_SOCKADDR_SA_LEN 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + +# check if sockaddr_storage has ss_family member +echo $ac_n "checking if sockaddr_storage has ss_family member""... $ac_c" 1>&6 +echo "configure:7460: checking if sockaddr_storage has ss_family member" >&5 +cat > conftest.$ac_ext <<EOF +#line 7462 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/socket.h> +int main() { +struct sockaddr_storage x; +x.__ss_family = 0; +; return 0; } +EOF +if { (eval echo configure:7471: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 +EOF + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_SOCKADDR_STORAGE___SS_FAMILY 1 +EOF + + CPPFLAGS="$CPPFLAGS -D__ss_family=ss_family -D__ss_len=ss_len" +fi +rm -f conftest* + +CPPFLAGS="-I$MAINDIR $CPPFLAGS" if test "${SYS}" = sunos ; then @@ -7253,12 +7496,12 @@ for ac_func in getwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7257: checking for $ac_func" >&5 +echo "configure:7500: 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 <<EOF -#line 7262 "configure" +#line 7505 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7281,7 +7524,7 @@ ; return 0; } EOF -if { (eval echo configure:7285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7528: \"$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 @@ -7290,7 +7533,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -7309,12 +7552,12 @@ for ac_func in getcwd getwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7313: checking for $ac_func" >&5 +echo "configure:7556: 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 <<EOF -#line 7318 "configure" +#line 7561 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7337,7 +7580,7 @@ ; return 0; } EOF -if { (eval echo configure:7341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7584: \"$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 @@ -7346,7 +7589,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -7375,12 +7618,12 @@ for ac_func in fstat64 getdomainname gethostname getpass getpassphrase gnu_get_libc_release gnu_get_libc_version inet_aton inet_ntop llseek lseek64 lstat64 memmove mktime open64 pathconf readlink res_init setlocale setpgid setpgrp setsid setvbuf sigaction sigsetjmp stat64 strcasecmp strcoll strdup strerror strncoll strstr strtoq symlink sysconf sysctl sysinfo syslog tcgetattr uname waitpid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7379: checking for $ac_func" >&5 +echo "configure:7622: 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 <<EOF -#line 7384 "configure" +#line 7627 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7403,7 +7646,7 @@ ; return 0; } EOF -if { (eval echo configure:7407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7650: \"$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 @@ -7412,7 +7655,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -7430,12 +7673,12 @@ for ac_func in gethostbyaddr_r gethostbyname_r gethostbyname2_r getlogin_r getpwnam_r _posix_getpwnam_r getpwuid_r _posix_getpwuid_r getservbyname_r getservbyport_r gmtime_r localtime_r readdir_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7434: checking for $ac_func" >&5 +echo "configure:7677: 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 <<EOF -#line 7439 "configure" +#line 7682 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7458,7 +7701,7 @@ ; return 0; } EOF -if { (eval echo configure:7462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7705: \"$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 @@ -7467,7 +7710,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -7489,12 +7732,12 @@ for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7493: checking for $ac_func" >&5 +echo "configure:7736: 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 <<EOF -#line 7498 "configure" +#line 7741 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7517,7 +7760,7 @@ ; return 0; } EOF -if { (eval echo configure:7521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7764: \"$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 @@ -7526,7 +7769,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -7545,7 +7788,7 @@ if test "$ac_cv_func_snprintf" != "no" ; then echo $ac_n "checking if snprintf works correctly""... $ac_c" 1>&6 -echo "configure:7549: checking if snprintf works correctly" >&5 +echo "configure:7792: checking if snprintf works correctly" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SNPRINTF_TERMINATES." 1>&2; exit 1; } @@ -7564,7 +7807,7 @@ else cat > conftest.$ac_ext <<EOF -#line 7568 "configure" +#line 7811 "configure" #include "confdefs.h" /* program */ @@ -7602,7 +7845,7 @@ } EOF -if { (eval echo configure:7606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -7633,7 +7876,7 @@ echo $ac_n "checking what snprintf() returns""... $ac_c" 1>&6 -echo "configure:7637: checking what snprintf() returns" >&5 +echo "configure:7880: checking what snprintf() returns" >&5 if test "$cross_compiling" = yes; then # action if cross compiling @@ -7643,7 +7886,7 @@ else cat > conftest.$ac_ext <<EOF -#line 7647 "configure" +#line 7890 "configure" #include "confdefs.h" /* program */ @@ -7676,7 +7919,7 @@ } EOF -if { (eval echo configure:7680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -7707,7 +7950,7 @@ if [ "$ac_cv_func_snprintf" = "no" ] || [ "$wi_cv_snprintf_terminates" = "no" ] || [ "$wi_cv_snprintf_returns_ptr" = "yes" ] ; then echo $ac_n "checking for snprintf in -lsnprintf""... $ac_c" 1>&6 -echo "configure:7711: checking for snprintf in -lsnprintf" >&5 +echo "configure:7954: checking for snprintf in -lsnprintf" >&5 ac_lib_var=`echo snprintf'_'snprintf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7715,7 +7958,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsnprintf $LIBS" cat > conftest.$ac_ext <<EOF -#line 7719 "configure" +#line 7962 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7726,7 +7969,7 @@ snprintf() ; return 0; } EOF -if { (eval echo configure:7730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7973: \"$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 @@ -7735,7 +7978,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -7759,17 +8002,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7763: checking for $ac_hdr" >&5 +echo "configure:8006: 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 -#line 7768 "configure" +#line 8011 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7773: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8016: \"$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* @@ -7781,7 +8024,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -7798,12 +8041,12 @@ for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7802: checking for $ac_func" >&5 +echo "configure:8045: 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 <<EOF -#line 7807 "configure" +#line 8050 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7826,7 +8069,7 @@ ; return 0; } EOF -if { (eval echo configure:7830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8073: \"$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 @@ -7835,7 +8078,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -7857,7 +8100,7 @@ if [ "$ac_cv_func_snprintf" = "no" ] || [ "$wi_cv_snprintf_terminates" = "no" ] || [ "$wi_cv_snprintf_returns_ptr" = "yes" ] ; then echo $ac_n "checking for snprintf in -lsnprintf""... $ac_c" 1>&6 -echo "configure:7861: checking for snprintf in -lsnprintf" >&5 +echo "configure:8104: checking for snprintf in -lsnprintf" >&5 ac_lib_var=`echo snprintf'_'snprintf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7865,7 +8108,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsnprintf $LIBS" cat > conftest.$ac_ext <<EOF -#line 7869 "configure" +#line 8112 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -7876,7 +8119,7 @@ snprintf() ; return 0; } EOF -if { (eval echo configure:7880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8123: \"$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 @@ -7885,7 +8128,7 @@ rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi -rm -rf conftest* +rm -f conftest* LIBS="$ac_save_LIBS" fi @@ -7909,17 +8152,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:7913: checking for $ac_hdr" >&5 +echo "configure:8156: 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 -#line 7918 "configure" +#line 8161 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:7923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8166: \"$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* @@ -7931,7 +8174,7 @@ rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 @@ -7948,12 +8191,12 @@ for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7952: checking for $ac_func" >&5 +echo "configure:8195: 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 <<EOF -#line 7957 "configure" +#line 8200 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -7976,7 +8219,7 @@ ; return 0; } EOF -if { (eval echo configure:7980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8223: \"$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 @@ -7985,7 +8228,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -8006,7 +8249,7 @@ if test "$ac_cv_func_snprintf" != "no" ; then echo $ac_n "checking if snprintf works correctly""... $ac_c" 1>&6 -echo "configure:8010: checking if snprintf works correctly" >&5 +echo "configure:8253: checking if snprintf works correctly" >&5 if test "x$ac_cv_header_unistd_h" = x ; then { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SNPRINTF_TERMINATES." 1>&2; exit 1; } @@ -8025,7 +8268,7 @@ else cat > conftest.$ac_ext <<EOF -#line 8029 "configure" +#line 8272 "configure" #include "confdefs.h" /* program */ @@ -8063,7 +8306,7 @@ } EOF -if { (eval echo configure:8067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -8094,7 +8337,7 @@ echo $ac_n "checking what snprintf() returns""... $ac_c" 1>&6 -echo "configure:8098: checking what snprintf() returns" >&5 +echo "configure:8341: checking what snprintf() returns" >&5 if test "$cross_compiling" = yes; then # action if cross compiling @@ -8104,7 +8347,7 @@ else cat > conftest.$ac_ext <<EOF -#line 8108 "configure" +#line 8351 "configure" #include "confdefs.h" /* program */ @@ -8137,7 +8380,7 @@ } EOF -if { (eval echo configure:8141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then # action if true @@ -8174,14 +8417,14 @@ fi echo $ac_n "checking for sigsetjmp and siglongjmp""... $ac_c" 1>&6 -echo "configure:8178: checking for sigsetjmp and siglongjmp" >&5 +echo "configure:8421: checking for sigsetjmp and siglongjmp" >&5 if eval "test \"`echo '$''{'wi_cv_func_sigsetjmp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8185 "configure" +#line 8428 "configure" #include "confdefs.h" /* includes */ @@ -8204,7 +8447,7 @@ ; return 0; } EOF -if { (eval echo configure:8208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* wi_cv_func_sigsetjmp=yes @@ -8217,7 +8460,7 @@ wi_cv_func_sigsetjmp=no fi -rm -rf conftest* +rm -f conftest* fi @@ -8234,12 +8477,12 @@ for ac_func in setpgid setpgrp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8238: checking for $ac_func" >&5 +echo "configure:8481: 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 <<EOF -#line 8243 "configure" +#line 8486 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -8262,7 +8505,7 @@ ; return 0; } EOF -if { (eval echo configure:8266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8509: \"$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 @@ -8271,7 +8514,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -8288,7 +8531,7 @@ fi echo $ac_n "checking if setpgrp behavior needs to be checked""... $ac_c" 1>&6 -echo "configure:8292: checking if setpgrp behavior needs to be checked" >&5 +echo "configure:8535: checking if setpgrp behavior needs to be checked" >&5 if test "x$ac_cv_func_setpgid" = "xyes" ; then # OK, we will be using setpgid instead of setpgrp then... echo "$ac_t""no" 1>&6 @@ -8296,7 +8539,7 @@ elif test "x$cross_compiling" = "xyes" ; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8300: checking whether setpgrp takes no argument" >&5 +echo "configure:8543: checking whether setpgrp takes no argument" >&5 case "`uname -a`" in *BSD*|*bsd*) ac_cv_func_setpgrp_void="no" @@ -8314,7 +8557,7 @@ # We're not cross compiling, so we can try this check echo "$ac_t""yes" 1>&6 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8318: checking whether setpgrp takes no argument" >&5 +echo "configure:8561: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8322,7 +8565,7 @@ { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 8326 "configure" +#line 8569 "configure" #include "confdefs.h" #ifdef HAVE_UNISTD_H @@ -8342,7 +8585,7 @@ } EOF -if { (eval echo configure:8346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -8369,13 +8612,13 @@ echo $ac_n "checking whether setvbuf behavior can be checked""... $ac_c" 1>&6 -echo "configure:8373: checking whether setvbuf behavior can be checked" >&5 +echo "configure:8616: checking whether setvbuf behavior can be checked" >&5 if test "x$cross_compiling" = "xyes" ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6 -echo "configure:8379: checking whether setvbuf arguments are reversed" >&5 +echo "configure:8622: checking whether setvbuf arguments are reversed" >&5 if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8383,7 +8626,7 @@ ac_cv_func_setvbuf_reversed=no else cat > conftest.$ac_ext <<EOF -#line 8387 "configure" +#line 8630 "configure" #include "confdefs.h" #include <stdio.h> /* If setvbuf has the reversed format, exit 0. */ @@ -8397,7 +8640,7 @@ exit(0); /* Non-reversed systems segv here. */ } EOF -if { (eval echo configure:8401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setvbuf_reversed=yes else @@ -8424,19 +8667,19 @@ # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:8428: checking for working alloca.h" >&5 +echo "configure:8671: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8433 "configure" +#line 8676 "configure" #include "confdefs.h" #include <alloca.h> int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:8440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -8445,7 +8688,7 @@ rm -rf conftest* ac_cv_header_alloca_h=no fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 @@ -8457,12 +8700,12 @@ fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8461: checking for alloca" >&5 +echo "configure:8704: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8466 "configure" +#line 8709 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -8490,7 +8733,7 @@ char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:8494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -8499,7 +8742,7 @@ rm -rf conftest* ac_cv_func_alloca_works=no fi -rm -rf conftest* +rm -f conftest* fi echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 @@ -8522,12 +8765,12 @@ echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8526: checking whether alloca needs Cray hooks" >&5 +echo "configure:8769: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 8531 "configure" +#line 8774 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -8544,7 +8787,7 @@ rm -rf conftest* ac_cv_os_cray=no fi -rm -rf conftest* +rm -f conftest* fi @@ -8552,12 +8795,12 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8556: checking for $ac_func" >&5 +echo "configure:8799: 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 <<EOF -#line 8561 "configure" +#line 8804 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -8580,7 +8823,7 @@ ; return 0; } EOF -if { (eval echo configure:8584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8827: \"$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 @@ -8589,7 +8832,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -8607,7 +8850,7 @@ fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8611: checking stack direction for C alloca" >&5 +echo "configure:8854: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8615,7 +8858,7 @@ ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 8619 "configure" +#line 8862 "configure" #include "confdefs.h" find_stack_direction () { @@ -8634,7 +8877,7 @@ exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:8638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -8675,7 +8918,7 @@ fi echo $ac_n "checking string parameter to waddstr""... $ac_c" 1>&6 -echo "configure:8679: checking string parameter to waddstr" >&5 +echo "configure:8922: checking string parameter to waddstr" >&5 if eval "test \"`echo '$''{'wi_cv_waddstr_str_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8878,9 +9121,9 @@ # maxx or _maxx echo $ac_n "checking whether curses structure has maxx or _maxx field""... $ac_c" 1>&6 -echo "configure:8882: checking whether curses structure has maxx or _maxx field" >&5 +echo "configure:9125: checking whether curses structure has maxx or _maxx field" >&5 cat > conftest.$ac_ext <<EOF -#line 8884 "configure" +#line 9127 "configure" #include "confdefs.h" /* includes */ @@ -8910,7 +9153,7 @@ ; return 0; } EOF -if { (eval echo configure:8914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9157: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""maxx" 1>&6 @@ -8927,18 +9170,18 @@ echo "$ac_t""_maxx" 1>&6 fi -rm -rf conftest* +rm -f conftest* if test "${SYS-hpux}" = hpux ; then for ac_func in __getcurx __getcury __getmaxx __getmaxy __getbegx __getbegy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8937: checking for $ac_func" >&5 +echo "configure:9180: 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 <<EOF -#line 8942 "configure" +#line 9185 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -8961,7 +9204,7 @@ ; return 0; } EOF -if { (eval echo configure:8965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9208: \"$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 @@ -8970,7 +9213,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -8989,9 +9232,9 @@ # getcurx echo $ac_n "checking for getcurx() functionality in curses library""... $ac_c" 1>&6 -echo "configure:8993: checking for getcurx() functionality in curses library" >&5 +echo "configure:9236: checking for getcurx() functionality in curses library" >&5 cat > conftest.$ac_ext <<EOF -#line 8995 "configure" +#line 9238 "configure" #include "confdefs.h" /* includes */ @@ -9021,7 +9264,7 @@ ; return 0; } EOF -if { (eval echo configure:9025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9038,13 +9281,13 @@ echo "$ac_t""no" 1>&6 fi -rm -rf conftest* +rm -f conftest* # getyx echo $ac_n "checking for getyx() functionality in curses library""... $ac_c" 1>&6 -echo "configure:9046: checking for getyx() functionality in curses library" >&5 +echo "configure:9289: checking for getyx() functionality in curses library" >&5 cat > conftest.$ac_ext <<EOF -#line 9048 "configure" +#line 9291 "configure" #include "confdefs.h" /* includes */ @@ -9074,7 +9317,7 @@ ; return 0; } EOF -if { (eval echo configure:9078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9091,13 +9334,13 @@ echo "$ac_t""no" 1>&6 fi -rm -rf conftest* +rm -f conftest* # getmaxx echo $ac_n "checking for getmaxx() functionality in curses library""... $ac_c" 1>&6 -echo "configure:9099: checking for getmaxx() functionality in curses library" >&5 +echo "configure:9342: checking for getmaxx() functionality in curses library" >&5 cat > conftest.$ac_ext <<EOF -#line 9101 "configure" +#line 9344 "configure" #include "confdefs.h" /* includes */ @@ -9126,7 +9369,7 @@ ; return 0; } EOF -if { (eval echo configure:9130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9143,13 +9386,13 @@ echo "$ac_t""no" 1>&6 fi -rm -rf conftest* +rm -f conftest* # getmaxyx echo $ac_n "checking for getmaxyx() functionality in curses library""... $ac_c" 1>&6 -echo "configure:9151: checking for getmaxyx() functionality in curses library" >&5 +echo "configure:9394: checking for getmaxyx() functionality in curses library" >&5 cat > conftest.$ac_ext <<EOF -#line 9153 "configure" +#line 9396 "configure" #include "confdefs.h" /* includes */ @@ -9178,7 +9421,7 @@ ; return 0; } EOF -if { (eval echo configure:9182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9195,13 +9438,13 @@ echo "$ac_t""no" 1>&6 fi -rm -rf conftest* +rm -f conftest* # getbegx echo $ac_n "checking for getbegx() functionality in curses library""... $ac_c" 1>&6 -echo "configure:9203: checking for getbegx() functionality in curses library" >&5 +echo "configure:9446: checking for getbegx() functionality in curses library" >&5 cat > conftest.$ac_ext <<EOF -#line 9205 "configure" +#line 9448 "configure" #include "confdefs.h" /* includes */ @@ -9231,7 +9474,7 @@ ; return 0; } EOF -if { (eval echo configure:9235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9248,13 +9491,13 @@ echo "$ac_t""no" 1>&6 fi -rm -rf conftest* +rm -f conftest* # getbegyx echo $ac_n "checking for getbegyx() functionality in curses library""... $ac_c" 1>&6 -echo "configure:9256: checking for getbegyx() functionality in curses library" >&5 +echo "configure:9499: checking for getbegyx() functionality in curses library" >&5 cat > conftest.$ac_ext <<EOF -#line 9258 "configure" +#line 9501 "configure" #include "confdefs.h" /* includes */ @@ -9283,7 +9526,7 @@ ; return 0; } EOF -if { (eval echo configure:9287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9300,13 +9543,13 @@ echo "$ac_t""no" 1>&6 fi -rm -rf conftest* +rm -f conftest* # touchwin echo $ac_n "checking for touchwin() functionality in curses library""... $ac_c" 1>&6 -echo "configure:9308: checking for touchwin() functionality in curses library" >&5 +echo "configure:9551: checking for touchwin() functionality in curses library" >&5 cat > conftest.$ac_ext <<EOF -#line 9310 "configure" +#line 9553 "configure" #include "confdefs.h" /* includes */ @@ -9333,7 +9576,7 @@ ; return 0; } EOF -if { (eval echo configure:9337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9350,13 +9593,13 @@ echo "$ac_t""no" 1>&6 fi -rm -rf conftest* +rm -f conftest* # beep echo $ac_n "checking for beep() functionality in curses library""... $ac_c" 1>&6 -echo "configure:9358: checking for beep() functionality in curses library" >&5 +echo "configure:9601: checking for beep() functionality in curses library" >&5 cat > conftest.$ac_ext <<EOF -#line 9360 "configure" +#line 9603 "configure" #include "confdefs.h" /* includes */ @@ -9382,7 +9625,7 @@ ; return 0; } EOF -if { (eval echo configure:9386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9629: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9399,17 +9642,17 @@ echo "$ac_t""no" 1>&6 fi -rm -rf conftest* +rm -f conftest* for ac_func in keypad nodelay curs_set doupdate wnoutrefresh do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9408: checking for $ac_func" >&5 +echo "configure:9651: 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 <<EOF -#line 9413 "configure" +#line 9656 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -9432,7 +9675,7 @@ ; return 0; } EOF -if { (eval echo configure:9436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9679: \"$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 @@ -9441,7 +9684,7 @@ rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi -rm -rf conftest* +rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then @@ -9469,7 +9712,7 @@ echo $ac_n "checking for long file names""... $ac_c" 1>&6 -echo "configure:9473: checking for long file names" >&5 +echo "configure:9716: 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 @@ -9513,7 +9756,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:9517: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:9760: 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 @@ -9543,7 +9786,7 @@ # Extract the first word of ""gtar"", so it can be a program name with args. set dummy "gtar"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:9547: checking for $ac_word" >&5 +echo "configure:9790: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9582,7 +9825,7 @@ # Extract the first word of ""tar"", so it can be a program name with args. set dummy "tar"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:9586: checking for $ac_word" >&5 +echo "configure:9829: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9630,7 +9873,7 @@ echo $ac_n "checking how to create TAR files""... $ac_c" 1>&6 -echo "configure:9634: checking how to create TAR files" >&5 +echo "configure:9877: checking how to create TAR files" >&5 x="" if [ -x /usr/bin/what ] ; then x=`/usr/bin/what "$TAR" 2>&1 | sed -n 's/.*pax.*/pax/g;/pax/p'` @@ -9688,7 +9931,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:9692: checking for $ac_word" >&5 +echo "configure:9935: 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 @@ -9718,7 +9961,7 @@ echo $ac_n "checking for ar""... $ac_c" 1>&6 -echo "configure:9722: checking for ar" >&5 +echo "configure:9965: checking for ar" >&5 AR="ar" if [ "x$cross_compiling" = "xyes" ] ; then machine=`${CC-gcc} -dumpmachine 2>/dev/null` @@ -9749,7 +9992,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:9753: checking for a BSD compatible install" >&5 +echo "configure:9996: 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 @@ -9805,7 +10048,7 @@ # Extract the first word of ""pwd"", so it can be a program name with args. set dummy "pwd"; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:9809: checking for $ac_word" >&5 +echo "configure:10052: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_wi_PWD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9842,13 +10085,13 @@ if test "x$use_ccdv" = "xno" ; then echo $ac_n "checking for ccdv""... $ac_c" 1>&6 -echo "configure:9846: checking for ccdv" >&5 +echo "configure:10089: checking for ccdv" >&5 echo "$ac_t""(disabled)" 1>&6 else unset wi_cv_path_ccdv # can't use cache if it was a temp prog last time wi_used_cache_path_ccdv="yes" echo $ac_n "checking for ccdv""... $ac_c" 1>&6 -echo "configure:9852: checking for ccdv" >&5 +echo "configure:10095: checking for ccdv" >&5 if eval "test \"`echo '$''{'wi_cv_path_ccdv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10358,7 +10601,7 @@ echo $ac_n "checking if shell can test for symlinks""... $ac_c" 1>&6 -echo "configure:10362: checking if shell can test for symlinks" >&5 +echo "configure:10605: checking if shell can test for symlinks" >&5 if eval "test \"`echo '$''{'wi_cv_shell_test_symlinks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10856,19 +11099,19 @@ echo $ac_n "checking CFLAGS""... $ac_c" 1>&6 -echo "configure:10860: checking CFLAGS" >&5 +echo "configure:11103: checking CFLAGS" >&5 echo "$ac_t""$CFLAGS" 1>&6 echo $ac_n "checking CPPFLAGS""... $ac_c" 1>&6 -echo "configure:10863: checking CPPFLAGS" >&5 +echo "configure:11106: checking CPPFLAGS" >&5 echo "$ac_t""$CPPFLAGS" 1>&6 echo $ac_n "checking DEFS""... $ac_c" 1>&6 -echo "configure:10866: checking DEFS" >&5 +echo "configure:11109: checking DEFS" >&5 echo "$ac_t""$DEFS" 1>&6 echo $ac_n "checking LDFLAGS""... $ac_c" 1>&6 -echo "configure:10869: checking LDFLAGS" >&5 +echo "configure:11112: checking LDFLAGS" >&5 echo "$ac_t""$LDFLAGS" 1>&6 echo $ac_n "checking LIBS""... $ac_c" 1>&6 -echo "configure:10872: checking LIBS" >&5 +echo "configure:11115: checking LIBS" >&5 echo "$ac_t""$LIBS" 1>&6 # # Also take the opportunity to do some post-configure clean-up @@ -10893,6 +11136,8 @@ + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -11062,6 +11307,8 @@ s%@Z30@%$Z30%g s%@Z31@%$Z31%g s%@LIBSET@%$LIBSET%g +s%@LIBOBJS@%$LIBOBJS%g +s%@LIBSOBJS@%$LIBSOBJS%g s%@MAINDIR@%$MAINDIR%g s%@NCFTP_VERSION@%$NCFTP_VERSION%g s%@LIBNCFTP_VERSION@%$LIBNCFTP_VERSION%g Index: ncftp3/configure.in diff -u ncftp3/configure.in:1.1.1.17 ncftp3/configure.in:1.28 --- ncftp3/configure.in:1.1.1.17 Thu Nov 5 16:20:41 2009 +++ ncftp3/configure.in Thu Nov 5 16:47:08 2009 @@ -13,8 +13,6 @@ wi_ARG_ENABLE_SSP wi_ARG_DISABLE_MACOSX_UNIVERSAL - - dnl --------------------------------------------------------------------------- dnl Environment and compiler settings. dnl --------------------------------------------------------------------------- @@ -113,6 +111,81 @@ wi_HEADER_SYS_SELECT_H dnl # sio +dnl --------------------------------------------------------------------------- +dnl Checks for IPv6. +dnl --------------------------------------------------------------------------- +dnl +AC_MSG_CHECKING([whether to enable ipv6]) +AC_ARG_ENABLE(ipv6, +[ --enable-ipv6 Enable ipv6 (with ipv4) support + --disable-ipv6 Disable ipv6 support], +[ case "$enableval" in + no) + AC_MSG_RESULT(no) + ipv6=no + ;; + *) AC_MSG_RESULT(yes) + AC_DEFINE(ENABLE_IPV6) + ipv6=yes + ;; + esac ], + + AC_TRY_RUN([ /* AF_INET6 avalable check */ +#define INET6 +#include <sys/types.h> +#include <sys/socket.h> +main() +{ + if (socket(AF_INET6, SOCK_STREAM, 0) < 0) + exit(1); + else + exit(0); +} +], + AC_MSG_RESULT(yes) + AC_DEFINE(ENABLE_IPV6) + ipv6=yes, + AC_MSG_RESULT(no) + ipv6=no, + AC_MSG_RESULT(no) + ipv6=no +)) + +AC_CHECK_FUNC(getaddrinfo, [ + AC_DEFINE(HAVE_GETADDRINFO)], [ + LIBOBJS="$LIBOBJS getaddrinfo.o" + LIBSOBJS="$LIBSOBJS getaddrinfo.so" +]) + +AC_CHECK_FUNC(getnameinfo, [ + AC_DEFINE(HAVE_GETNAMEINFO)], [ + LIBOBJS="$LIBOBJS getnameinfo.o" + LIBSOBJS="$LIBSOBJS getnameinfo.so" +]) + +# check if sockaddr has sa_len member +AC_MSG_CHECKING(if sockaddr has sa_len member) +AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/socket.h>], +[struct sockaddr x; +x.sa_len = 0;], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SOCKADDR_SA_LEN), + AC_MSG_RESULT(no)) + +# check if sockaddr_storage has ss_family member +AC_MSG_CHECKING(if sockaddr_storage has ss_family member) +AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/socket.h>], +[struct sockaddr_storage x; +x.__ss_family = 0;], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SOCKADDR_STORAGE_SS_FAMILY), + AC_MSG_RESULT(no) + AC_DEFINE(HAVE_SOCKADDR_STORAGE___SS_FAMILY) + CPPFLAGS="$CPPFLAGS -D__ss_family=ss_family -D__ss_len=ss_len") + +CPPFLAGS="-I$MAINDIR $CPPFLAGS" dnl --------------------------------------------------------------------------- dnl Checks for library functions. @@ -258,6 +331,8 @@ AC_SUBST(Z30) AC_SUBST(Z31) AC_SUBST(LIBSET) +AC_SUBST(LIBOBJS) +AC_SUBST(LIBSOBJS) AC_SUBST(MAINDIR) AC_SUBST(NCFTP_VERSION) AC_SUBST(LIBNCFTP_VERSION) Index: ncftp3/Strn/tester Index: ncftp3/libncftp/addrinfo.h diff -u /dev/null ncftp3/libncftp/addrinfo.h:1.2 --- /dev/null Mon Nov 9 21:52:32 2009 +++ ncftp3/libncftp/addrinfo.h Tue Nov 20 02:53:11 2001 @@ -0,0 +1,104 @@ +/* + * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef HAVE_GETADDRINFO + +/* + * Error return codes from getaddrinfo() + */ +#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ +#define EAI_AGAIN 2 /* temporary failure in name resolution */ +#define EAI_BADFLAGS 3 /* invalid value for ai_flags */ +#define EAI_FAIL 4 /* non-recoverable failure in name resolution */ +#define EAI_FAMILY 5 /* ai_family not supported */ +#define EAI_MEMORY 6 /* memory allocation failure */ +#define EAI_NODATA 7 /* no address associated with hostname */ +#define EAI_NONAME 8 /* hostname nor servname provided, or not known */ +#define EAI_SERVICE 9 /* servname not supported for ai_socktype */ +#define EAI_SOCKTYPE 10 /* ai_socktype not supported */ +#define EAI_SYSTEM 11 /* system error returned in errno */ +#define EAI_BADHINTS 12 +#define EAI_PROTOCOL 13 +#define EAI_MAX 14 + +/* + * Flag values for getaddrinfo() + */ +#define AI_PASSIVE 0x00000001 /* get address to use bind() */ +#define AI_CANONNAME 0x00000002 /* fill ai_canonname */ +#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */ +/* valid flags for addrinfo */ +#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST) + +#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */ +#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */ +#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */ +#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */ +/* special recommended flags for getipnodebyname */ +#define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG) + +/* + * Constants for getnameinfo() + */ +#define NI_MAXHOST 1025 +#define NI_MAXSERV 32 + +/* + * Flag values for getnameinfo() + */ +#define NI_NOFQDN 0x00000001 +#define NI_NUMERICHOST 0x00000002 +#define NI_NAMEREQD 0x00000004 +#define NI_NUMERICSERV 0x00000008 +#define NI_DGRAM 0x00000010 + +struct addrinfo { + int ai_flags; /* AI_PASSIVE, AI_CANONNAME */ + int ai_family; /* PF_xxx */ + int ai_socktype; /* SOCK_xxx */ + int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */ + size_t ai_addrlen; /* length of ai_addr */ + char *ai_canonname; /* canonical name for hostname */ + struct sockaddr *ai_addr; /* binary address */ + struct addrinfo *ai_next; /* next structure in linked list */ +}; + +struct sockaddr_storage { +#ifdef HAVE_SOCKADDR_SA_LEN + u_int8_t ss_len; /* address length */ + u_int8_t ss_family; /* address family */ +#else + u_int16_t ss_family; +#endif + u_int8_t fill[126]; +}; + +extern void freehostent __P((struct hostent *)); +extern char *gai_strerror __P((int)); +#endif Index: ncftp3/libncftp/ftp.c diff -u ncftp3/libncftp/ftp.c:1.1.1.20 ncftp3/libncftp/ftp.c:1.57 --- ncftp3/libncftp/ftp.c:1.1.1.20 Thu Nov 5 16:20:41 2009 +++ ncftp3/libncftp/ftp.c Mon Nov 9 21:51:14 2009 @@ -50,6 +50,18 @@ # define DisposeSocket(a) close(a) #endif +#ifndef HAVE_SOCKADDR_SA_LEN +#ifndef SA_LEN +#ifdef ENABLE_IPV6 +#define SA_LEN(x) (((x)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \ + : (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) \ + : -1)) +#else /* ENABLE_IPV6 */ +#define SA_LEN(x) (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) : -1) +#endif /* ENABLE_IPV6 */ +#endif /* SA_LEN */ +#endif /* HAVE_SOCKADDR_SA_LEN */ + static const char *gPrivateNetworks[] = { "192.168.", "10.", @@ -101,9 +113,9 @@ static int -GetSocketAddress(const FTPCIPtr cip, int sockfd, struct sockaddr_in *saddr) +GetSocketAddress(const FTPCIPtr cip, int sockfd, struct sockaddr *saddr) { - sockaddr_size_t len = (sockaddr_size_t) sizeof (struct sockaddr_in); + sockaddr_size_t len = (sockaddr_size_t) sizeof (struct sockaddr_storage); int result = 0; if (getsockname(sockfd, (struct sockaddr *)saddr, &len) < 0) { @@ -138,16 +150,16 @@ OpenControlConnection(const FTPCIPtr cip, char *host, unsigned int port) { struct sockaddr_in localAddr; - struct in_addr ip_address; int err = 0; int result; int oerrno; volatile int sockfd = -1; volatile int sock2fd = -1; ResponsePtr rp = NULL; - char **volatile curaddr; - int hpok; - struct hostent hp; + struct addrinfo hints; + struct addrinfo *res, *res0; + int error; + char buf[NI_MAXHOST]; char *volatile fhost; unsigned int fport; #ifndef NO_SIGNALS @@ -181,27 +193,17 @@ cip->cin = NULL; cip->cout = NULL; - /* Make sure we use network byte-order. */ - fport = (unsigned int) htons((unsigned short) fport); - - cip->servCtlAddr.sin_port = (unsigned short) fport; - - if (GetHostEntry(&hp, fhost, &ip_address, cip->buf, cip->bufSize) != 0) { - hpok = 0; - /* Okay, no Host entry, but maybe we have a numeric address - * in ip_address we can try. - */ - if (ip_address.s_addr == INADDR_NONE) { - FTPLogError(cip, kDontPerror, "%s: unknown host.\n", fhost); - cip->errNo = kErrHostUnknown; - return (kErrHostUnknown); - } - cip->servCtlAddr.sin_family = AF_INET; - cip->servCtlAddr.sin_addr.s_addr = ip_address.s_addr; - } else { - hpok = 1; - cip->servCtlAddr.sin_family = hp.h_addrtype; - /* We'll fill in the rest of the structure below. */ + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + sprintf(buf, "%d\0", fport); + error = getaddrinfo(fhost, buf, &hints, &res0); + if (error) { + FTPLogError(cip, kDontPerror, "%s: %s.\n", fhost, gai_strerror(error)); + cip->errNo = kErrHostUnknown; + return (kErrHostUnknown); } /* After obtaining a socket, try to connect it to a remote @@ -210,23 +212,24 @@ * every address in the list from the host entry. */ - if (hpok == 0) { - /* Since we're given a single raw address, and not a host entry, - * we can only try this one address and not any other addresses - * that could be present for a site with a host entry. - */ - - if ((sockfd = socket(cip->servCtlAddr.sin_family, SOCK_STREAM, 0)) < 0) { + /* We can try each address in the list. We'll quit when we + * run out of addresses to try or get a successful connection. + */ + for (res = res0; res; res = res->ai_next) { + (void) memcpy(&cip->servCtlAddr, res->ai_addr, (size_t)res->ai_addrlen); + if ((sockfd = socket(cip->servCtlAddr.ss_family, SOCK_STREAM, 0)) < 0) { + if (res0->ai_next) + continue; FTPLogError(cip, kDoPerror, "Could not get a socket.\n"); cip->errNo = kErrNewStreamSocket; return (kErrNewStreamSocket); } /* On rare occasions, the user may specify a local IP address to use. */ - if (cip->preferredLocalAddr.sin_family != 0) { + if (cip->preferredLocalAddr.sin_family == AF_INET) { localAddr = cip->preferredLocalAddr; localAddr.sin_port = 0; - if (BindToEphemeralPortNumber(sockfd, &localAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0) { + if (BindToEphemeralPortNumber(sockfd, (struct sockaddr *)&localAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0) { FTPLogError(cip, kDoPerror, "Could not bind the control socket"); result = kErrBindCtrlSocket; cip->errNo = kErrBindCtrlSocket; @@ -243,14 +246,14 @@ (void) SetSocketBufSize(sockfd, cip->ctrlSocketRBufSize, cip->ctrlSocketSBufSize); #ifdef NO_SIGNALS - err = SConnect(sockfd, &cip->servCtlAddr, (int) cip->connTimeout); + err = SConnect(sockfd, (struct sockaddr *)&cip->servCtlAddr, (int) cip->connTimeout); - if (err < 0) { - oerrno = errno; - (void) SClose(sockfd, 3); - errno = oerrno; - sockfd = -1; - } + if (err == 0) + break; + oerrno = errno; + (void) SClose(sockfd, 3); + errno = oerrno; + sockfd = -1; #else /* NO_SIGNALS */ osigint = (volatile FTPSigProc) signal(SIGINT, CancelConnect); if (cip->connTimeout > 0) { @@ -279,6 +282,8 @@ Error(vcip, kDontPerror, "Connection attempt canceled.\n"); (void) kill(getpid(), SIGINT); } else if (gGotSig == SIGALRM) { + if (res0->ai_next) + continue; result = vcip->errNo = kErrConnectRetryableErr; Error(vcip, kDontPerror, "Connection attempt timed-out.\n"); (void) kill(getpid(), SIGALRM); @@ -289,7 +294,12 @@ return (result); } else { err = connect(sockfd, (struct sockaddr *) &cip->servCtlAddr, - (int) sizeof (cip->servCtlAddr)); +#ifdef HAVE_SOCKADDR_SA_LEN + cip->servCtlAddr.ss_len +#else + SA_LEN((struct sockaddr *)&cip->servCtlAddr) +#endif + ); if (cip->connTimeout > 0) { (void) alarm(0); (void) signal(SIGALRM, (FTPSigProc) osigalrm); @@ -303,106 +313,7 @@ errno = oerrno; sockfd = -1; } -#endif /* NO_SIGNALS */ - } else { - /* We can try each address in the list. We'll quit when we - * run out of addresses to try or get a successful connection. - */ - for (curaddr = hp.h_addr_list; *curaddr != NULL; curaddr++) { - if ((sockfd = socket(cip->servCtlAddr.sin_family, SOCK_STREAM, 0)) < 0) { - FTPLogError(cip, kDoPerror, "Could not get a socket.\n"); - cip->errNo = kErrNewStreamSocket; - return (kErrNewStreamSocket); - } - /* This could overwrite the address field in the structure, - * but this is okay because the structure has a junk field - * just for this purpose. - */ - (void) memcpy(&cip->servCtlAddr.sin_addr, *curaddr, (size_t) hp.h_length); - - /* On rare occasions, the user may specify a local IP address to use. */ - if (cip->preferredLocalAddr.sin_family != 0) { - localAddr = cip->preferredLocalAddr; - localAddr.sin_port = 0; - if (BindToEphemeralPortNumber(sockfd, &localAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0) { - FTPLogError(cip, kDoPerror, "Could not bind the control socket"); - result = kErrBindCtrlSocket; - cip->errNo = kErrBindCtrlSocket; - (void) SClose(sockfd, 3); - return (kErrBindCtrlSocket); - } - } - - /* This doesn't do anything if you left these - * at their defaults (zero). Otherwise it - * tries to set the buffer size to the - * size specified. - */ - (void) SetSocketBufSize(sockfd, cip->ctrlSocketRBufSize, cip->ctrlSocketSBufSize); - -#ifdef NO_SIGNALS - err = SConnect(sockfd, &cip->servCtlAddr, (int) cip->connTimeout); - - if (err == 0) - break; - oerrno = errno; - (void) SClose(sockfd, 3); - errno = oerrno; - sockfd = -1; -#else /* NO_SIGNALS */ - - osigint = (volatile FTPSigProc) signal(SIGINT, CancelConnect); - if (cip->connTimeout > 0) { - osigalrm = (volatile FTPSigProc) signal(SIGALRM, CancelConnect); - (void) alarm(cip->connTimeout); - } - - vcip = cip; -#ifdef HAVE_SIGSETJMP - sj = sigsetjmp(gCancelConnectJmp, 1); -#else - sj = setjmp(gCancelConnectJmp); -#endif /* HAVE_SIGSETJMP */ - - if (sj != 0) { - /* Interrupted by a signal. */ - (void) DisposeSocket(sockfd); - (void) signal(SIGINT, (FTPSigProc) osigint); - if (vcip->connTimeout > 0) { - (void) alarm(0); - (void) signal(SIGALRM, (FTPSigProc) osigalrm); - } - if (gGotSig == SIGINT) { - result = vcip->errNo = kErrConnectMiscErr; - Error(vcip, kDontPerror, "Connection attempt canceled.\n"); - (void) kill(getpid(), SIGINT); - } else if (gGotSig == SIGALRM) { - result = vcip->errNo = kErrConnectRetryableErr; - Error(vcip, kDontPerror, "Connection attempt timed-out.\n"); - (void) kill(getpid(), SIGALRM); - } else { - result = vcip->errNo = kErrConnectMiscErr; - Error(vcip, kDontPerror, "Connection attempt failed due to an unexpected signal (%d).\n", gGotSig); - } - return (result); - } else { - err = connect(sockfd, (struct sockaddr *) &cip->servCtlAddr, - (int) sizeof (cip->servCtlAddr)); - if (cip->connTimeout > 0) { - (void) alarm(0); - (void) signal(SIGALRM, (FTPSigProc) osigalrm); - } - (void) signal(SIGINT, (FTPSigProc) osigint); - } - - if (err == 0) - break; - oerrno = errno; - (void) DisposeSocket(sockfd); - errno = oerrno; - sockfd = -1; #endif /* NO_SIGNALS */ - } } if (err < 0) { @@ -461,7 +372,7 @@ } /* Get our end of the socket address for later use. */ - if ((result = GetSocketAddress(cip, sockfd, &cip->ourCtlAddr)) < 0) + if ((result = GetSocketAddress(cip, sockfd, (struct sockaddr *)&cip->ourCtlAddr)) < 0) goto fatal; /* We want Out-of-band data to appear in the regular stream, @@ -532,11 +443,20 @@ #endif #endif /* NO_SIGNALS */ - InetNtoA(cip->ip, &cip->servCtlAddr.sin_addr, sizeof(cip->ip)); - if ((hpok == 0) || (hp.h_name == NULL)) + getnameinfo((struct sockaddr*)&cip->servCtlAddr, +#ifdef HAVE_SOCKADDR_SA_LEN + cip->servCtlAddr.ss_len, +#else + SA_LEN((struct sockaddr *)&cip->servCtlAddr), +#endif + buf, sizeof(buf), NULL, 0, NI_NUMERICHOST); + (void) STRNCPY(cip->ip, buf); + if ((res0 == NULL) || (res0->ai_canonname == NULL)) (void) STRNCPY(cip->actualHost, fhost); else - (void) STRNCPY(cip->actualHost, (char *) hp.h_name); + (void) STRNCPY(cip->actualHost, (char *) res0->ai_canonname); + freeaddrinfo(res0); + res0 = NULL; /* Read the startup message from the server. */ rp = InitResponse(); @@ -640,6 +560,10 @@ CloseFile(&cip->cout); cip->ctrlSocketR = kClosedFileDescriptor; cip->ctrlSocketW = kClosedFileDescriptor; + if (res0) { + freeaddrinfo(res0); + res0 = NULL; + } return (result); } /* OpenControlConnection */ @@ -733,11 +657,15 @@ int -FTPSendPort(const FTPCIPtr cip, struct sockaddr_in *saddr) +FTPSendPort(const FTPCIPtr cip, struct sockaddr *saddr) { char *a, *p; int result; ResponsePtr rp; + struct sockaddr_in *saddr4; +#ifdef ENABLE_IPV6 + struct sockaddr_in6 *saddr6; +#endif rp = InitResponse(); if (rp == NULL) { @@ -746,16 +674,46 @@ return (cip->errNo); } - /* These will point to data in network byte order. */ - a = (char *) &saddr->sin_addr; - p = (char *) &saddr->sin_port; #define UC(x) (int) (((int) x) & 0xff) +#ifdef ENABLE_IPV6 + if (saddr->sa_family == AF_INET6) { + char host[NI_MAXHOST]; + char port[NI_MAXSERV]; + + getnameinfo(saddr, sizeof(struct sockaddr_in6), host, sizeof(host), + port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV); + + saddr6 = (struct sockaddr_in6 *)saddr; + /* These will point to data in network byte order. */ + a = (char *) &saddr6->sin6_addr; + p = (char *) &saddr6->sin6_port; + /* Need to tell the other side which host (the address) and + * which process (port) on that host to send data to. + */ + result = RCmd(cip, rp, "EPRT |2|%s|%s|", host, port); + if (result != 2) { + result = RCmd(cip, rp, "LPRT 6,16,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,2,%d,%d", + UC(a[ 0]), UC(a[ 1]), UC(a[ 2]), UC(a[ 3]), + UC(a[ 4]), UC(a[ 5]), UC(a[ 6]), UC(a[ 7]), + UC(a[ 8]), UC(a[ 9]), UC(a[10]), UC(a[11]), + UC(a[12]), UC(a[13]), UC(a[14]), UC(a[15]), + UC(p[0]), UC(p[1])); + } + } else { +#endif + saddr4 = (struct sockaddr_in *)saddr; + /* These will point to data in network byte order. */ + a = (char *) &saddr4->sin_addr; + p = (char *) &saddr4->sin_port; - /* Need to tell the other side which host (the address) and - * which process (port) on that host to send data to. - */ - result = RCmd(cip, rp, "PORT %d,%d,%d,%d,%d,%d", - UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]), UC(p[0]), UC(p[1])); + /* Need to tell the other side which host (the address) and + * which process (port) on that host to send data to. + */ + result = RCmd(cip, rp, "PORT %d,%d,%d,%d,%d,%d", + UC(a[0]), UC(a[1]), UC(a[2]), UC(a[3]), UC(p[0]), UC(p[1])); +#ifdef ENABLE_IPV6 + } +#endif DoneWithResponse(cip, rp); if (result < 0) { @@ -772,13 +730,18 @@ int -FTPSendPassive(const FTPCIPtr cip, struct sockaddr_in *saddr, int *weird) +FTPSendPassive(const FTPCIPtr cip, struct sockaddr *saddr, int *weird) { ResponsePtr rp; - int i[6], j; - unsigned char n[6]; + int i[18], j; + unsigned char n[18]; char *cp; int result; + struct sockaddr_in *saddr4 = (struct sockaddr_in *)saddr; +#ifdef ENABLE_IPV6 + struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *)saddr; +#endif + unsigned short port; rp = InitResponse(); if (rp == NULL) { @@ -787,56 +750,162 @@ return (cip->errNo); } - result = RCmd(cip, rp, "PASV"); - if (result < 0) - goto done; - - if (rp->codeType != 2) { - /* Didn't understand or didn't want passive port selection. */ - cip->errNo = result = kErrPASVFailed; - goto done; - } - - /* The other side returns a specification in the form of - * an internet address as the first four integers (each - * integer stands for 8-bits of the real 32-bit address), - * and two more integers for the port (16-bit port). - * - * It should give us something like: - * "Entering Passive Mode (129,93,33,1,10,187)", so look for - * digits with sscanf() starting 24 characters down the string. - */ + result = RCmd(cip, rp, "EPSV"); + if (result != 2) + goto next; + + if (rp->codeType != 2) + goto next; + for (cp = rp->msg.first->line; ; cp++) { if (*cp == '\0') { - FTPLogError(cip, kDontPerror, "Cannot parse PASV response: %s\n", rp->msg.first->line); - goto done; + FTPLogError(cip, kDontPerror, "Cannot parse EPSV response: %s\n", rp->msg.first->line); + goto next; } if (isdigit((int) *cp)) break; } + if (sscanf(cp, "%hd|", &port) != 1) { + FTPLogError(cip, kDontPerror, "Cannot parse EPSV response: %s\n", rp->msg.first->line); + goto next; + } - if (sscanf(cp, "%d,%d,%d,%d,%d,%d", - &i[0], &i[1], &i[2], &i[3], &i[4], &i[5]) != 6) { - FTPLogError(cip, kDontPerror, "Cannot parse PASV response: %s\n", rp->msg.first->line); - goto done; + +#ifdef ENABLE_IPV6 + if (saddr->sa_family == AF_INET6) { + saddr6->sin6_addr = + ((struct sockaddr_in6 *)&cip->servCtlAddr)->sin6_addr; + saddr6->sin6_port = htons(port); + } else { +#endif + saddr4->sin_addr = + ((struct sockaddr_in *)&cip->servCtlAddr)->sin_addr; + saddr4->sin_port = htons(port); +#ifdef ENABLE_IPV6 } +#endif + goto done; - if (weird != (int *) 0) - *weird = 0; - - for (j=0; j<6; j++) { - /* Some ftp servers return bogus port octets, such as - * boombox.micro.umn.edu. Let the caller know if we got a - * weird looking octet. - */ - if (((i[j] < 0) || (i[j] > 255)) && (weird != (int *) 0)) - *weird = *weird + 1; - n[j] = (unsigned char) (i[j] & 0xff); + next: + rp = InitResponse(); + if (rp == NULL) { + FTPLogError(cip, kDontPerror, "Malloc failed.\n"); + cip->errNo = kErrMallocFailed; + return (cip->errNo); } - (void) memcpy(&saddr->sin_addr, &n[0], (size_t) 4); - (void) memcpy(&saddr->sin_port, &n[4], (size_t) 2); +#ifdef ENABLE_IPV6 + if (saddr->sa_family == AF_INET6) { + int af, hal, pal; + + result = RCmd(cip, rp, "LPSV"); + if (result < 0) + goto done; + + if (rp->codeType != 2) { + /* Didn't understand or didn't want passive port selection. */ + cip->errNo = result = kErrPASVFailed; + goto done; + } + + /* The other side returns a specification in the form of + * an internet address as the first four integers (each + * integer stands for 8-bits of the real 32-bit address), + * and two more integers for the port (16-bit port). + * + * It should give us something like: + * "Entering Passive Mode (129,93,33,1,10,187)", so look for + * digits with sscanf() starting 24 characters down the string. + */ + for (cp = rp->msg.first->line; ; cp++) { + if (*cp == '\0') { + FTPLogError(cip, kDontPerror, "Cannot parse LPSV response: %s\n", rp->msg.first->line); + goto done; + } + if (isdigit((int) *cp)) + break; + } + + if (sscanf(cp, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", + &af, &hal, + &i[ 0], &i[ 1], &i[ 2], &i[ 3], + &i[ 4], &i[ 5], &i[ 6], &i[ 7], + &i[ 8], &i[ 9], &i[10], &i[11], + &i[12], &i[13], &i[14], &i[15], + &pal, + &i[16], &i[17]) != 21) { + FTPLogError(cip, kDontPerror, "Cannot parse LPSV response: %s\n", rp->msg.first->line); + goto done; + } + if (af != 6 || hal != 16 || pal != 2) { + FTPLogError(cip, kDontPerror, "Cannot parse LPSV response: %s\n", rp->msg.first->line); + goto done; + } + + for (j=0, *weird = 0; j<18; j++) { + /* Some ftp servers return bogus port octets, such as + * boombox.micro.umn.edu. Let the caller know if we got a + * weird looking octet. + */ + if ((i[j] < 0) || (i[j] > 255)) + *weird = *weird + 1; + n[j] = (unsigned char) (i[j] & 0xff); + } + (void) memcpy(&saddr6->sin6_addr, &n[ 0], (size_t) 16); + (void) memcpy(&saddr6->sin6_port, &n[16], (size_t) 2); + } else { +#endif + result = RCmd(cip, rp, "PASV"); + if (result < 0) + goto done; + + if (rp->codeType != 2) { + /* Didn't understand or didn't want passive port selection. */ + cip->errNo = result = kErrPASVFailed; + goto done; + } + + /* The other side returns a specification in the form of + * an internet address as the first four integers (each + * integer stands for 8-bits of the real 32-bit address), + * and two more integers for the port (16-bit port). + * + * It should give us something like: + * "Entering Passive Mode (129,93,33,1,10,187)", so look for + * digits with sscanf() starting 24 characters down the string. + */ + for (cp = rp->msg.first->line; ; cp++) { + if (*cp == '\0') { + FTPLogError(cip, kDontPerror, "Cannot parse PASV response: %s\n", rp->msg.first->line); + goto done; + } + if (isdigit((int) *cp)) + break; + } + + if (sscanf(cp, "%d,%d,%d,%d,%d,%d", + &i[0], &i[1], &i[2], &i[3], &i[4], &i[5]) != 6) { + FTPLogError(cip, kDontPerror, "Cannot parse PASV response: %s\n", rp->msg.first->line); + goto done; + } + if (weird != (int *) 0) + *weird = 0; + + for (j=0; j<6; j++) { + /* Some ftp servers return bogus port octets, such as + * boombox.micro.umn.edu. Let the caller know if we got a + * weird looking octet. + */ + if (((i[j] < 0) || (i[j] > 255)) && (weird != (int *) 0)) + *weird = *weird + 1; + n[j] = (unsigned char) (i[j] & 0xff); + } + (void) memcpy(&saddr4->sin_addr, &n[0], (size_t) 4); + (void) memcpy(&saddr4->sin_port, &n[4], (size_t) 2); +#ifdef ENABLE_IPV6 + } +#endif result = kNoErr; done: DoneWithResponse(cip, rp); @@ -853,8 +922,8 @@ char maybePrivateAddrStr[64]; char knownNonPrivateAddrToUseIfNeededStr[64]; - AddrToAddrStr(maybePrivateAddrStr, sizeof(maybePrivateAddrStr), maybePrivateAddr, 0, "%h"); - AddrToAddrStr(knownNonPrivateAddrToUseIfNeededStr, sizeof(knownNonPrivateAddrToUseIfNeededStr), knownNonPrivateAddrToUseIfNeeded, 0, "%h"); + AddrToAddrStr(maybePrivateAddrStr, sizeof(maybePrivateAddrStr), (struct sockaddr *)maybePrivateAddr, 0, "%h"); + AddrToAddrStr(knownNonPrivateAddrToUseIfNeededStr, sizeof(knownNonPrivateAddrToUseIfNeededStr), (struct sockaddr *)knownNonPrivateAddrToUseIfNeeded, 0, "%h"); if (strcmp(maybePrivateAddrStr, knownNonPrivateAddrToUseIfNeededStr) == 0) return (0); /* Assume if we could reach the Ctl, we can reach Data. */ @@ -884,10 +953,10 @@ char servDataAddrStr[64]; char newDataAddrStr[64]; - memcpy(&oldServDataAddr, &cip->servDataAddr, sizeof(oldServDataAddr)); - if (FTPFixPrivateAddr(&cip->servDataAddr, &cip->servCtlAddr)) { - AddrToAddrStr(servDataAddrStr, sizeof(servDataAddrStr), &oldServDataAddr, 0, NULL); - AddrToAddrStr(newDataAddrStr, sizeof(newDataAddrStr), &cip->servDataAddr, 0, NULL); + memcpy(&oldServDataAddr, (struct sockaddr_in *)&cip->servDataAddr, sizeof(oldServDataAddr)); + if (FTPFixPrivateAddr((struct sockaddr_in *)&cip->servDataAddr, (struct sockaddr_in *)&cip->servCtlAddr)) { + AddrToAddrStr(servDataAddrStr, sizeof(servDataAddrStr), (struct sockaddr *)&oldServDataAddr, 0, NULL); + AddrToAddrStr(newDataAddrStr, sizeof(newDataAddrStr), (struct sockaddr *)&cip->servDataAddr, 0, NULL); PrintF(cip, "Fixing bogus PASV data address from %s to %s.\n", servDataAddrStr, newDataAddrStr); } } /* FTPFixServerDataAddr */ @@ -906,11 +975,11 @@ return; memcpy(&oldClientDataAddr, &cip->ourDataAddr, sizeof(oldClientDataAddr)); - if (FTPFixPrivateAddr(&cip->ourDataAddr, &cip->clientKnownExternalAddr)) { + if (FTPFixPrivateAddr((struct sockaddr_in *)&cip->ourDataAddr, (struct sockaddr_in *)&cip->clientKnownExternalAddr)) { memcpy(&newClientDataAddr, &cip->clientKnownExternalAddr, sizeof(newClientDataAddr)); - newClientDataAddr.sin_port = cip->ourDataAddr.sin_port; - AddrToAddrStr(ourDataAddrStr, sizeof(ourDataAddrStr), &oldClientDataAddr, 0, NULL); - AddrToAddrStr(newDataAddrStr, sizeof(newDataAddrStr), &newClientDataAddr, 0, NULL); + newClientDataAddr.sin_port = ((struct sockaddr_in *)&cip->ourDataAddr)->sin_port; + AddrToAddrStr(ourDataAddrStr, sizeof(ourDataAddrStr), (struct sockaddr *)&oldClientDataAddr, 0, NULL); + AddrToAddrStr(newDataAddrStr, sizeof(newDataAddrStr), (struct sockaddr *)&newClientDataAddr, 0, NULL); PrintF(cip, "Fixing what would have been a bogus PORT data address from %s to %s.\n", ourDataAddrStr, newDataAddrStr); } } /* FTPFixClientDataAddr */ @@ -919,30 +988,45 @@ int -BindToEphemeralPortNumber(const int sockfd, struct sockaddr_in *const addrp, const int ephemLo, const int ephemHi) +BindToEphemeralPortNumber(const int sockfd, struct sockaddr *const addrp, const int ephemLo, const int ephemHi) { int i; int result; int rangesize; unsigned short port; - addrp->sin_family = AF_INET; if (((int) ephemLo == 0) || ((int) ephemLo >= (int) ephemHi)) { /* Do it the normal way. System will * pick one, typically in the range * of 1024-4999. */ - addrp->sin_port = 0; /* Let system pick one. */ - - result = bind(sockfd, (struct sockaddr *) addrp, sizeof(struct sockaddr_in)); +#ifdef ENABLE_IPV6 + if (addrp->sa_family == AF_INET6) + ((struct sockaddr_in6 *)addrp)->sin6_port = 0; /* Let system pick one. */ + else +#endif + ((struct sockaddr_in *)addrp)->sin_port = 0; /* Let system pick one. */ +#ifdef HAVE_SOCKADDR_SA_LEN + result = bind(sockfd, addrp, addrp->sa_len); +#else + result = bind(sockfd, addrp, SA_LEN(addrp)); +#endif } else { rangesize = (int) ((int) ephemHi - (int) ephemLo); result = 0; for (i=0; i<10; i++) { port = (unsigned short) (((int) rand() % rangesize) + (int) ephemLo); - addrp->sin_port = htons(port); - - result = bind(sockfd, (struct sockaddr *) addrp, sizeof(struct sockaddr_in)); +#ifdef ENABLE_IPV6 + if (addrp->sa_family == AF_INET6) + ((struct sockaddr_in6 *)addrp)->sin6_port = htons(port); + else +#endif + ((struct sockaddr_in *)addrp)->sin_port = htons(port); +#ifdef HAVE_SOCKADDR_SA_LEN + result = bind(sockfd, addrp, addrp->sa_len); +#else + result = bind(sockfd, addrp, SA_LEN(addrp)); +#endif if (result == 0) break; sleep(1); @@ -981,7 +1065,11 @@ result = 0; CloseDataConnection(cip); /* In case we didn't before... */ +#ifdef ENABLE_IPV6 + dataSocket = socket(cip->ourCtlAddr.ss_family, SOCK_STREAM, 0); +#else dataSocket = socket(AF_INET, SOCK_STREAM, 0); +#endif if (dataSocket < 0) { FTPLogError(cip, kDoPerror, "Could not get a data socket.\n"); result = kErrNewStreamSocket; @@ -1015,7 +1103,6 @@ * which may have been set to something explicitly. */ cip->ourDataAddr = cip->ourCtlAddr; - cip->ourDataAddr.sin_family = AF_INET; #ifdef HAVE_LIBSOCKS cip->ourDataAddr.sin_port = 0; @@ -1023,7 +1110,7 @@ (int) sizeof (cip->ourDataAddr), cip->servCtlAddr.sin_addr.s_addr) < 0) #else - if (BindToEphemeralPortNumber(dataSocket, &cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0) + if (BindToEphemeralPortNumber(dataSocket, (struct sockaddr *)&cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0) #endif { FTPLogError(cip, kDoPerror, "Could not bind the data socket"); @@ -1035,7 +1122,7 @@ /* Need to do this so we can figure out which port the system * gave to us. */ - if ((result = GetSocketAddress(cip, dataSocket, &cip->ourDataAddr)) < 0) + if ((result = GetSocketAddress(cip, dataSocket, (struct sockaddr *)&cip->ourDataAddr)) < 0) goto bad; if (listen(dataSocket, 1) < 0) { @@ -1045,8 +1132,9 @@ goto bad; } - FTPFixClientDataAddr(cip); - if ((result = FTPSendPort(cip, &cip->ourDataAddr)) < 0) + if (cip->ourDataAddr.ss_family == AF_INET) + FTPFixClientDataAddr(cip); + if ((result = FTPSendPort(cip, (struct sockaddr *)&cip->ourDataAddr)) < 0) goto bad; cip->dataPortMode = kSendPortMode; @@ -1055,11 +1143,9 @@ while (--passiveAttemptsRemaining >= 0) { cip->servDataAddr = cip->servCtlAddr; - cip->servDataAddr.sin_family = AF_INET; cip->ourDataAddr = cip->ourCtlAddr; - cip->ourDataAddr.sin_family = AF_INET; - if (FTPSendPassive(cip, &cip->servDataAddr, &weirdPort) < 0) { + if (FTPSendPassive(cip, (struct sockaddr *)&cip->servDataAddr, &weirdPort) < 0) { FTPLogError(cip, kDontPerror, "Passive mode refused.\n"); cip->hasPASV = kCommandNotAvailable; @@ -1076,7 +1162,8 @@ cip->errNo = kErrPassiveModeFailed; goto bad; } - FTPFixServerDataAddr(cip); + if (cip->servDataAddr.ss_family == AF_INET) + FTPFixServerDataAddr(cip); #ifdef HAVE_LIBSOCKS cip->ourDataAddr.sin_port = 0; @@ -1084,7 +1171,7 @@ (int) sizeof (cip->ourDataAddr), cip->servCtlAddr.sin_addr.s_addr) < 0) #else - if (BindToEphemeralPortNumber(dataSocket, &cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0) + if (BindToEphemeralPortNumber(dataSocket, (struct sockaddr *)&cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0) #endif { FTPLogError(cip, kDoPerror, "Could not bind the data socket"); @@ -1092,8 +1179,13 @@ cip->errNo = kErrBindDataSocket; goto bad; } - - result = SConnect(dataSocket, &cip->servDataAddr, (int) cip->connTimeout); + + /* Need to do this so we can figure out which port the system + * gave to us. + */ + if ((result = GetSocketAddress(cip, dataSocket, (struct sockaddr *)&cip->ourDataAddr)) < 0) + goto bad; + result = SConnect(dataSocket, (struct sockaddr *)&cip->servDataAddr, (int) cip->connTimeout); if (result == kTimeoutErr) { if (mode == kFallBackToSendPortMode) { @@ -1156,7 +1248,7 @@ if (dataSocket != kClosedFileDescriptor) (void) DisposeSocket(dataSocket); - dataSocket = socket(AF_INET, SOCK_STREAM, 0); + dataSocket = socket(cip->ourCtlAddr.ss_family, SOCK_STREAM, 0); if (dataSocket < 0) { FTPLogError(cip, kDoPerror, "Could not get a data socket.\n"); result = kErrNewStreamSocket; @@ -1172,7 +1264,7 @@ /* Need to do this so we can figure out which port the system * gave to us. */ - if ((result = GetSocketAddress(cip, dataSocket, &cip->ourDataAddr)) < 0) + if ((result = GetSocketAddress(cip, dataSocket, (struct sockaddr *) &cip->ourDataAddr)) < 0) goto bad; cip->hasPASV = kCommandAvailable; @@ -1217,9 +1309,9 @@ memset(&cip->servDataAddr, 0, sizeof(cip->servDataAddr)); #ifdef NO_SIGNALS - newSocket = SAccept(cip->dataSocket, &cip->servDataAddr, (int) cip->connTimeout); + newSocket = SAccept(cip->dataSocket, (struct sockaddr *)&cip->servDataAddr, (int) cip->connTimeout); #else /* NO_SIGNALS */ - len = (int) sizeof(cip->servDataAddr); + len = (int) sizeof(struct sockaddr_storage); if (cip->connTimeout > 0) (void) alarm(cip->connTimeout); newSocket = accept(cip->dataSocket, (struct sockaddr *) &cip->servDataAddr, &len); @@ -1234,11 +1326,10 @@ cip->errNo = kErrAcceptDataSocket; return (kErrAcceptDataSocket); } - if (cip->allowProxyForPORT == 0) { - if (memcmp(&cip->servDataAddr.sin_addr.s_addr, &cip->servCtlAddr.sin_addr.s_addr, sizeof(cip->servDataAddr.sin_addr.s_addr)) != 0) { - AddrToAddrStr(ctrlAddrStr, sizeof(ctrlAddrStr), &cip->servCtlAddr, 0, NULL); - AddrToAddrStr(dataAddrStr, sizeof(dataAddrStr), &cip->servDataAddr, 0, NULL); + AddrToAddrStr(ctrlAddrStr, sizeof(ctrlAddrStr), (struct sockaddr *)&cip->servCtlAddr, 0, "%h"); + AddrToAddrStr(dataAddrStr, sizeof(dataAddrStr), (struct sockaddr *)&cip->servDataAddr, 0, "%h"); + if (strcmp(ctrlAddrStr, dataAddrStr) != 0) { FTPLogError(cip, kDontPerror, "Data connection from %s did not originate from remote server %s!\n", dataAddrStr, ctrlAddrStr); (void) DisposeSocket(newSocket); cip->dataSocket = kClosedFileDescriptor; @@ -1246,21 +1337,57 @@ return (kErrProxyDataConnectionsDisabled); } } - if (cip->require20 != 0) { - remoteDataPort = ntohs(cip->servDataAddr.sin_port); - remoteCtrlPort = ntohs(cip->servCtlAddr.sin_port); - if ((int) remoteDataPort != ((int) remoteCtrlPort - 1)) { - FTPLogError(cip, kDontPerror, "Data connection did not originate on correct port (expecting %d, got %d)!\n", (int) remoteCtrlPort - 1, (int) remoteDataPort); - (void) DisposeSocket(newSocket); - cip->dataSocket = kClosedFileDescriptor; - cip->errNo = kErrDataConnOriginatedFromBadPort; - return (kErrDataConnOriginatedFromBadPort); +#ifdef ENABLE_IPV6 + if (cip->servDataAddr.ss_family == AF_INET6) { + struct sockaddr_in6 *servDataAddr = + (struct sockaddr_in6 *) &cip->servDataAddr; + struct sockaddr_in6 *servCtlAddr = + (struct sockaddr_in6 *) &cip->servCtlAddr; + + remoteDataPort = ntohs(servDataAddr->sin6_port); + remoteCtrlPort = ntohs(servCtlAddr->sin6_port); + if ((int) remoteDataPort != ((int) remoteCtrlPort - 1)) { + FTPLogError(cip, kDontPerror, "Data connection did not originate on correct port!\n"); + (void) DisposeSocket(newSocket); + cip->dataSocket = kClosedFileDescriptor; + cip->errNo = kErrAcceptDataSocket; + return (kErrAcceptDataSocket); + } else if (memcmp(&servDataAddr->sin6_addr, &servCtlAddr->sin6_addr, sizeof(servDataAddr->sin6_addr)) != 0) { + FTPLogError(cip, kDontPerror, "Data connection did not originate from remote server!\n"); + (void) DisposeSocket(newSocket); + cip->dataSocket = kClosedFileDescriptor; + cip->errNo = kErrAcceptDataSocket; + return (kErrAcceptDataSocket); + } + } else { +#endif + struct sockaddr_in *servDataAddr = + (struct sockaddr_in *) &cip->servDataAddr; + struct sockaddr_in *servCtlAddr = + (struct sockaddr_in *) &cip->servCtlAddr; + + remoteDataPort = ntohs(servDataAddr->sin_port); + remoteCtrlPort = ntohs(servCtlAddr->sin_port); + if ((int) remoteDataPort != ((int) remoteCtrlPort - 1)) { + FTPLogError(cip, kDontPerror, "Data connection did not originate on correct port!\n"); + (void) DisposeSocket(newSocket); + cip->dataSocket = kClosedFileDescriptor; + cip->errNo = kErrAcceptDataSocket; + return (kErrAcceptDataSocket); + } else if (memcmp(&servDataAddr->sin_addr.s_addr, &servCtlAddr->sin_addr.s_addr, sizeof(servDataAddr->sin_addr.s_addr)) != 0) { + FTPLogError(cip, kDontPerror, "Data connection did not originate on correct port (expecting %d, got %d)!\n", (int) remoteCtrlPort - 1, (int) remoteDataPort); + (void) DisposeSocket(newSocket); + cip->errNo = kErrDataConnOriginatedFromBadPort; + cip->errNo = kErrAcceptDataSocket; + return (kErrDataConnOriginatedFromBadPort); + } +#ifdef ENABLE_IPV6 } +#endif } cip->dataSocket = newSocket; } - return (0); } /* AcceptDataConnection */ Index: ncftp3/libncftp/getaddrinfo.c diff -u /dev/null ncftp3/libncftp/getaddrinfo.c:1.1 --- /dev/null Mon Nov 9 21:52:32 2009 +++ ncftp3/libncftp/getaddrinfo.c Tue Nov 6 23:50:46 2001 @@ -0,0 +1,607 @@ +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * "#ifdef FAITH" part is local hack for supporting IPv4-v6 translator. + * + * Issues to be discussed: + * - Thread safe-ness must be checked. + * - Return values. There are nonstandard return values defined and used + * in the source code. This is because RFC2133 is silent about which error + * code must be returned for which situation. + * - PF_UNSPEC case would be handled in getipnodebyname() with the AI_ALL flag. + */ + +#include <sys/types.h> +#include <sys/param.h> +#include <sys/sysctl.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <arpa/nameser.h> +#include <netdb.h> +#include <resolv.h> +#include <string.h> +#include <stdlib.h> +#include <stddef.h> +#include <ctype.h> +#include <unistd.h> + +#include "addrinfo.h" + +#if defined(__KAME__) && defined(INET6) +# define FAITH +#endif + +#define SUCCESS 0 +#define ANY 0 +#define YES 1 +#define NO 0 + +#ifdef FAITH +static int translate = NO; +static struct in6_addr faith_prefix = IN6ADDR_ANY_INIT; +#endif + +static const char in_addrany[] = { 0, 0, 0, 0 }; +static const char in6_addrany[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; +static const char in_loopback[] = { 127, 0, 0, 1 }; +static const char in6_loopback[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 +}; + +struct sockinet { + u_char si_len; + u_char si_family; + u_short si_port; +}; + +static struct afd { + int a_af; + int a_addrlen; + int a_socklen; + int a_off; + const char *a_addrany; + const char *a_loopback; +} afdl [] = { +#ifdef INET6 +#define N_INET6 0 + {PF_INET6, sizeof(struct in6_addr), + sizeof(struct sockaddr_in6), + offsetof(struct sockaddr_in6, sin6_addr), + in6_addrany, in6_loopback}, +#define N_INET 1 +#else +#define N_INET 0 +#endif + {PF_INET, sizeof(struct in_addr), + sizeof(struct sockaddr_in), + offsetof(struct sockaddr_in, sin_addr), + in_addrany, in_loopback}, + {0, 0, 0, 0, NULL, NULL}, +}; + +#ifdef INET6 +#define PTON_MAX 16 +#else +#define PTON_MAX 4 +#endif + + +static int get_name __P((const char *, struct afd *, + struct addrinfo **, char *, struct addrinfo *, + int)); +static int get_addr __P((const char *, int, struct addrinfo **, + struct addrinfo *, int)); +static int str_isnumber __P((const char *)); + +static char *ai_errlist[] = { + "success.", + "address family for hostname not supported.", /* EAI_ADDRFAMILY */ + "temporary failure in name resolution.", /* EAI_AGAIN */ + "invalid value for ai_flags.", /* EAI_BADFLAGS */ + "non-recoverable failure in name resolution.", /* EAI_FAIL */ + "ai_family not supported.", /* EAI_FAMILY */ + "memory allocation failure.", /* EAI_MEMORY */ + "no address associated with hostname.", /* EAI_NODATA */ + "hostname nor servname provided, or not known.",/* EAI_NONAME */ + "servname not supported for ai_socktype.", /* EAI_SERVICE */ + "ai_socktype not supported.", /* EAI_SOCKTYPE */ + "system error returned in errno.", /* EAI_SYSTEM */ + "invalid value for hints.", /* EAI_BADHINTS */ + "resolved protocol is unknown.", /* EAI_PROTOCOL */ + "unknown error.", /* EAI_MAX */ +}; + +#define GET_CANONNAME(ai, str) \ +if (pai->ai_flags & AI_CANONNAME) {\ + if (((ai)->ai_canonname = (char *)malloc(strlen(str) + 1)) != NULL) {\ + strcpy((ai)->ai_canonname, (str));\ + } else {\ + error = EAI_MEMORY;\ + goto free;\ + }\ +} + +#define GET_AI(ai, afd, addr, port) {\ + char *p;\ + if (((ai) = (struct addrinfo *)malloc(sizeof(struct addrinfo) +\ + ((afd)->a_socklen)))\ + == NULL) goto free;\ + memcpy(ai, pai, sizeof(struct addrinfo));\ + (ai)->ai_addr = (struct sockaddr *)((ai) + 1);\ + memset((ai)->ai_addr, 0, (afd)->a_socklen);\ + (ai)->ai_addr->sa_len = (ai)->ai_addrlen = (afd)->a_socklen;\ + (ai)->ai_addr->sa_family = (ai)->ai_family = (afd)->a_af;\ + ((struct sockinet *)(ai)->ai_addr)->si_port = port;\ + p = (char *)((ai)->ai_addr);\ + memcpy(p + (afd)->a_off, (addr), (afd)->a_addrlen);\ +} + +#define ERR(err) { error = (err); goto bad; } + +char * +gai_strerror(ecode) + int ecode; +{ + if (ecode < 0 || ecode > EAI_MAX) + ecode = EAI_MAX; + return ai_errlist[ecode]; +} + +void +freeaddrinfo(ai) + struct addrinfo *ai; +{ + struct addrinfo *next; + + do { + next = ai->ai_next; + if (ai->ai_canonname) + free(ai->ai_canonname); + /* no need to free(ai->ai_addr) */ + free(ai); + } while ((ai = next) != NULL); +} + +static int +str_isnumber(p) + const char *p; +{ + char *q = (char *)p; + while (*q) { + if (! isdigit(*q)) + return NO; + q++; + } + return YES; +} + +int +getaddrinfo(hostname, servname, hints, res) + const char *hostname, *servname; + const struct addrinfo *hints; + struct addrinfo **res; +{ + struct addrinfo sentinel; + struct addrinfo *top = NULL; + struct addrinfo *cur; + int i, error = 0; + char pton[PTON_MAX]; + struct addrinfo ai; + struct addrinfo *pai; + u_short port; + +#ifdef FAITH + static int firsttime = 1; + + if (firsttime) { + /* translator hack */ + { + char *q = getenv("GAI"); + if (q && inet_pton(AF_INET6, q, &faith_prefix) == 1) + translate = YES; + } + firsttime = 0; + } +#endif + + /* initialize file static vars */ + sentinel.ai_next = NULL; + cur = &sentinel; + pai = &ai; + pai->ai_flags = 0; + pai->ai_family = PF_UNSPEC; + pai->ai_socktype = ANY; + pai->ai_protocol = ANY; + pai->ai_addrlen = 0; + pai->ai_canonname = NULL; + pai->ai_addr = NULL; + pai->ai_next = NULL; + port = ANY; + + if (hostname == NULL && servname == NULL) + return EAI_NONAME; + if (hints) { + /* error check for hints */ + if (hints->ai_addrlen || hints->ai_canonname || + hints->ai_addr || hints->ai_next) + ERR(EAI_BADHINTS); /* xxx */ + if (hints->ai_flags & ~AI_MASK) + ERR(EAI_BADFLAGS); + switch (hints->ai_family) { + case PF_UNSPEC: + case PF_INET: +#ifdef INET6 + case PF_INET6: +#endif + break; + default: + ERR(EAI_FAMILY); + } + memcpy(pai, hints, sizeof(*pai)); + switch (pai->ai_socktype) { + case ANY: + switch (pai->ai_protocol) { + case ANY: + break; + case IPPROTO_UDP: + pai->ai_socktype = SOCK_DGRAM; + break; + case IPPROTO_TCP: + pai->ai_socktype = SOCK_STREAM; + break; + default: + pai->ai_socktype = SOCK_RAW; + break; + } + break; + case SOCK_RAW: + break; + case SOCK_DGRAM: + if (pai->ai_protocol != IPPROTO_UDP && + pai->ai_protocol != ANY) + ERR(EAI_BADHINTS); /*xxx*/ + pai->ai_protocol = IPPROTO_UDP; + break; + case SOCK_STREAM: + if (pai->ai_protocol != IPPROTO_TCP && + pai->ai_protocol != ANY) + ERR(EAI_BADHINTS); /*xxx*/ + pai->ai_protocol = IPPROTO_TCP; + break; + default: + ERR(EAI_SOCKTYPE); + break; + } + } + + /* + * service port + */ + if (servname) { + if (str_isnumber(servname)) { + if (pai->ai_socktype == ANY) { + /* caller accept *ANY* socktype */ + pai->ai_socktype = SOCK_DGRAM; + pai->ai_protocol = IPPROTO_UDP; + } + port = htons(atoi(servname)); + } else { + struct servent *sp; + char *proto; + + proto = NULL; + switch (pai->ai_socktype) { + case ANY: + proto = NULL; + break; + case SOCK_DGRAM: + proto = "udp"; + break; + case SOCK_STREAM: + proto = "tcp"; + break; + default: + fprintf(stderr, "panic!\n"); + break; + } + if ((sp = getservbyname(servname, proto)) == NULL) + ERR(EAI_SERVICE); + port = sp->s_port; + if (pai->ai_socktype == ANY) + if (strcmp(sp->s_proto, "udp") == 0) { + pai->ai_socktype = SOCK_DGRAM; + pai->ai_protocol = IPPROTO_UDP; + } else if (strcmp(sp->s_proto, "tcp") == 0) { + pai->ai_socktype = SOCK_STREAM; + pai->ai_protocol = IPPROTO_TCP; + } else + ERR(EAI_PROTOCOL); /*xxx*/ + } + } + + /* + * hostname == NULL. + * passive socket -> anyaddr (0.0.0.0 or ::) + * non-passive socket -> localhost (127.0.0.1 or ::1) + */ + if (hostname == NULL) { + struct afd *afd; + + for (afd = &afdl[0]; afd->a_af; afd++) { + if (!(pai->ai_family == PF_UNSPEC + || pai->ai_family == afd->a_af)) { + continue; + } + + if (pai->ai_flags & AI_PASSIVE) { + GET_AI(cur->ai_next, afd, afd->a_addrany, port); + /* xxx meaningless? + * GET_CANONNAME(cur->ai_next, "anyaddr"); + */ + } else { + GET_AI(cur->ai_next, afd, afd->a_loopback, + port); + /* xxx meaningless? + * GET_CANONNAME(cur->ai_next, "localhost"); + */ + } + cur = cur->ai_next; + } + top = sentinel.ai_next; + if (top) + goto good; + else + ERR(EAI_FAMILY); + } + + /* hostname as numeric name */ + for (i = 0; afdl[i].a_af; i++) { + if (inet_pton(afdl[i].a_af, hostname, pton)) { + u_long v4a; + u_char pfx; + + switch (afdl[i].a_af) { + case AF_INET: + v4a = ((struct in_addr *)pton)->s_addr; + if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a)) + pai->ai_flags &= ~AI_CANONNAME; + v4a >>= IN_CLASSA_NSHIFT; + if (v4a == 0 || v4a == IN_LOOPBACKNET) + pai->ai_flags &= ~AI_CANONNAME; + break; +#ifdef INET6 + case AF_INET6: + pfx = ((struct in6_addr *)pton)->s6_addr8[0]; + if (pfx == 0 || pfx == 0xfe || pfx == 0xff) + pai->ai_flags &= ~AI_CANONNAME; + break; +#endif + } + + if (pai->ai_family == afdl[i].a_af || + pai->ai_family == PF_UNSPEC) { + if (! (pai->ai_flags & AI_CANONNAME)) { + GET_AI(top, &afdl[i], pton, port); + goto good; + } + /* + * if AI_CANONNAME and if reverse lookup + * fail, return ai anyway to pacify + * calling application. + * + * XXX getaddrinfo() is a name->address + * translation function, and it looks strange + * that we do addr->name translation here. + */ + get_name(pton, &afdl[i], &top, pton, pai, port); + goto good; + } else + ERR(EAI_FAMILY); /*xxx*/ + } + } + + if (pai->ai_flags & AI_NUMERICHOST) + ERR(EAI_NONAME); + + /* hostname as alphabetical name */ + error = get_addr(hostname, pai->ai_family, &top, pai, port); + if (error == 0) { + if (top) { + good: + *res = top; + return SUCCESS; + } else + error = EAI_FAIL; + } + free: + if (top) + freeaddrinfo(top); + bad: + *res = NULL; + return error; +} + +static int +get_name(addr, afd, res, numaddr, pai, port0) + const char *addr; + struct afd *afd; + struct addrinfo **res; + char *numaddr; + struct addrinfo *pai; + int port0; +{ + u_short port = port0 & 0xffff; + struct hostent *hp; + struct addrinfo *cur; + int error = 0, h_error; + +#ifdef INET6 + hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error); +#else + hp = gethostbyaddr(addr, afd->a_addrlen, AF_INET); +#endif + if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) { + GET_AI(cur, afd, hp->h_addr_list[0], port); + GET_CANONNAME(cur, hp->h_name); + } else + GET_AI(cur, afd, numaddr, port); + +#ifdef INET6 + if (hp) + freehostent(hp); +#endif + *res = cur; + return SUCCESS; + free: + if (cur) + freeaddrinfo(cur); +#ifdef INET6 + if (hp) + freehostent(hp); +#endif + /* bad: */ + *res = NULL; + return error; +} + +static int +get_addr(hostname, af, res, pai, port0) + const char *hostname; + int af; + struct addrinfo **res; + struct addrinfo *pai; + int port0; +{ + u_short port = port0 & 0xffff; + struct addrinfo sentinel; + struct hostent *hp; + struct addrinfo *top, *cur; + struct afd *afd; + int i, error = 0, h_error; + char *ap; +#ifndef INET6 + extern int h_errno; +#endif + + top = NULL; + sentinel.ai_next = NULL; + cur = &sentinel; +#ifdef INET6 + if (af == AF_UNSPEC) { + hp = getipnodebyname(hostname, AF_INET6, + AI_ADDRCONFIG|AI_ALL|AI_V4MAPPED, &h_error); + } else + hp = getipnodebyname(hostname, af, AI_ADDRCONFIG, &h_error); +#else + hp = gethostbyname(hostname); + h_error = h_errno; +#endif + if (hp == NULL) { + switch (h_error) { + case HOST_NOT_FOUND: + case NO_DATA: + error = EAI_NODATA; + break; + case TRY_AGAIN: + error = EAI_AGAIN; + break; + case NO_RECOVERY: + default: + error = EAI_FAIL; + break; + } + goto bad; + } + + if ((hp->h_name == NULL) || (hp->h_name[0] == 0) || + (hp->h_addr_list[0] == NULL)) + ERR(EAI_FAIL); + + for (i = 0; (ap = hp->h_addr_list[i]) != NULL; i++) { + switch (af) { +#ifdef INET6 + case AF_INET6: + afd = &afdl[N_INET6]; + break; +#endif +#ifndef INET6 + default: /* AF_UNSPEC */ +#endif + case AF_INET: + afd = &afdl[N_INET]; + break; +#ifdef INET6 + default: /* AF_UNSPEC */ + if (IN6_IS_ADDR_V4MAPPED((struct in6_addr *)ap)) { + ap += sizeof(struct in6_addr) - + sizeof(struct in_addr); + afd = &afdl[N_INET]; + } else + afd = &afdl[N_INET6]; + break; +#endif + } +#ifdef FAITH + if (translate && afd->a_af == AF_INET) { + struct in6_addr *in6; + + GET_AI(cur->ai_next, &afdl[N_INET6], ap, port); + in6 = &((struct sockaddr_in6 *)cur->ai_next->ai_addr)->sin6_addr; + memcpy(&in6->s6_addr32[0], &faith_prefix, + sizeof(struct in6_addr) - sizeof(struct in_addr)); + memcpy(&in6->s6_addr32[3], ap, sizeof(struct in_addr)); + } else +#endif /* FAITH */ + GET_AI(cur->ai_next, afd, ap, port); + if (cur == &sentinel) { + top = cur->ai_next; + GET_CANONNAME(top, hp->h_name); + } + cur = cur->ai_next; + } +#ifdef INET6 + freehostent(hp); +#endif + *res = top; + return SUCCESS; + free: + if (top) + freeaddrinfo(top); +#ifdef INET6 + if (hp) + freehostent(hp); +#endif + bad: + *res = NULL; + return error; +} Index: ncftp3/libncftp/getnameinfo.c diff -u /dev/null ncftp3/libncftp/getnameinfo.c:1.1 --- /dev/null Mon Nov 9 21:52:32 2009 +++ ncftp3/libncftp/getnameinfo.c Tue Nov 6 23:50:47 2001 @@ -0,0 +1,203 @@ +/* + * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Issues to be discussed: + * - Thread safe-ness must be checked + * - Return values. There seems to be no standard for return value (RFC2133) + * but INRIA implementation returns EAI_xxx defined for getaddrinfo(). + */ + +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <arpa/nameser.h> +#include <netdb.h> +#include <resolv.h> +#include <string.h> +#include <stddef.h> + +#include "addrinfo.h" + +#define SUCCESS 0 +#define ANY 0 +#define YES 1 +#define NO 0 + +static struct afd { + int a_af; + int a_addrlen; + int a_socklen; + int a_off; +} afdl [] = { +#ifdef INET6 + {PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6), + offsetof(struct sockaddr_in6, sin6_addr)}, +#endif + {PF_INET, sizeof(struct in_addr), sizeof(struct sockaddr_in), + offsetof(struct sockaddr_in, sin_addr)}, + {0, 0, 0}, +}; + +struct sockinet { + u_char si_len; + u_char si_family; + u_short si_port; +}; + +#define ENI_NOSOCKET 0 +#define ENI_NOSERVNAME 1 +#define ENI_NOHOSTNAME 2 +#define ENI_MEMORY 3 +#define ENI_SYSTEM 4 +#define ENI_FAMILY 5 +#define ENI_SALEN 6 + +int +getnameinfo(sa, salen, host, hostlen, serv, servlen, flags) + const struct sockaddr *sa; + size_t salen; + char *host; + size_t hostlen; + char *serv; + size_t servlen; + int flags; +{ + struct afd *afd; + struct servent *sp; + struct hostent *hp; + u_short port; + int family, len, i; + char *addr, *p; + u_long v4a; + u_char pfx; + int h_error; + char numserv[512]; + char numaddr[512]; + + if (sa == NULL) + return ENI_NOSOCKET; + + len = sa->sa_len; + if (len != salen) return ENI_SALEN; + + family = sa->sa_family; + for (i = 0; afdl[i].a_af; i++) + if (afdl[i].a_af == family) { + afd = &afdl[i]; + goto found; + } + return ENI_FAMILY; + + found: + if (len != afd->a_socklen) return ENI_SALEN; + + port = ((struct sockinet *)sa)->si_port; /* network byte order */ + addr = (char *)sa + afd->a_off; + + if (serv == NULL || servlen == 0) { + /* what we should do? */ + } else if (flags & NI_NUMERICSERV) { + snprintf(numserv, sizeof(numserv), "%d", ntohs(port)); + if (strlen(numserv) > servlen) + return ENI_MEMORY; + strcpy(serv, numserv); + } else { + sp = getservbyport(port, (flags & NI_DGRAM) ? "udp" : "tcp"); + if (sp) { + if (strlen(sp->s_name) > servlen) + return ENI_MEMORY; + strcpy(serv, sp->s_name); + } else + return ENI_NOSERVNAME; + } + + switch (sa->sa_family) { + case AF_INET: + v4a = ((struct sockaddr_in *)sa)->sin_addr.s_addr; + if (IN_MULTICAST(v4a) || IN_EXPERIMENTAL(v4a)) + flags |= NI_NUMERICHOST; + v4a >>= IN_CLASSA_NSHIFT; + if (v4a == 0 || v4a == IN_LOOPBACKNET) + flags |= NI_NUMERICHOST; + break; +#ifdef INET6 + case AF_INET6: + pfx = ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr8[0]; + if (pfx == 0 || pfx == 0xfe || pfx == 0xff) + flags |= NI_NUMERICHOST; + break; +#endif + } + if (host == NULL || hostlen == 0) { + /* what should we do? */ + } else if (flags & NI_NUMERICHOST) { + if (inet_ntop(afd->a_af, addr, numaddr, sizeof(numaddr)) + == NULL) + return ENI_SYSTEM; + if (strlen(numaddr) > hostlen) + return ENI_MEMORY; + strcpy(host, numaddr); + } else { +#ifdef INET6 + hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error); +#else + hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af); + h_error = h_errno; +#endif + + if (hp) { + if (flags & NI_NOFQDN) { + p = strchr(hp->h_name, '.'); + if (p) *p = '\0'; + } + if (strlen(hp->h_name) > hostlen) { +#ifdef INET6 + freehostent(hp); +#endif + return ENI_MEMORY; + } + strcpy(host, hp->h_name); +#ifdef INET6 + freehostent(hp); +#endif + } else { + if (flags & NI_NAMEREQD) + return ENI_NOHOSTNAME; + if (inet_ntop(afd->a_af, addr, numaddr, sizeof(numaddr)) + == NULL) + return ENI_NOHOSTNAME; + if (strlen(numaddr) > hostlen) + return ENI_MEMORY; + strcpy(host, numaddr); + } + } + return SUCCESS; +} Index: ncftp3/libncftp/ncftp.h diff -u ncftp3/libncftp/ncftp.h:1.1.1.23 ncftp3/libncftp/ncftp.h:1.28 --- ncftp3/libncftp/ncftp.h:1.1.1.23 Thu Nov 5 16:20:41 2009 +++ ncftp3/libncftp/ncftp.h Thu Nov 5 16:47:09 2009 @@ -378,11 +378,10 @@ int mlsFeatures; /* Do not modify this field. */ int STATfileParamWorks; /* Do not modify this field. */ int NLSTfileParamWorks; /* Do not modify this field. */ - - struct sockaddr_in servCtlAddr; /* Do not modify this field. */ - struct sockaddr_in servDataAddr; /* Do not modify this field. */ - struct sockaddr_in ourCtlAddr; /* Do not modify this field. */ - struct sockaddr_in ourDataAddr; /* Do not modify this field. */ + struct sockaddr_storage servCtlAddr; /* Do not modify this field. */ + struct sockaddr_storage servDataAddr; /* Do not modify this field. */ + struct sockaddr_storage ourCtlAddr; /* Do not modify this field. */ + struct sockaddr_storage ourDataAddr; /* Do not modify this field. */ int netMode; /* Do not use or modify. */ char *buf; /* Do not modify this field. */ size_t bufSize; /* Do not modify this field. */ @@ -997,8 +996,8 @@ /* Everything else below are private routines, or stuff for testing */ int FTPInitConnectionInfo2(const FTPLIPtr lip, const FTPCIPtr cip, char *const buf, size_t bufSize); -int FTPSendPort(const FTPCIPtr cip, struct sockaddr_in *saddr); -int FTPSendPassive(const FTPCIPtr cip, struct sockaddr_in *saddr, int *weird); +int FTPSendPort(const FTPCIPtr cip, struct sockaddr *saddr); +int FTPSendPassive(const FTPCIPtr cip, struct sockaddr *saddr, int *weird); int FTPSetStartOffset(const FTPCIPtr cip, longest_int restartPt); void FTPCloseControlConnection(const FTPCIPtr cip); int FTPSendCommandStr(const FTPCIPtr cip, char *const command, const size_t siz); @@ -1060,7 +1059,7 @@ int FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, const int trySIZE, const int tryMLST, const int trySTAT, const int tryNLST); void FTPGetDateStr(time_t t, const char *fmt, char *const ltstr1, const size_t ltstr1size, char *const gtstr1, const size_t gtstr1size); -int BindToEphemeralPortNumber(const int sockfd, struct sockaddr_in *const addrp, const int ephemLo, const int ephemHi); +int BindToEphemeralPortNumber(const int sockfd, struct sockaddr *const addrp, const int ephemLo, const int ephemHi); int BufferGets(char *, size_t, int, char *, char **, char **, size_t); void DisposeFileInfoListContents(FTPFileInfoListPtr); void InitFileInfoList(FTPFileInfoListPtr); Index: ncftp3/libncftp/syshdrs.h diff -u ncftp3/libncftp/syshdrs.h:1.1.1.15 ncftp3/libncftp/syshdrs.h:1.14 --- ncftp3/libncftp/syshdrs.h:1.1.1.15 Thu Nov 5 16:20:41 2009 +++ ncftp3/libncftp/syshdrs.h Thu Nov 5 16:47:09 2009 @@ -24,6 +24,10 @@ # define _WIN32_WINNT 0x0400 # endif # include <windows.h> /* includes <winsock2.h> if _WIN32_WINNT >= 0x400 */ +# ifdef ENABLE_IPV6 +# include <ws2tcpip.h> +# define INET6_ADDRSTRLEN 46 +# endif /* ENABLE_IPV6 */ # include <shlobj.h> # include <io.h> # include <conio.h> @@ -164,6 +168,9 @@ # include <resolv.h> # endif +# ifndef HAVE_GETADDRINFO +# include "addrinfo.h" +# endif # ifdef CAN_USE_SYS_SELECT_H # include <sys/select.h> # endif Index: ncftp3/ncftp/cmds.c diff -u ncftp3/ncftp/cmds.c:1.1.1.22 ncftp3/ncftp/cmds.c:1.22 --- ncftp3/ncftp/cmds.c:1.1.1.22 Thu Nov 5 16:20:41 2009 +++ ncftp3/ncftp/cmds.c Mon Nov 9 21:51:14 2009 @@ -2558,8 +2558,7 @@ (void) printf("Unknown host \"%s\".\n", ohost); return (-1); } - (void) STRNCPY(gConn.host, ipstr); - OpenMsg("Connecting to %s...", ipstr); + OpenMsg("Connecting to %s...", gConn.host); } else { OpenMsg("Connecting to %s via %s...", gConn.host, gConn.firewallHost); Trace(0, "Fw: %s Type: %d User: %s Pass: %s Port: %u\n", @@ -3747,8 +3746,8 @@ char preferredLocalAddrStr[64]; preferredLocalAddrStr[0] = '\0'; - if (gConn.preferredLocalAddr.sin_family != 0) - AddrToAddrStr(preferredLocalAddrStr, sizeof(preferredLocalAddrStr), &gConn.preferredLocalAddr, 0, "%h"); + if (gConn.preferredLocalAddr.sin_family == AF_INET) + AddrToAddrStr(preferredLocalAddrStr, sizeof(preferredLocalAddrStr), (struct sockaddr *)&gConn.preferredLocalAddr, 0, "%h"); if (ftwip->depth >= 50) { Trace(-1, "Aborting -- recursion depth is %u.\nPerhaps an infinite loop exists on the remote filesystem?", (unsigned int) ftwip->depth); @@ -3915,8 +3914,8 @@ char preferredLocalAddrStr[64]; preferredLocalAddrStr[0] = '\0'; - if (gConn.preferredLocalAddr.sin_family != 0) - AddrToAddrStr(preferredLocalAddrStr, sizeof(preferredLocalAddrStr), &gConn.preferredLocalAddr, 0, "%h"); + if (gConn.preferredLocalAddr.sin_family == AF_INET) + AddrToAddrStr(preferredLocalAddrStr, sizeof(preferredLocalAddrStr), (struct sockaddr *)&gConn.preferredLocalAddr, 0, "%h"); cinfo.xtype = gBm.xferType; cinfo.deleteFlag = kDeleteNo; @@ -4123,8 +4122,8 @@ char preferredLocalAddrStr[64]; preferredLocalAddrStr[0] = '\0'; - if (gConn.preferredLocalAddr.sin_family != 0) - AddrToAddrStr(preferredLocalAddrStr, sizeof(preferredLocalAddrStr), &gConn.preferredLocalAddr, 0, "%h"); + if (gConn.preferredLocalAddr.sin_family == AF_INET) + AddrToAddrStr(preferredLocalAddrStr, sizeof(preferredLocalAddrStr), (struct sockaddr *)&gConn.preferredLocalAddr, 0, "%h"); cinfop = (SpoolCmdInfo *) ftwip->userdata; /* rerpath = ftwip->curPath + ftwip->startPathLen + 1; */ @@ -4284,8 +4283,8 @@ char preferredLocalAddrStr[64]; preferredLocalAddrStr[0] = '\0'; - if (gConn.preferredLocalAddr.sin_family != 0) - AddrToAddrStr(preferredLocalAddrStr, sizeof(preferredLocalAddrStr), &gConn.preferredLocalAddr, 0, "%h"); + if (gConn.preferredLocalAddr.sin_family == AF_INET) + AddrToAddrStr(preferredLocalAddrStr, sizeof(preferredLocalAddrStr), (struct sockaddr *)&gConn.preferredLocalAddr, 0, "%h"); cinfo.xtype = gBm.xferType; cinfo.deleteFlag = kDeleteNo; Index: ncftp3/ncftp/syshdrs.h diff -u ncftp3/ncftp/syshdrs.h:1.1.1.15 ncftp3/ncftp/syshdrs.h:1.13 --- ncftp3/ncftp/syshdrs.h:1.1.1.15 Thu Nov 5 16:20:41 2009 +++ ncftp3/ncftp/syshdrs.h Thu Nov 5 16:47:09 2009 @@ -33,6 +33,9 @@ # define _WIN32_WINNT 0x0400 # endif # include <windows.h> /* includes <winsock2.h> if _WIN32_WINNT >= 0x400 */ +#ifdef ENABLE_IPV6 +# include <ws2tcpip.h> +#endif /* ENABLE_IPV6 */ # include <shlobj.h> # include <process.h> # include <direct.h> @@ -174,6 +177,9 @@ # include <time.h> # include <pwd.h> # include <fcntl.h> +# ifndef HAVE_GETADDRINFO +# include "addrinfo.h" +# endif # if defined(HAVE_SYS_IOCTL_H) && defined(HAVE_TERMIOS_H) # include <sys/ioctl.h> # include <termios.h> Index: ncftp3/ncftp/util.c diff -u ncftp3/ncftp/util.c:1.1.1.16 ncftp3/ncftp/util.c:1.26 --- ncftp3/ncftp/util.c:1.1.1.16 Mon Aug 11 15:38:07 2008 +++ ncftp3/ncftp/util.c Mon Aug 11 16:24:16 2008 @@ -666,44 +666,30 @@ int MyGetHostByName(char *const volatile dst, size_t dsize, const char *const hn, int t) { + struct addrinfo hints; + struct addrinfo *res; + int error; #if (defined(WIN32) || defined(_WINDOWS)) && !defined(__CYGWIN__) - struct hostent *hp; - struct in_addr ina; - if (inet_addr(hn) != (unsigned long) 0xFFFFFFFF) { - /* Address is an IP address string, which is what we want. */ - (void) Strncpy(dst, hn, dsize); - return (0); - } - - hp = gethostbyname(hn); - if (hp != NULL) { - (void) memcpy(&ina.s_addr, hp->h_addr_list[0], (size_t) hp->h_length); - InetNtoA(dst, ((struct in_addr **) hp->h_addr_list)[0], dsize); + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(hn, NULL, &hints, &res); + + if (error == 0) { + char buf[NI_MAXHOST]; + + getnameinfo(res->ai_addr, res->ai_addrlen, + buf, sizeof(buf), + NULL, 0, NI_NUMERICHOST); + (void) Strncpy(dst, buf, dsize); + freeaddrinfo(res); return (0); } #else int sj; vsigproc_t osigpipe, osigint, osigalrm; - struct hostent *hp; -#ifdef HAVE_INET_ATON - struct in_addr ina; -#endif - -#ifdef HAVE_INET_ATON - if (inet_aton(hn, &ina) != 0) { - /* Address is an IP address string, which is what we want. */ - (void) Strncpy(dst, hn, dsize); - return (0); - } -#else - if (inet_addr(hn) != (unsigned long) 0xFFFFFFFF) { - /* Address is an IP address string, which is what we want. */ - (void) Strncpy(dst, hn, dsize); - return (0); - } -#endif #ifdef HAVE_SIGSETJMP osigpipe = osigint = osigalrm = (sigproc_t) 0; @@ -728,14 +714,25 @@ osigalrm = NcSignal(SIGALRM, CancelGetHostByName); if (t > 0) (void) alarm((unsigned int) t); - hp = gethostbyname(hn); + memset(&hints, 0, sizeof(hints)); + hints.ai_flags = 0; + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = 0; + error = getaddrinfo(hn, NULL, &hints, &res); if (t > 0) (void) alarm(0); (void) NcSignal(SIGPIPE, osigpipe); (void) NcSignal(SIGINT, osigint); (void) NcSignal(SIGALRM, osigalrm); - if (hp != NULL) { - InetNtoA(dst, ((struct in_addr **) hp->h_addr_list)[0], dsize); + if (error == 0) { + char buf[NI_MAXHOST]; + + getnameinfo(res->ai_addr, res->ai_addrlen, + buf, sizeof(buf), + NULL, 0, NI_NUMERICHOST); + (void) Strncpy(dst, buf, dsize); + freeaddrinfo(res); return (0); } } Index: ncftp3/sh_util/ncftpbatch.c diff -u ncftp3/sh_util/ncftpbatch.c:1.1.1.20 ncftp3/sh_util/ncftpbatch.c:1.2 --- ncftp3/sh_util/ncftpbatch.c:1.1.1.20 Thu Nov 5 16:20:41 2009 +++ ncftp3/sh_util/ncftpbatch.c Mon Nov 9 21:51:14 2009 @@ -1203,7 +1203,7 @@ } if (gSourceAddrStr[0] != '\0') - (void) AddrStrToAddr(gSourceAddrStr, &gConn.preferredLocalAddr, 21); + (void) AddrStrToAddr(gSourceAddrStr, (struct sockaddr *)&gConn.preferredLocalAddr, 21); gConn.connTimeout = 30; gConn.ctrlTimeout = 135; Index: ncftp3/sh_util/ncftpget.c diff -u ncftp3/sh_util/ncftpget.c:1.1.1.19 ncftp3/sh_util/ncftpget.c:1.2 --- ncftp3/sh_util/ncftpget.c:1.1.1.19 Thu Nov 5 16:20:41 2009 +++ ncftp3/sh_util/ncftpget.c Mon Nov 9 21:51:14 2009 @@ -371,7 +371,7 @@ ftpcat = 2; break; case 'I': - if (AddrStrToAddr(opt.arg, &fi.preferredLocalAddr, 21) < 0) { + if (AddrStrToAddr(opt.arg, (struct sockaddr *)&fi.preferredLocalAddr, 21) < 0) { fprintf(stderr, "Bad IP address (\"%s\") used with -I.\n", opt.arg); Usage(); } Index: ncftp3/sh_util/ncftpls.c diff -u ncftp3/sh_util/ncftpls.c:1.1.1.16 ncftp3/sh_util/ncftpls.c:1.2 --- ncftp3/sh_util/ncftpls.c:1.1.1.16 Thu Nov 5 16:20:41 2009 +++ ncftp3/sh_util/ncftpls.c Mon Nov 9 21:51:14 2009 @@ -489,7 +489,7 @@ do_listings = 0; break; case 'I': - if (AddrStrToAddr(opt.arg, &fi.preferredLocalAddr, 21) < 0) { + if (AddrStrToAddr(opt.arg, (struct sockaddr *)&fi.preferredLocalAddr, 21) < 0) { fprintf(stderr, "Bad IP address (\"%s\") used with -I.\n", opt.arg); Usage(); } Index: ncftp3/sh_util/ncftpput.c diff -u ncftp3/sh_util/ncftpput.c:1.1.1.18 ncftp3/sh_util/ncftpput.c:1.2 --- ncftp3/sh_util/ncftpput.c:1.1.1.18 Thu Nov 5 16:20:41 2009 +++ ncftp3/sh_util/ncftpput.c Mon Nov 9 21:51:14 2009 @@ -388,7 +388,7 @@ STRNCAT(postcmd, "\n"); break; case 'I': - if (AddrStrToAddr(opt.arg, &fi.preferredLocalAddr, 21) < 0) { + if (AddrStrToAddr(opt.arg, (struct sockaddr *)&fi.preferredLocalAddr, 21) < 0) { fprintf(stderr, "Bad IP address (\"%s\") used with -I.\n", opt.arg); Usage(); } Index: ncftp3/sh_util/syshdrs.h diff -u ncftp3/sh_util/syshdrs.h:1.1.1.11 ncftp3/sh_util/syshdrs.h:1.11 --- ncftp3/sh_util/syshdrs.h:1.1.1.11 Thu Nov 5 16:20:41 2009 +++ ncftp3/sh_util/syshdrs.h Thu Nov 5 16:47:09 2009 @@ -33,6 +33,9 @@ # define _WIN32_WINNT 0x0400 # endif # include <windows.h> /* includes <winsock2.h> if _WIN32_WINNT >= 0x400 */ +#ifdef ENABLE_IPV6 +# include <ws2tcpip.h> +#endif /* ENABLE_IPV6 */ # include <shlobj.h> # include <tchar.h> # include <process.h> @@ -167,6 +170,9 @@ # include <pwd.h> # include <fcntl.h> # include <dirent.h> +# ifndef HAVE_GETADDRINFO +# include "addrinfo.h" +# endif # ifdef HAVE_LOCALE_H # include <locale.h> # endif Index: ncftp3/sio/SAccept.c diff -u ncftp3/sio/SAccept.c:1.1.1.1 ncftp3/sio/SAccept.c:1.4 --- ncftp3/sio/SAccept.c:1.1.1.1 Thu Jan 8 19:51:19 2004 +++ ncftp3/sio/SAccept.c Wed Aug 25 21:33:11 2004 @@ -3,8 +3,20 @@ # pragma hdrstop #endif +#ifndef HAVE_SOCKADDR_SA_LEN +#ifndef SA_LEN +#ifdef ENABLE_IPV6 +#define SA_LEN(x) (((x)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \ + : (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) \ + : -1)) +#else /* ENABLE_IPV6 */ +#define SA_LEN(x) (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) : -1) +#endif /* ENABLE_IPV6 */ +#endif /* SA_LEN */ +#endif /* HAVE_SOCKADDR_SA_LEN */ + int -SAccept(int sfd, struct sockaddr_in *const addr, int tlen) +SAccept(int sfd, struct sockaddr *const addr, int tlen) { int result; fd_set ss; @@ -22,7 +34,7 @@ if (tlen <= 0) { errno = 0; for (;;) { - size = (sockaddr_size_t) sizeof(struct sockaddr_in); + size = (sockaddr_size_t) sizeof(struct sockaddr_storage); result = accept(sfd, (struct sockaddr *) addr, &size); if ((result >= 0) || (errno != EINTR)) { RESTORE_SIGPIPE @@ -61,7 +73,7 @@ } do { - size = (sockaddr_size_t) sizeof(struct sockaddr_in); + size = (sockaddr_size_t) sizeof(struct sockaddr_storage); result = accept(sfd, (struct sockaddr *) addr, &size); } while ((result < 0) && (errno == EINTR)); Index: ncftp3/sio/SConnect.c diff -u ncftp3/sio/SConnect.c:1.1.1.10 ncftp3/sio/SConnect.c:1.18 --- ncftp3/sio/SConnect.c:1.1.1.10 Thu Nov 5 16:20:41 2009 +++ ncftp3/sio/SConnect.c Thu Nov 5 16:47:09 2009 @@ -3,14 +3,30 @@ # pragma hdrstop #endif -int _SConnect(const int sfd, const struct sockaddr_in *const addr, const size_t saddrsiz, const int tlen); +int _SConnect(const int sfd, const struct sockaddr *const addr, const size_t saddrsiz, const int tlen); + +#ifndef HAVE_SOCKADDR_SA_LEN +#ifndef SA_LEN +#ifdef ENABLE_IPV6 +#define SA_LEN(x) (((x)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \ + : (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) \ + : -1)) +#else /* ENABLE_IPV6 */ +#define SA_LEN(x) (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) : -1) +#endif /* ENABLE_IPV6 */ +#endif /* SA_LEN */ +#endif /* HAVE_SOCKADDR_SA_LEN */ int -SConnect(int sfd, const struct sockaddr_in *const addr, int tlen) +SConnect(int sfd, const struct sockaddr *const addr, int tlen) { int result; - result = _SConnect(sfd, addr, (size_t) sizeof(struct sockaddr_in), tlen); +#ifdef HAVE_SOCKADDR_SA_LEN + result = _SConnect(sfd, addr, addr->sa_len, tlen); +#else + result = _SConnect(sfd, addr, SA_LEN(addr), tlen); +#endif return (result); } /* SConnect */ @@ -54,7 +70,7 @@ int -_SConnect(const int sfd, const struct sockaddr_in *const addr, const size_t saddrsiz, const int tlen) +_SConnect(const int sfd, const struct sockaddr *const addr, const size_t saddrsiz, const int tlen) { fd_set ss, xx; struct timeval tv; Index: ncftp3/sio/SConnectByName.c diff -u ncftp3/sio/SConnectByName.c:1.1.1.3 ncftp3/sio/SConnectByName.c:1.3 --- ncftp3/sio/SConnectByName.c:1.1.1.3 Thu Jan 8 19:51:16 2004 +++ ncftp3/sio/SConnectByName.c Thu Jan 8 20:09:33 2004 @@ -7,15 +7,15 @@ SConnectByName(int sfd, const char * const addrStr, const int tlen) { int result; - struct sockaddr_in remoteAddr; + struct sockaddr_storage remoteAddr; if (addrStr == NULL) { errno = EINVAL; return (-1); } - if ((result = AddrStrToAddr(addrStr, &remoteAddr, -1)) == 0) { - result = SConnect(sfd, &remoteAddr, tlen); + if ((result = AddrStrToAddr(addrStr, (struct sockaddr *)&remoteAddr, -1)) == 0) { + result = SConnect(sfd, (struct sockaddr *)&remoteAddr, tlen); } return (result); } /* SConnectByName */ Index: ncftp3/sio/SRecvfrom.c diff -u ncftp3/sio/SRecvfrom.c:1.1.1.5 ncftp3/sio/SRecvfrom.c:1.4 --- ncftp3/sio/SRecvfrom.c:1.1.1.5 Thu Jan 8 19:51:18 2004 +++ ncftp3/sio/SRecvfrom.c Thu Jan 8 20:09:33 2004 @@ -4,7 +4,7 @@ #endif int -SRecvfrom(int sfd, char *const buf, size_t size, int fl, struct sockaddr_in *const fromAddr, int tlen) +SRecvfrom(int sfd, char *const buf, size_t size, int fl, struct sockaddr *const fromAddr, int tlen) { recv_return_t nread; int tleft; @@ -56,7 +56,7 @@ IGNORE_SIGPIPE nread = recvfrom(sfd, buf, (recv_size_t) size, fl, - (struct sockaddr *) fromAddr, &alen); + fromAddr, &alen); RESTORE_SIGPIPE if (nread >= 0) Index: ncftp3/sio/SSendto.c diff -u ncftp3/sio/SSendto.c:1.1.1.5 ncftp3/sio/SSendto.c:1.5 --- ncftp3/sio/SSendto.c:1.1.1.5 Thu Jan 8 19:51:18 2004 +++ ncftp3/sio/SSendto.c Thu Jan 8 20:09:33 2004 @@ -3,8 +3,21 @@ # pragma hdrstop #endif +#ifndef HAVE_SOCKADDR_SA_LEN +#ifndef SA_LEN +#ifdef ENABLE_IPV6 +#define SA_LEN(x) (((x)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \ + : (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) \ + : -1)) +#else /* ENABLE_IPV6 */ +#define SA_LEN(x) (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) : -1) +#endif /* ENABLE_IPV6 */ +#endif /* SA_LEN */ +#endif /* HAVE_SOCKADDR_SA_LEN */ + + int -SSendto(int sfd, const char *const buf, size_t size, int fl, const struct sockaddr_in *const toAddr, int tlen) +SSendto(int sfd, const char *const buf, size_t size, int fl, const struct sockaddr *const toAddr, int tlen) { send_return_t nwrote; int tleft; @@ -58,9 +71,15 @@ } IGNORE_SIGPIPE +#ifdef HAVE_SOCKADDR_SA_LEN + nwrote = sendto(sfd, buf, (send_size_t) size, fl, + toAddr, + toAddr->sa_len); +#else nwrote = sendto(sfd, buf, (send_size_t) size, fl, - (const struct sockaddr *) toAddr, - (sockaddr_size_t) sizeof(struct sockaddr_in)); + toAddr, + SA_LEN(toAddr)); +#endif RESTORE_SIGPIPE if (nwrote >= 0) @@ -77,7 +96,7 @@ int -Sendto(int sfd, const char *const buf, size_t size, const struct sockaddr_in *const toAddr) +Sendto(int sfd, const char *const buf, size_t size, const struct sockaddr *toAddr) { int result; DECL_SIGPIPE_VARS @@ -89,9 +108,15 @@ IGNORE_SIGPIPE do { +#ifdef HAVE_SOCKADDR_SA_LEN + result = (int) sendto(sfd, buf, (send_size_t) size, 0, + toAddr, + toAddr->sa_len); +#else result = (int) sendto(sfd, buf, (send_size_t) size, 0, - (const struct sockaddr *) toAddr, - (sockaddr_size_t) sizeof(struct sockaddr_in)); + toAddr, + SA_LEN(toAddr)); +#endif } while ((result < 0) && (errno == EINTR)); RESTORE_SIGPIPE return (result); Index: ncftp3/sio/SSendtoByName.c diff -u ncftp3/sio/SSendtoByName.c:1.1.1.5 ncftp3/sio/SSendtoByName.c:1.4 --- ncftp3/sio/SSendtoByName.c:1.1.1.5 Thu Jan 8 19:51:18 2004 +++ ncftp3/sio/SSendtoByName.c Thu Jan 8 20:09:33 2004 @@ -11,7 +11,7 @@ time_t done, now; fd_set ss; struct timeval tv; - struct sockaddr_in toAddr; + struct sockaddr_storage toAddr; DECL_SIGPIPE_VARS if ((buf == NULL) || (size == 0) || (toAddrStr == NULL) || (toAddrStr[0] == '\0') || (tlen <= 0)) { @@ -19,7 +19,7 @@ return (-1); } - if ((result = AddrStrToAddr(toAddrStr, &toAddr, -1)) < 0) { + if ((result = AddrStrToAddr(toAddrStr, (struct sockaddr *)&toAddr, -1)) < 0) { return (result); } @@ -81,7 +81,7 @@ SendtoByName(int sfd, const char *const buf, size_t size, const char *const toAddrStr) { int result; - struct sockaddr_in toAddr; + struct sockaddr_storage toAddr; DECL_SIGPIPE_VARS if ((buf == NULL) || (size == 0) || (toAddrStr == NULL)) { @@ -89,8 +89,7 @@ return (-1); } - - if ((result = AddrStrToAddr(toAddrStr, &toAddr, -1)) < 0) { + if ((result = AddrStrToAddr(toAddrStr, (struct sockaddr *)&toAddr, -1)) < 0) { return (result); } Index: ncftp3/sio/StrAddr.c diff -u ncftp3/sio/StrAddr.c:1.1.1.7 ncftp3/sio/StrAddr.c:1.10 --- ncftp3/sio/StrAddr.c:1.1.1.7 Mon Aug 11 15:38:23 2008 +++ ncftp3/sio/StrAddr.c Mon Aug 11 16:24:16 2008 @@ -6,6 +6,19 @@ # pragma hdrstop #endif +#ifndef HAVE_SOCKADDR_SA_LEN +#ifndef SA_LEN +#ifdef ENABLE_IPV6 +#define SA_LEN(x) (((x)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \ + : (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) \ + : -1)) +#else /* ENABLE_IPV6 */ +#define SA_LEN(x) (((x)->sa_family == AF_INET) ? sizeof(struct sockaddr_in) : -1) +#endif /* ENABLE_IPV6 */ +#endif /* SA_LEN */ +#endif /* HAVE_SOCKADDR_SA_LEN */ + + #ifndef INADDR_ANY # define INADDR_ANY ((unsigned long int) 0x00000000) #endif @@ -25,14 +38,10 @@ { char str[64]; char *cp; -#if defined(HAVE_GETSERVBYNAME_R) && (defined(AIX) || defined(TRU64UNIX) || defined(DIGITAL_UNIX)) - struct servent *sp; -#elif defined(HAVE_GETSERVBYNAME_R) && (defined(LINUX) || defined(SOLARIS) || defined(IRIX) || defined(BSDOS)) - struct servent se, *sp; - char spbuf[256]; -#else - struct servent *sp; -#endif + struct addrinfo hints, *res; + int error; + unsigned int port; + strncpy(str, s, sizeof(str) - 1); str[sizeof(str) - 1] = '\0'; cp = str; @@ -49,55 +58,29 @@ } *cp = '\0'; - sp = NULL; -#if defined(HAVE_GETSERVBYNAME_R) && (defined(SOLARIS) || defined(IRIX) || defined(BSDOS)) - if ((sp == NULL) && ((proto == 0) || (proto == 't'))) { - memset(spbuf, 0, sizeof(spbuf)); - sp = getservbyname_r(str, "tcp", &se, spbuf, sizeof(spbuf)); - } - if ((sp == NULL) && ((proto == 0) || (proto == 'u'))) { - memset(spbuf, 0, sizeof(spbuf)); - sp = getservbyname_r(str, "udp", &se, spbuf, sizeof(spbuf)); - } -#elif defined(HAVE_GETSERVBYNAME_R) && defined(LINUX) - if ((sp == NULL) && ((proto == 0) || (proto == 't'))) { - memset(spbuf, 0, sizeof(spbuf)); - if (getservbyname_r(str, "tcp", &se, spbuf, sizeof(spbuf), &sp) != 0) - sp = NULL; - } - if ((sp == NULL) && ((proto == 0) || (proto == 'u'))) { - memset(spbuf, 0, sizeof(spbuf)); - if (getservbyname_r(str, "udp", &se, spbuf, sizeof(spbuf), &sp) != 0) - sp = NULL; - } -#elif defined(HAVE_GETSERVBYNAME_R) && defined(AIX) - { - struct servent_data sed; - if ((sp == NULL) && ((proto == 0) || (proto == 't'))) { - memset(&sed, 0, sizeof(sed)); - if (getservbyname_r(str, "tcp", sp, &sed) != 0) - sp = NULL; - } - if ((sp == NULL) && ((proto == 0) || (proto == 'u'))) { - memset(&sed, 0, sizeof(sed)); - if (getservbyname_r(str, "udp", sp, &sed) != 0) - sp = NULL; - } - } -#else - /* Note: getservbyname is already threadsafe on: HP-UX, Tru64 */ - if ((sp == NULL) && ((proto == 0) || (proto == 't'))) { - sp = getservbyname(str, "tcp"); - } - if ((sp == NULL) && ((proto == 0) || (proto == 'u'))) { - sp = getservbyname(str, "udp"); - } -#endif - - if (sp != NULL) { - return ((unsigned int) ntohs((unsigned short) sp->s_port)); + error = 1; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + if ((error != 0) && ((proto == 0) || (proto == 't'))) { + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(NULL, str, &hints, &res); + } + if ((error != 0) && ((proto == 0) || (proto == 'u'))) { + hints.ai_socktype = SOCK_DGRAM; + error = getaddrinfo(NULL, str, &hints, &res); + } + if (error != 0) { + return (0); /* error */ + } + if (res->ai_addr->sa_family == AF_INET) { + port = ((struct sockaddr_in *)res->ai_addr)->sin_port; + } else if (res->ai_addr->sa_family == AF_INET6) { + port = ((struct sockaddr_in6 *)res->ai_addr)->sin6_port; + } else { + port = 0; /* error */ } - return (0); /* error */ + freeaddrinfo(res); + return ((unsigned int) ntohs((unsigned short) port)); } /* ServiceNameToPortNumber */ @@ -203,15 +186,13 @@ int -AddrStrToAddr(const char * const s, struct sockaddr_in * const sa, const int defaultport) +AddrStrToAddr(const char * const s, struct sockaddr * const sa, const int defaultport) { - char portstr[128]; - unsigned int ipnum; - unsigned int port; - struct hostent *hp; - char *hostcp, *atsign, *colon, *cp, *p2; + char portstr[128], portstr2[128]; + struct addrinfo hints, *res; + char *hostcp, *atsign, *colon, *cp, *p2, *portp; + int error; - memset(sa, 0, sizeof(struct sockaddr_in)); strncpy(portstr, s, sizeof(portstr)); portstr[sizeof(portstr) - 1] = '\0'; @@ -219,7 +200,6 @@ /* Does it look like a URL? http://host ? */ if ((colon[1] == '/') && (colon[2] == '/')) { *colon = '\0'; - port = 0; hostcp = colon + 3; for (cp = hostcp; *cp != '\0'; cp++) { if ((!ISALNUM(*cp)) && (*cp != '.')) { @@ -230,29 +210,27 @@ while (isdigit((int) *cp)) cp++; *cp = '\0'; - port = atoi(p2); } *cp = '\0'; break; } } - if (port == 0) - port = ServiceNameToPortNumber(portstr, 0); } else { /* Look for host.name.domain:port */ *colon = '\0'; hostcp = portstr; - port = (unsigned int) atoi(colon + 1); } + portp = portstr; } else if ((atsign = strchr(portstr, '@')) != NULL) { /* Look for port@host.name.domain */ *atsign = '\0'; hostcp = atsign + 1; - port = (unsigned int) atoi(portstr); + portp = portstr; } else if (defaultport > 0) { /* Have just host.name.domain, use that w/ default port. */ - port = (unsigned int) defaultport; + sprintf(portstr2, "%d", defaultport); hostcp = portstr; + portp = portstr2; } else { /* If defaultport <= 0, they must supply a port number * in the host/port string. @@ -261,24 +239,14 @@ return (kAddrStrToAddrMiscErr); } - sa->sin_port = htons((short) port); - - ipnum = inet_addr(hostcp); - if (ipnum != INADDR_NONE) { - sa->sin_family = AF_INET; - sa->sin_addr.s_addr = ipnum; - } else { - errno = 0; - hp = gethostbyname(hostcp); - if (hp == NULL) { - if (errno == 0) - errno = ENOENT; - return (kAddrStrToAddrBadHost); - } - sa->sin_family = hp->h_addrtype; - memcpy(&sa->sin_addr.s_addr, hp->h_addr_list[0], - (size_t) hp->h_length); - } + memset(&hints, 0, sizeof(hints)); + hints.ai_family = PF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + error = getaddrinfo(hostcp, portp, &hints, &res); + if (error != 0) + return (kAddrStrToAddrBadHost); + memcpy(sa, res->ai_addr, res->ai_addrlen); + freeaddrinfo(res); return (0); } /* AddrStrToAddr */ @@ -286,12 +254,12 @@ char * -AddrToAddrStr(char *const dst, size_t dsize, struct sockaddr_in * const saddrp, int dns, const char *fmt) +AddrToAddrStr(char *const dst, size_t dsize, struct sockaddr * const saddrp, int dns, const char *fmt) { char addrName[128]; char *addrNamePtr; - struct hostent *hp; - char str[128]; + char portName[128]; + char portNum[128]; char s_name[64]; char *dlim, *dp; const char *cp; @@ -300,19 +268,25 @@ return NULL; memset(dst, 0, dsize); - addrNamePtr = NULL; - if (dns == 0) { - InetNtoA(addrName, &saddrp->sin_addr, sizeof(addrName)); - addrNamePtr = addrName; - } else { - hp = gethostbyaddr((gethost_addrptr_t) &saddrp->sin_addr, sizeof(struct in_addr), AF_INET); - if ((hp != NULL) && (hp->h_name != NULL) && (hp->h_name[0] != '\0')) { - addrNamePtr = hp->h_name; - } else { - InetNtoA(addrName, &saddrp->sin_addr, sizeof(addrName)); - addrNamePtr = addrName; - } - } + addrNamePtr = addrName; + if (dns == 0) + dns = NI_NUMERICHOST; + else + dns = 0; + getnameinfo(saddrp, +#ifdef HAVE_SOCKADDR_SA_LEN + saddrp->sa_len, +#else + SA_LEN(saddrp), +#endif + addrName, sizeof(addrName), portName, sizeof(portName), dns); + getnameinfo(saddrp, +#ifdef HAVE_SOCKADDR_SA_LEN + saddrp->sa_len, +#else + SA_LEN(saddrp), +#endif + NULL, 0, portNum, sizeof(portNum), NI_NUMERICSERV); if (fmt == NULL) fmt = "%h:%p"; for (dp = dst, dlim = dp + dsize - 1; ; fmt++) { @@ -324,8 +298,7 @@ if (dp < dlim) *dp++ = '%'; } else if (*fmt == 'p') { - sprintf(str, "%u", (unsigned int) ntohs(saddrp->sin_port)); - for (cp = str; *cp != '\0'; cp++) + for (cp = portNum; *cp != '\0'; cp++) if (dp < dlim) *dp++ = *cp; *dp = '\0'; @@ -340,16 +313,20 @@ *dp++ = *cp; *dp = '\0'; } else if (*fmt == 's') { - cp = s_name; - (void) ServicePortNumberToName(ntohs(saddrp->sin_port), s_name, sizeof(s_name), 0); - for ( ; *cp != '\0'; cp++) + for (cp = portName ; *cp != '\0'; cp++) if (dp < dlim) *dp++ = *cp; /* endservent(); */ *dp = '\0'; } else if ((*fmt == 't') || (*fmt == 'u')) { cp = s_name; - (void) ServicePortNumberToName(ntohs(saddrp->sin_port), s_name, sizeof(s_name), (int) *fmt); + if (saddrp->sa_family == AF_INET) { + (void) ServicePortNumberToName(ntohs(((struct sockaddr_in *)saddrp)->sin_port), s_name, sizeof(s_name), (int) *fmt); + } else if (saddrp->sa_family == AF_INET6) { + (void) ServicePortNumberToName(ntohs(((struct sockaddr_in6 *)saddrp)->sin6_port), s_name, sizeof(s_name), (int) *fmt); + } else { + cp = '\0'; + } for ( ; *cp != '\0'; cp++) if (dp < dlim) *dp++ = *cp; @@ -376,16 +353,16 @@ AddrStrToIPStr(char *const dst, size_t dsize, const char *const src, const int defaultport) { int rc; - struct sockaddr_in sa; + struct sockaddr_storage ss; if (dsize == 0) return NULL; memset(dst, 0, dsize); - rc = AddrStrToAddr(src, &sa, (defaultport <= 0) ? 21 : defaultport); + rc = AddrStrToAddr(src, (struct sockaddr *)&ss, (defaultport <= 0) ? 21 : defaultport); if (rc < 0) return (NULL); - AddrToAddrStr(dst, dsize, &sa, 0, (defaultport <= 0) ? "%h" : "%h:%p"); + AddrToAddrStr(dst, dsize, (struct sockaddr *)&ss, 0, (defaultport <= 0) ? "%h" : "%h:%p"); return (dst); } /* AddrStrToIPStr */ Index: ncftp3/sio/sio.h diff -u ncftp3/sio/sio.h:1.1.1.10 ncftp3/sio/sio.h:1.14 --- ncftp3/sio/sio.h:1.1.1.10 Mon Aug 11 15:38:23 2008 +++ ncftp3/sio/sio.h Mon Aug 11 16:24:16 2008 @@ -197,7 +197,7 @@ int PWrite(int, const char *const, size_t); /* SAccept.c */ -int SAccept(int, struct sockaddr_in *const, int); +int SAccept(int, struct sockaddr *const, int); /* SBind.c */ int SBind(int, const int, const int, const int); @@ -208,7 +208,7 @@ int SClose(int, int); /* SConnect.c */ -int SConnect(int, const struct sockaddr_in *const, int); +int SConnect(int, const struct sockaddr *const, int); /* SConnectByName.c */ int SConnectByName(int, const char *const, const int); @@ -232,7 +232,7 @@ int SRecv(int, char *const, size_t, int, int, int); /* SRecvfrom.c */ -int SRecvfrom(int, char *const, size_t, int, struct sockaddr_in *const, int); +int SRecvfrom(int, char *const, size_t, int, struct sockaddr *const, int); /* SRecvmsg.c */ int SRecvmsg(int, void *const, int, int); @@ -248,8 +248,8 @@ int SSend(int, char *, size_t, int, int); /* SSendto.c */ -int SSendto(int, const char *const, size_t, int, const struct sockaddr_in *const, int); -int Sendto(int, const char *const, size_t, const struct sockaddr_in *const); +int SSendto(int, const char *const, size_t, int, const struct sockaddr *const, int); +int Sendto(int, const char *const, size_t, const struct sockaddr *const); /* SSendtoByName.c */ int SSendtoByName(int, const char *const, size_t, int, const char *const, int); @@ -280,8 +280,8 @@ unsigned int ServiceNameToPortNumber(const char *const s, const int proto); int ServicePortNumberToName(unsigned short port, char *const dst, const size_t dsize, const int proto); void InetNtoA(char *dst, struct in_addr *ia, size_t siz); -int AddrStrToAddr(const char *const, struct sockaddr_in *const, const int); -char *AddrToAddrStr(char *const dst, size_t dsize, struct sockaddr_in * const saddrp, int dns, const char *fmt); +int AddrStrToAddr(const char *const, struct sockaddr *const, const int); +char *AddrToAddrStr(char *const dst, size_t dsize, struct sockaddr * const saddrp, int dns, const char *fmt); char *AddrStrToIPStr(char *const dst, size_t dsize, const char *const src, const int defaultport); /* SError.c */ Index: ncftp3/sio/syshdrs.h diff -u ncftp3/sio/syshdrs.h:1.1.1.9 ncftp3/sio/syshdrs.h:1.10 --- ncftp3/sio/syshdrs.h:1.1.1.9 Mon Aug 11 15:38:23 2008 +++ ncftp3/sio/syshdrs.h Mon Aug 11 16:24:16 2008 @@ -20,6 +20,9 @@ # define WINVER 0x0400 # define _WIN32_WINNT 0x0400 # include <windows.h> /* includes <winsock2.h> if _WIN32_WINNT >= 0x400 */ +#ifdef ENABLE_IPV6 +# include <ws2tcpip.h> +#endif /* ENABLE_IPV6 */ # include <io.h> # include <errno.h> # include <stdio.h> Index: ncftp3/vis/syshdrs.h diff -u ncftp3/vis/syshdrs.h:1.1.1.10 ncftp3/vis/syshdrs.h:1.7 --- ncftp3/vis/syshdrs.h:1.1.1.10 Thu Nov 5 16:20:41 2009 +++ ncftp3/vis/syshdrs.h Thu Nov 5 16:47:09 2009 @@ -94,6 +94,9 @@ #include <time.h> #include <pwd.h> #include <fcntl.h> +#ifndef HAVE_GETADDRINFO +# include "addrinfo.h" +#endif #ifdef HAVE_LOCALE_H # include <locale.h>