Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-3906

[PATCH] Not filtering # in /etc/hosts - r11648

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Professional Edition
    • Poller
    • None

    Description

      Commit r11648 fails to skip:

      #192.168.99.209 host.example.com

      in /etc/hosts

       

      patch:

      *no* further _formatting_ is done here

      root@observium:/opt/observium# svn diff ./includes/common.inc.php
      Index: includes/common.inc.php
      ===================================================================
      — includes/common.inc.php (revision 11654)
      +++ includes/common.inc.php (working copy)
      @@ -3569,6 +3569,8 @@

      //print_vars($d);
      $ip = array_shift($d);
      + if (safe_empty($ip) || str_starts($ip, '#')) { continue; } // skip empty and comments
      +
      $hosts = array_map('strtolower', $d);
      if (in_array($host, $hosts, TRUE)) {
      if ((is_flag_set(OBS_DNS_A, $flags) && str_contains($ip, '.')) ||

      Attachments

        Activity

          People

            landy Mike Stupalov
            pnlarsson Niklas Larsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: