Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-66172

"host" utility doesn't always convert hostname argument into ACE string

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.4
    • bind
    • None
    • No
    • Moderate
    • Upstream
    • rhel-sst-cs-net-perf-services
    • ssg_core_services
    • 2
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      Resolving a hostname using host command works when having a TTY:

      # host www.tribunal-fédéral.ch
      www.tribunal-fédéral.ch is an alias for bnetm.x.incapdns.net.
      bnetm.x.incapdns.net has address 107.154.115.41
      

      But it fails when not having a TTY, e.g.:

      1. With piping the output
        # host www.tribunal-fédéral.ch | cat
        Host www.tribunal-fédéral.ch not found: 3(NXDOMAIN)
        
      2. As a service
        # systemd-run host www.tribunal-fédéral.ch
        Running as unit: run-r91b04b09794d4250884722ff003b9470.service
        # journalctl -u run-r91b04b09794d4250884722ff003b9470.service
        Nov 06 15:34:53 vm-host9 systemd[1]: Started /usr/bin/host -4 -T www.tribunal-fédéral.ch.
        Nov 06 15:34:53 vm-host9 host[33165]: Host www.tribunal-fédéral.ch not found: 3(NXDOMAIN)
      3. As a cron
        # crontab -e
        * * * * * host www.tribunal-fédéral.ch >/tmp/host.out
        # sleep 60; cat /tmp/host.out
        Host www.tribunal-fédéral.ch not found: 3(NXDOMAIN)
        

      The reason for this is ACE conversion is performed only when having a TTY (line 674), which is wrong:

       673 #ifdef HAVE_LIBIDN2
       674         looknew->idnin = isatty(1) ? (getenv("IDN_DISABLE") == NULL) : false;
      
      2133 #ifdef HAVE_LIBIDN2
      2134         if (lookup->idnin) {
      2135                 idn_locale_to_ace(textname, idn_textname, sizeof(idn_textname));
      2136                 debug("idn_textname: %s", idn_textname);
      2137                 textname = idn_textname;
      2138         }
      

      What is the impact of this issue to you?

      Cannot perform queries of internationalized domains programmatically

      Please provide the package NVR for which the bug is seen:

      bind-utils-9.16.23-18.el9_4.6
      bind-utils-9.18.28-2.fc40.x86_64 (Fedora 40)

      How reproducible is this bug?:

      Always, see above.

              pemensik@redhat.com Petr Mensik
              rhn-support-rmetrich Renaud Métrich
              Petr Mensik Petr Mensik
              rhel-cs-infra-services-qe rhel-cs-infra-services-qe rhel-cs-infra-services-qe rhel-cs-infra-services-qe
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: