Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-31323

skip-name-resolve=off performs ip_to_hostname lookups on IP based hosts.

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4.29
    • 10.4, 10.5, 10.6
    • Server
    • None

    Description

      From serg

      The server already has checks like

            if (opt_skip_name_resolve &&
                hostname_requires_resolving(host.host.hostname))
            {
              sql_print_warning("'host' entry '%s|%s' "
                              "ignored in --skip-name-resolve mode.",
                               safe_str(host.host.hostname),
                               safe_str(host.db));
              continue;
            }
      

      But ip_to_hostname() is called like

        if (!opt_skip_name_resolve)
        {
          int rc;
       
          rc = ip_to_hostname(addr,
            thd->main_security_ctx.ip,
            &thd->main_security_ctx.host,
            host_errors);
      

      Why not to make it to be, like

      if (!opt_skip_name_resove && there_are_hostnames_requiring_resolving)
      {
        ...
      

      seems to be an easy thing to do. Then you can enable name resolution by default but it still won't do anything unless there's at least user entry that actually needs it. (edited)

      caveat, need to check if enabling name resolution has any visible effects. Like, whether the hostname is shown in logs or in USER() whatever. if it does, you cannot just automatically skip it as above, but then we can add name-resolution=auto mode and make that the default.

      Attachments

        Activity

          People

            danblack Daniel Black
            danblack Daniel Black
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.