From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/420256-check_snmp_64bit_fix.diff | 155 +++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 web/attachments/420256-check_snmp_64bit_fix.diff (limited to 'web/attachments/420256-check_snmp_64bit_fix.diff') diff --git a/web/attachments/420256-check_snmp_64bit_fix.diff b/web/attachments/420256-check_snmp_64bit_fix.diff new file mode 100644 index 0000000..78bf767 --- /dev/null +++ b/web/attachments/420256-check_snmp_64bit_fix.diff @@ -0,0 +1,155 @@ +*** check_snmp.c Thu Aug 4 14:33:54 2011 +--- check_snmp_64bit_fix.c Thu Aug 4 14:17:49 2011 +*************** +*** 85,91 **** + + int process_arguments (int, char **); + int validate_arguments (void); +! char *thisarg (char *str); + char *nextarg (char *str); + void print_usage (void); + void print_help (void); +--- 85,91 ---- + + int process_arguments (int, char **); + int validate_arguments (void); +! char *trimstring (char *str); + char *nextarg (char *str); + void print_usage (void); + void print_help (void); +*************** +*** 180,187 **** + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + +! labels = malloc (labels_size); +! unitv = malloc (unitv_size); + for (i = 0; i < MAX_OIDS; i++) + eval_method[i] = CHECK_UNDEF; + +--- 180,187 ---- + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + +! labels = malloc (sizeof(char *) * labels_size); +! unitv = malloc (sizeof(char *) * unitv_size); + for (i = 0; i < MAX_OIDS; i++) + eval_method[i] = CHECK_UNDEF; + +*************** +*** 737,760 **** + nlabels++; + if (nlabels >= labels_size) { + labels_size += 8; +! labels = realloc (labels, labels_size); + if (labels == NULL) + die (STATE_UNKNOWN, _("Could not reallocate labels[%d]"), (int)nlabels); + } +! labels[nlabels - 1] = optarg; +! ptr = thisarg (optarg); + labels[nlabels - 1] = ptr; + if (strstr (ptr, "'") == ptr) + labels[nlabels - 1] = ptr + 1; + while (ptr && (ptr = nextarg (ptr))) { + if (nlabels >= labels_size) { + labels_size += 8; +! labels = realloc (labels, labels_size); + if (labels == NULL) + die (STATE_UNKNOWN, _("Could not reallocate labels\n")); + } + labels++; +! ptr = thisarg (ptr); + if (strstr (ptr, "'") == ptr) + labels[nlabels - 1] = ptr + 1; + else +--- 738,760 ---- + nlabels++; + if (nlabels >= labels_size) { + labels_size += 8; +! labels = realloc (labels, sizeof(char *) * labels_size); + if (labels == NULL) + die (STATE_UNKNOWN, _("Could not reallocate labels[%d]"), (int)nlabels); + } +! ptr = trimstring (optarg); + labels[nlabels - 1] = ptr; + if (strstr (ptr, "'") == ptr) + labels[nlabels - 1] = ptr + 1; + while (ptr && (ptr = nextarg (ptr))) { + if (nlabels >= labels_size) { + labels_size += 8; +! labels = realloc (labels, sizeof(char *) * labels_size); + if (labels == NULL) + die (STATE_UNKNOWN, _("Could not reallocate labels\n")); + } + labels++; +! ptr = trimstring (ptr); + if (strstr (ptr, "'") == ptr) + labels[nlabels - 1] = ptr + 1; + else +*************** +*** 766,789 **** + nunits++; + if (nunits >= unitv_size) { + unitv_size += 8; +! unitv = realloc (unitv, unitv_size); + if (unitv == NULL) + die (STATE_UNKNOWN, _("Could not reallocate units [%d]\n"), (int)nunits); + } +! unitv[nunits - 1] = optarg; +! ptr = thisarg (optarg); + unitv[nunits - 1] = ptr; + if (strstr (ptr, "'") == ptr) + unitv[nunits - 1] = ptr + 1; + while (ptr && (ptr = nextarg (ptr))) { + if (nunits >= unitv_size) { + unitv_size += 8; +! unitv = realloc (unitv, unitv_size); + if (units == NULL) + die (STATE_UNKNOWN, _("Could not realloc() units\n")); + } + nunits++; +! ptr = thisarg (ptr); + if (strstr (ptr, "'") == ptr) + unitv[nunits - 1] = ptr + 1; + else +--- 766,788 ---- + nunits++; + if (nunits >= unitv_size) { + unitv_size += 8; +! unitv = realloc (unitv, sizeof(char *) * unitv_size); + if (unitv == NULL) + die (STATE_UNKNOWN, _("Could not reallocate units [%d]\n"), (int)nunits); + } +! ptr = trimstring (optarg); + unitv[nunits - 1] = ptr; + if (strstr (ptr, "'") == ptr) + unitv[nunits - 1] = ptr + 1; + while (ptr && (ptr = nextarg (ptr))) { + if (nunits >= unitv_size) { + unitv_size += 8; +! unitv = realloc (unitv, sizeof(char *) * unitv_size); + if (units == NULL) + die (STATE_UNKNOWN, _("Could not realloc() units\n")); + } + nunits++; +! ptr = trimstring (ptr); + if (strstr (ptr, "'") == ptr) + unitv[nunits - 1] = ptr + 1; + else +*************** +*** 936,942 **** + if there is a leading quote, make sure it balances */ + + char * +! thisarg (char *str) + { + str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ + if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */ +--- 935,941 ---- + if there is a leading quote, make sure it balances */ + + char * +! trimstring (char *str) + { + str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ + if (strstr (str, "'") == str) { /* handle SIMPLE quoted strings */ -- cgit v1.2.3-74-g34f1