-
Incident report
-
Resolution: Fixed
-
Trivial
-
2.5.0
In file src/zabbix_server/escalator/escalator.c there is a function execute_commands() with code:
result = DBselect( "select distinct h.hostid,h.host,o.type,o.scriptid,o.execute_on,o.port" ",o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command" #ifdef HAVE_OPENIPMI ",h.ipmi_authtype,h.ipmi_privilege,h.ipmi_username,h.ipmi_password" #endif " from opcommand o,opcommand_grp og,hosts_groups hg,hosts h" " where o.operationid=og.operationid" " and og.groupid=hg.groupid" " and hg.hostid=h.hostid" " and o.operationid=" ZBX_FS_UI64 " and h.status=%d" " union " "select distinct h.hostid,h.host,o.type,o.scriptid,o.execute_on,o.port" ",o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command" #ifdef HAVE_OPENIPMI ",h.ipmi_authtype,h.ipmi_privilege,h.ipmi_username,h.ipmi_password" #endif " from opcommand o,opcommand_hst oh,hosts h" " where o.operationid=oh.operationid" " and oh.hostid=h.hostid" " and o.operationid=" ZBX_FS_UI64 " and h.status=%d" " union " "select distinct 0,null,o.type,o.scriptid,o.execute_on,o.port" ",o.authtype,o.username,o.password,o.publickey,o.privatekey,o.command" #ifdef HAVE_OPENIPMI ",0,2,null,null" #endif " from opcommand o,opcommand_hst oh" " where o.operationid=oh.operationid" " and o.operationid=" ZBX_FS_UI64 " and oh.hostid is null", operationid, HOST_STATUS_MONITORED, operationid, HOST_STATUS_MONITORED, operationid);
DBselect() is defined as macro.
Compiler (GCC 5.1.1) issues warnings:
escalator.c: In function ‘execute_commands’: escalator.c:469:1: warning: embedding a directive within macro arguments is not portable #ifdef HAVE_OPENIPMI escalator.c:471:1: warning: embedding a directive within macro arguments is not portable #endif escalator.c:481:1: warning: embedding a directive within macro arguments is not portable #ifdef HAVE_OPENIPMI escalator.c:483:1: warning: embedding a directive within macro arguments is not portable #endif escalator.c:492:1: warning: embedding a directive within macro arguments is not portable #ifdef HAVE_OPENIPMI escalator.c:494:1: warning: embedding a directive within macro arguments is not portable #endif