Steps to reproduce:
- Follow install instructions for Ubuntu 20.04 on Zabbix Downloads
- Navigate to frontend for installation setup
- On final screen, you will get an error stating the configuration file cannot be created
See attached screenshot.
The reason the configuration file creation now fails is because with the package setup:
- `/etc/zabbix/web` is owned by www-data (so writable by php-fpm)
- `/usr/share/zabbix/conf/zabbix.conf.php` is a dead symlink prior to setup that points to `/etc/zabbix/web/zabbix.conf.php`
- the CConfigFile.php attempts to write to `/usr/share/zabbix/conf/zabbix.conf.php`
- the commit below changed the logic for evaluating whether the file is writable
$file_is_writable variable has been modified to have a check on whether the dirname itself is writable:
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.