diff options
author | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2021-10-13 16:33:03 +0300 |
---|---|---|
committer | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2021-10-13 16:36:29 +0300 |
commit | 51a325e869119896f9d921e27d9a187678d92e17 (patch) | |
tree | 08db8df409cb6743f1d906bf73b4cf6645b0ba6d /src/libs/zbxaudit/audit.h | |
parent | 26cf2029b2c2b5e702cd6336f89e935a39a3cfd1 (diff) |
........S. [ZBX-20077] fixed possible collision of audit entities for server in json
Diffstat (limited to 'src/libs/zbxaudit/audit.h')
-rw-r--r-- | src/libs/zbxaudit/audit.h | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/src/libs/zbxaudit/audit.h b/src/libs/zbxaudit/audit.h index 93b128f6643..63eaec2d3f6 100644 --- a/src/libs/zbxaudit/audit.h +++ b/src/libs/zbxaudit/audit.h @@ -49,6 +49,13 @@ #define AUDIT_RESOURCE_ITEM_PROTOTYPE 36 #define AUDIT_RESOURCE_HOST_PROTOTYPE 37 +#define AUDIT_HOST_ID 1 +#define AUDIT_HOSTGRP_ID 2 +#define AUDIT_ITEM_ID 3 +#define AUDIT_TRIGGER_ID 4 +#define AUDIT_GRAPH_ID 5 +#define AUDIT_HTTPTEST_ID 6 + #define RETURN_IF_AUDIT_OFF() \ if (ZBX_AUDITLOG_ENABLED != zbx_get_audit_mode()) \ return \ @@ -59,6 +66,7 @@ zbx_hashset_t *zbx_get_audit_hashset(void); typedef struct zbx_audit_entry { zbx_uint64_t id; + int id_table; char *name; struct zbx_json details_json; int audit_action; @@ -66,7 +74,8 @@ typedef struct zbx_audit_entry char audit_cuid[CUID_LEN]; } zbx_audit_entry_t; -zbx_audit_entry_t *zbx_audit_entry_init(zbx_uint64_t id, const char *name, int audit_action, int resource_type); +zbx_audit_entry_t *zbx_audit_entry_init(zbx_uint64_t id, const int id_table, const char *name, int audit_action, + int resource_type); int zbx_auditlog_global_script(unsigned char script_type, unsigned char script_execute_on, const char *script_command_orig, zbx_uint64_t hostid, const char *hostname, zbx_uint64_t eventid, @@ -75,22 +84,25 @@ int zbx_auditlog_global_script(unsigned char script_type, unsigned char script_e void zbx_audit_init(int audit_mode_set); void zbx_audit_flush(void); -void zbx_audit_update_json_append_string(const zbx_uint64_t id, const char *audit_op, const char *key, - const char *value, const char *table, const char *field); -void zbx_audit_update_json_append_string_secret(const zbx_uint64_t id, const char *audit_op, const char *key, - const char *value, const char *table, const char *field); -void zbx_audit_update_json_append_uint64(const zbx_uint64_t id, const char *audit_op, const char *key, - uint64_t value, const char *table, const char *field); -void zbx_audit_update_json_append_no_value(const zbx_uint64_t id, const char *audit_op, const char *key); -void zbx_audit_update_json_append_int(const zbx_uint64_t id, const char *audit_op, const char *key, int value, - const char *table, const char *field); -void zbx_audit_update_json_append_double(const zbx_uint64_t id, const char *audit_op, const char *key, double value, - const char *table, const char *field); -void zbx_audit_update_json_update_string(const zbx_uint64_t id, const char *key, const char *value_old, - const char *value_new); -void zbx_audit_update_json_update_uint64(const zbx_uint64_t id, const char *key, uint64_t value_old, - uint64_t value_new); -void zbx_audit_update_json_update_int(const zbx_uint64_t id, const char *key, int value_old, int value_new); -void zbx_audit_update_json_update_double(const zbx_uint64_t id, const char *key, double value_old, double value_new); -void zbx_audit_update_json_delete(const zbx_uint64_t id, const char *audit_op, const char *key); +void zbx_audit_update_json_append_string(const zbx_uint64_t id, const int id_table, const char *audit_op, + const char *key, const char *value, const char *table, const char *field); +void zbx_audit_update_json_append_string_secret(const zbx_uint64_t id, const int id_table, const char *audit_op, + const char *key, const char *value, const char *table, const char *field); +void zbx_audit_update_json_append_uint64(const zbx_uint64_t id, const int id_table, const char *audit_op, + const char *key, uint64_t value, const char *table, const char *field); +void zbx_audit_update_json_append_no_value(const zbx_uint64_t id, const int id_table, const char *audit_op, + const char *key); +void zbx_audit_update_json_append_int(const zbx_uint64_t id, const int id_table, const char *audit_op, + const char *key, int value, const char *table, const char *field); +void zbx_audit_update_json_append_double(const zbx_uint64_t id, const int id_table, const char *audit_op, + const char *key, double value, const char *table, const char *field); +void zbx_audit_update_json_update_string(const zbx_uint64_t id, const int id_table, const char *key, + const char *value_old, const char *value_new); +void zbx_audit_update_json_update_uint64(const zbx_uint64_t id, const int id_table, const char *key, + uint64_t value_old, uint64_t value_new); +void zbx_audit_update_json_update_int(const zbx_uint64_t id, const int id_table, const char *key, int value_old, + int value_new); +void zbx_audit_update_json_update_double(const zbx_uint64_t id, const int id_table, const char *key, + double value_old, double value_new); +void zbx_audit_update_json_delete(const zbx_uint64_t id, const int id_table, const char *audit_op, const char *key); #endif /* ZABBIX_AUDIT_H */ |