diff options
author | Lorenz <12514511+RincewindsHat@users.noreply.github.com> | 2023-03-10 10:33:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-10 10:33:25 (GMT) |
commit | 5077120a251980b4fafed61b4aa8fa5730a85443 (patch) | |
tree | 8500b8f5dbe774b399cfdc79f5665ba88ef7f255 /lib/utils_base.c | |
parent | a3de84594104ac87a91e200d569fb57edacca928 (diff) | |
parent | 269718094177fb8a7e3d3005d1310495009fe8c4 (diff) | |
download | monitoring-plugins-5077120a251980b4fafed61b4aa8fa5730a85443.tar.gz |
Merge branch 'master' into master
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r-- | lib/utils_base.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index fd7058d..eb1823b 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -128,6 +128,7 @@ range | |||
128 | temp_range->end = 0; | 128 | temp_range->end = 0; |
129 | temp_range->end_infinity = TRUE; | 129 | temp_range->end_infinity = TRUE; |
130 | temp_range->alert_on = OUTSIDE; | 130 | temp_range->alert_on = OUTSIDE; |
131 | temp_range->text = strdup(str); | ||
131 | 132 | ||
132 | if (str[0] == '@') { | 133 | if (str[0] == '@') { |
133 | temp_range->alert_on = INSIDE; | 134 | temp_range->alert_on = INSIDE; |
@@ -401,20 +402,20 @@ int mp_translate_state (char *state_text) { | |||
401 | * parse of argv, so that uniqueness in parameters are reflected there. | 402 | * parse of argv, so that uniqueness in parameters are reflected there. |
402 | */ | 403 | */ |
403 | char *_np_state_generate_key() { | 404 | char *_np_state_generate_key() { |
404 | struct sha1_ctx ctx; | 405 | struct sha256_ctx ctx; |
405 | int i; | 406 | int i; |
406 | char **argv = this_monitoring_plugin->argv; | 407 | char **argv = this_monitoring_plugin->argv; |
407 | unsigned char result[20]; | 408 | unsigned char result[20]; |
408 | char keyname[41]; | 409 | char keyname[41]; |
409 | char *p=NULL; | 410 | char *p=NULL; |
410 | 411 | ||
411 | sha1_init_ctx(&ctx); | 412 | sha256_init_ctx(&ctx); |
412 | 413 | ||
413 | for(i=0; i<this_monitoring_plugin->argc; i++) { | 414 | for(i=0; i<this_monitoring_plugin->argc; i++) { |
414 | sha1_process_bytes(argv[i], strlen(argv[i]), &ctx); | 415 | sha256_process_bytes(argv[i], strlen(argv[i]), &ctx); |
415 | } | 416 | } |
416 | 417 | ||
417 | sha1_finish_ctx(&ctx, &result); | 418 | sha256_finish_ctx(&ctx, &result); |
418 | 419 | ||
419 | for (i=0; i<20; ++i) { | 420 | for (i=0; i<20; ++i) { |
420 | sprintf(&keyname[2*i], "%02x", result[i]); | 421 | sprintf(&keyname[2*i], "%02x", result[i]); |
@@ -706,4 +707,3 @@ void np_state_write_string(time_t data_time, char *data_string) { | |||
706 | 707 | ||
707 | np_free(temp_file); | 708 | np_free(temp_file); |
708 | } | 709 | } |
709 | |||