diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2023-07-12 21:08:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-12 21:08:44 +0300 |
commit | b61ddad5e631fe0fedd11ff835a642a42d5d71b8 (patch) | |
tree | 8a4e439af433cf83271b1d0be16d0a4a388255b4 /health/health.c | |
parent | 1fb7aeddcc5a85d458bcbd3a20d7b0b2939e3cfe (diff) |
agent alert notifications redirect (#15350)
* agent alert notifications redirect
* set the same cookies with SameSite: Strict
* registry search now requires only "for" parameter
* registry responses are not cacheable
* fix typo and add more error checking
* registry memory when mmap is used
* fix free with aral
Diffstat (limited to 'health/health.c')
-rw-r--r-- | health/health.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/health/health.c b/health/health.c index 4ae7e99974..c39677e250 100644 --- a/health/health.c +++ b/health/health.c @@ -81,8 +81,9 @@ static bool prepare_command(BUFFER *wb, const char *crit_alarms, const char *classification, const char *edit_command, - const char *machine_guid) -{ + const char *machine_guid, + uuid_t *transition_id +) { char buf[8192]; size_t n = 8192 - 1; @@ -188,6 +189,12 @@ static bool prepare_command(BUFFER *wb, return false; buffer_sprintf(wb, " '%s'", buf); + char tr_id[UUID_STR_LEN]; + uuid_unparse_lower(*transition_id, tr_id); + if (!sanitize_command_argument_string(buf, tr_id, n)) + return false; + buffer_sprintf(wb, " '%s'", buf); + return true; } @@ -575,7 +582,8 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) { buffer_tostring(crit_alarms), ae->classification?ae_classification(ae):"Unknown", edit_command, - host != localhost ? host->machine_guid:""); + host->machine_guid, + &ae->transition_id); const char *command_to_run = buffer_tostring(wb); if (ok) { |