summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r--lib/utils_base.c10
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 */
403char *_np_state_generate_key() { 404char *_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