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

Changes to CConfigFile.php in 5.4.2 break package installation flow/setup

XMLWordPrintable

    • Sprint 78 (Jul 2021)
    • 0.5

      Steps to reproduce:

      1. Follow install instructions for Ubuntu 20.04 on Zabbix Downloads
      2. Navigate to frontend for installation setup
      3. On final screen, you will get an error stating the configuration file cannot be created

      Result:**

      See attached screenshot.

       

      The reason the configuration file creation now fails is because with the package setup:

       

      1. `/etc/zabbix/web` is owned by www-data (so writable by php-fpm)
      2. `/usr/share/zabbix/conf/zabbix.conf.php` is a dead symlink prior to setup that points  to `/etc/zabbix/web/zabbix.conf.php`
      3. the CConfigFile.php attempts to write to `/usr/share/zabbix/conf/zabbix.conf.php`
      4. the commit below changed the logic for evaluating whether the file is writable

      https://git.zabbix.com/projects/ZBX/repos/zabbix/diff/ui/include/classes/core/CConfigFile.php?until=3c7e1f69667321219d3b6b758ebc6d03add2dffa

      $file_is_writable variable has been modified to have a check on whether the dirname itself is writable:

      is_writable(dirname($file))

      The value of $file is /usr/share/zabbix/conf/zabbix.conf.php.

      This checks whether the dir /usr/share/zabbix/conf is writable, which it is not (owned by root). 

      The fix is probably something along the lines of using is_link and readlink to determine the TRUE path.

       

      if is_link($file) {
        $file = readlink($file)
      }

       

            yurii Jurijs Klopovskis
            rcousens Ross Cousens
            Team B
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: