-
Type:
Problem report
-
Resolution: Unresolved
-
Priority:
Major
-
Affects Version/s: 8.0.0rc3
-
Component/s: Server (S)
-
None
-
Prev.Sprint, S26-W44/45
-
0.125
op_host_enable() in src/zabbix_server/operations/operations.c:1272 passes the wrong value to the WHERE clause of its update. It passes the h->status where the h->hostid must be:
if (HOST_STATUS_MONITORED != h->status)
{
zbx_db_execute("update hosts"
" set status=%d"
" where hostid=" ZBX_FS_UI64,
HOST_STATUS_MONITORED, h->status);
Impact:
- Host stays disabled: the "Enable host" operation has no effect on the discovered or autoregistered host, so it is not monitored.
- Wrong host can be changed: if a host with hostid=1 exists, it is enabled instead. If not, the update affects 0 rows and no error is reported.
- Misleading audit log: zbx_audit_host_update_json_update_host_status() runs with the correct h->hostid, so the audit log shows the host as enabled when it wasn't.
Steps to reproduce:
1. Create a host through network discovery or autoregistration, then disable it.
2. Configure a discovery or autoregistration action with the "Enable host" operation.
3. Trigger the action, for example by restarting the agent so it autoregisters again.
Expected result: the host's status becomes Enabled (hosts.status=0).
- caused by
-
ZBX-26621 Autoregistration with PSK not applied on existing host
-
- Closed
-