[ZBX-16341] Rename config.h to avoid conflicts with loadable modules using Autotools Created: 2019 Jul 04  Updated: 2020 May 04

Status: Open
Project: ZABBIX BUGS AND ISSUES
Component/s: Installation (I)
Affects Version/s: 4.4.0alpha1
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Glebs Ivanovskis Assignee: Zabbix Development Team
Resolution: Unresolved Votes: 2
Labels: autoconf, codequality, headers, loadablemodule
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As discussed in ZBX-10428, Zabbix does not provide binary compatibility guarantees between Zabbix daemons and loadable modules, mandating compilation of loadable modules from source by every user who wants to use them. This means that a lot of relatively inexperienced people (non-developers at very least) will be busy with compilation.

Zabbix uses Autotools and exposes automatically generated config.h header in module interface. I.e. before using Zabbix header files (module.h and sysinc.h) one needs to run ./configure script of Zabbix, more on that in ZBX-15677. If user compiling loadable module forgets to ./configure Zabbix, he/she will fail to compile module because of missing config.h header.

Or even worse, user may succeed compiling module, because like suggested in ZBX-11767, many loadable modules use Autotools and have their own auto-generated config.h files. sysinc.h of Zabbix will happily include any config.h available in include path, even if it's not a config.h of Zabbix. Such thing can happen and is quite tricky to troubleshoot.

A solution would be to name auto-generated header of Zabbix differently (e.g. zbxconfig.h) using AC_CONFIG_HEADERS autoconf macro. This will make sure that loadable module compilation always fails when ./configure wasn't executed.



 Comments   
Comment by Glebs Ivanovskis [ 2019 Oct 03 ]

One more example.

Comment by Glebs Ivanovskis [ 2020 May 04 ]

Here is one more example.

Generated at Fri Mar 14 16:14:20 EET 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.