Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-23002

Zabbix agents do not fail when user configures items with non-existing encodings

    XMLWordPrintable

Details

    • Problem report
    • Resolution: Fixed
    • Trivial
    • 7.0.0alpha4, 7.0 (plan)
    • 7.0.0alpha2
    • Agent (G)
    • None
    • Team C
    • Sprint 101 (Jun 2023), Sprint 102 (Jul 2023), Sprint 103 (Aug 2023)
    • 0.5

    Description

      Various items that work with text allow the user to specify the encoding, so that agent could convert it to UTF-8 first to uniformly process this text line-by-line.
      If user makes an error and specifies an item with non-existing encoding like:

      vfs.file.contents[/home/zabbix/files_encodings/hosts,BADGER_3923]
      

      then iconv library will detect that this encoding is invalid, but Zabbix will ignore this error and simply return the text as it was already converted:

      zbx_convert_to_utf8()
      ...
              if ('\0' == *encoding || (iconv_t)-1 == (cd = iconv_open(to_code, encoding)))
              {
                      res = cd;
                      memcpy(out, in, in_size);
                      out[in_size] = '\0';
                      return out;
              }
      

      Same is for agent 2.

      This would result zabbix treating lets say UTF-16 text as UTF-8.
      Of course this would lead to various undesired behaviours.

      Zabbix agents must not ignore the iconv_open() function -1 error code and make an item unsupported.

      Issue was raised in ZBX-21547 , check subissues 1 and 4

      Attachments

        Issue Links

          Activity

            People

              arimdjonoks Artjoms Rimdjonoks
              arimdjonoks Artjoms Rimdjonoks
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: