From: Petr Menšík Date: Wed, 6 Dec 2017 16:12:44 +0000 (+0100) Subject: Remove support for libidn (IDN 2003) X-Git-Tag: v9.13.0~89^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8254cf69d34947713c99839dd5139f326d8e5d43;p=thirdparty%2Fbind9.git Remove support for libidn (IDN 2003) Signed-off-by: Petr Menšík --- diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in index 0545902ebb7..3531c9b6c26 100644 --- a/bin/dig/Makefile.in +++ b/bin/dig/Makefile.in @@ -41,10 +41,10 @@ DEPLIBS = ${DNSDEPLIBS} ${IRSDEPLIBS} ${BIND9DEPLIBS} \ ${ISCDEPLIBS} ${ISCCFGDEPLIBS} LIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \ - ${ISCLIBS} @IDNKIT_LIBS@ @LIBIDN_LIBS@ @LIBIDN2_LIBS@ @LIBS@ + ${ISCLIBS} @IDNKIT_LIBS@ @LIBIDN2_LIBS@ @LIBS@ NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \ - ${ISCNOSYMLIBS} @IDNKIT_LIBS@ @LIBIDN_LIBS@ @LIBIDN2_LIBS@ @LIBS@ + ${ISCNOSYMLIBS} @IDNKIT_LIBS@ @LIBIDN2_LIBS@ @LIBS@ SUBDIRS = diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index efa8b49e365..b122a37f375 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -38,11 +38,6 @@ #include #endif -#ifdef WITH_LIBIDN -#include -#include -#endif - #ifdef WITH_LIBIDN2 #include #endif @@ -4376,77 +4371,6 @@ idn_ace_to_locale(const char *from, char *to, size_t tolen) { } #endif /* WITH_IDNKIT */ -#ifdef WITH_LIBIDN -static isc_result_t -idn_locale_to_ace(const char *from, char *to, size_t tolen) { - isc_result_t result = ISC_R_FAILURE; - int res; - char *tmp_str = NULL; - char *ace_str = NULL; - - tmp_str = stringprep_locale_to_utf8(from); - - if (tmp_str != NULL) { - if (strlen(tmp_str) >= tolen) { - debug("UTF-8 string is too long"); - free(tmp_str); - return ISC_R_NOSPACE; - } - } - else - return ISC_R_FAILURE; - - res = idna_to_ascii_8z(tmp_str, &ace_str, 0); - if (res == IDNA_SUCCESS) { - /* check the length */ - if (strlen(tmp_str) >= tolen) { - debug("encoded ASC string is too long"); - result = ISC_R_NOSPACE; - } else { - (void) strncpy(to, ace_str, tolen); - result = ISC_R_SUCCESS; - } - } - - free(tmp_str); - free(ace_str); - if (res != IDNA_SUCCESS) { - fatal("idna_to_ascii_8z failed: %s", idna_strerror(res)); - } - return (result); -} - -static isc_result_t -idn_ace_to_locale(const char *from, char *to, size_t tolen) { - int res; - isc_result_t result; - char *tmp_str = NULL; - - res = idna_to_unicode_8zlz(from, &tmp_str, 0); - - if (res == IDNA_SUCCESS) { - /* check the length */ - if (strlen(tmp_str) >= tolen) { - debug("decoded locale string is too long"); - result = ISC_R_FAILURE; - goto cleanup; - } - - (void) strncpy(to, tmp_str, tolen); - - result = ISC_R_SUCCESS; - } else { - debug("idna_to_unicode_8z8l failed: %s", - idna_strerror(res)); - result = ISC_R_FAILURE; - } - -cleanup: - free(tmp_str); - return (result); -} -#endif /* WITH_LIBIDN */ - #ifdef WITH_LIBIDN2 static isc_result_t idn_locale_to_ace(const char *from, char *to, size_t tolen) { diff --git a/configure.in b/configure.in index 79624651514..dacc693b17b 100644 --- a/configure.in +++ b/configure.in @@ -4773,36 +4773,6 @@ if test "no" != "$use_idnkit"; then fi AC_SUBST(IDNKIT_LIBS) -# -# IDN support using libidn -# -LIBIDN_LIBS= -AC_ARG_WITH(libidn, - AS_HELP_STRING([--with-libidn[=PATH]], [enable IDN support using GNU libidn [yes|no|path]]), - use_libidn="$withval", use_libidn="no") -case "$use_libidn" in -yes) - if test X$prefix = XNONE ; then - libidn_path=/usr/local - else - libidn_path=$prefix - fi - LIBIDN_LIBS="-lidn" - ;; -no) - ;; -*) - LIBIDN_LIBS="-L$use_libidn/lib -lidn" - libidn_path="$use_libidn" - ;; -esac - -if test "$use_libidn" != no; then - AC_DEFINE(WITH_LIBIDN, 1, [define if libidn support is to be included.]) - STD_CINCLUDES="$STD_CINCLUDES -I$libidn_path/include" -fi -AC_SUBST(LIBIDN_LIBS) - # # IDN support using libidn2 # @@ -4855,19 +4825,12 @@ AC_SUBST(LIBIDN2_LIBS) # IDN support in general # -# check if idnkit, libidn and libidn2 are not used at the same time -if test "$use_idnkit" != no && test "$use_libidn" != no; then - AC_MSG_ERROR([idnkit and libidn cannot be used at the same time.]) -fi +# check if idnkit and libidn2 are not used at the same time if test "$use_idnkit" != no && test "$use_libidn2" != no; then AC_MSG_ERROR([idnkit and libidn2 cannot be used at the same time.]) fi -if test "$use_libidn" != no && test "$use_libidn2" != no; then - AC_MSG_ERROR([libidn and libidn2 cannot be used at the same time.]) -fi - # the IDN support is on -if test "$use_idnkit" != no || test "$use_libidn" != no || test "$use_libidn2" != no; then +if test "$use_idnkit" != no || test "$use_libidn2" != no; then AC_DEFINE(WITH_IDN_SUPPORT, 1, [define if IDN input support is to be included.]) if test "$use_libidn2" = no || test "$use_libidn2_out" != no; then AC_DEFINE(WITH_IDN_OUT_SUPPORT, 1, [define if IDN output support is to be included.])