@cryptotaxi247 / netdata-1 / commits / d6f3937b4

Revert "MGMT_fixes change functions (#6242)"

This reverts commit 083378203c405665092f358e5f356f2afbb2ca15. --- As agreed with @thiago and @cakrit we revert URL parser changes, to buy the time on a more detailed investigation ---

Pavlos Emm. Katsoulakis committed Jun 7, 2019 at 18:14 UTC d6f3937b4d4bffedb8a8cc61f80affde7f17b180
1 file changed +6 -6
web/api/health/health_cmdapi.c
+6 -6
@@ -87,7 +87,7 @@ int web_client_api_request_v1_mgmt_health(RRDHOST *host, struct web_client *w, c
87 debug(D_WEB_CLIENT, "%llu: API v1 health query param '%s' with value '%s'", w->id, key, value);
88
89 // name and value are now the parameters
90 - if (!strcmp(key, "cmd")) {
90 + if (!strncmp(key, "cmd",lkey)) {
91 if (!strcmp(value, HEALTH_CMDAPI_CMD_SILENCEALL)) {
92 silencers->all_alarms = 1;
93 silencers->stype = STYPE_SILENCE_NOTIFICATIONS;
@@ -124,19 +124,19 @@ int web_client_api_request_v1_mgmt_health(RRDHOST *host, struct web_client *w, c
124 }
125 }
126
127 - if (hash == hash_alarm && !strcasecmp(key, HEALTH_ALARM_KEY)) {
127 + if (hash == hash_alarm && !strncasecmp(key, HEALTH_ALARM_KEY,lkey)) {
128 silencer->alarms = strdupz(value);
129 silencer->alarms_pattern = simple_pattern_create(silencer->alarms, NULL, SIMPLE_PATTERN_EXACT);
130 - } else if (hash == hash_chart && !strcasecmp(key, HEALTH_CHART_KEY)) {
130 + } else if (hash == hash_chart && !strncasecmp(key, HEALTH_CHART_KEY,lkey)) {
131 silencer->charts = strdupz(value);
132 silencer->charts_pattern = simple_pattern_create(silencer->charts, NULL, SIMPLE_PATTERN_EXACT);
133 - } else if (hash == hash_context && !strcasecmp(key, HEALTH_CONTEXT_KEY)) {
133 + } else if (hash == hash_context && !strncasecmp(key, HEALTH_CONTEXT_KEY,lkey)) {
134 silencer->contexts = strdupz(value);
135 silencer->contexts_pattern = simple_pattern_create(silencer->contexts, NULL, SIMPLE_PATTERN_EXACT);
136 - } else if (hash == hash_host && !strcasecmp(key, HEALTH_HOST_KEY)) {
136 + } else if (hash == hash_host && !strncasecmp(key, HEALTH_HOST_KEY,lkey)) {
137 silencer->hosts = strdupz(value);
138 silencer->hosts_pattern = simple_pattern_create(silencer->hosts, NULL, SIMPLE_PATTERN_EXACT);
139 - } else if (hash == hash_families && !strcasecmp(key, HEALTH_FAMILIES_KEY)) {
139 + } else if (hash == hash_families && !strncasecmp(key, HEALTH_FAMILIES_KEY,lkey)) {
140 silencer->families = strdupz(value);
141 silencer->families_pattern = simple_pattern_create(silencer->families, NULL, SIMPLE_PATTERN_EXACT);
142 } else {