Re: [Nagios-devel] NdoUtils 1.4b8 LONG_OUTPUT bug ( and resolution )
Posted: Tue Oct 20, 2009 7:11 pm
This is a multi-part message in MIME format.
--------------070306080301000802020900
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Oops,
Seems i forgot to modify the asprintf string format as well.
Here the complete diff.
Greetings
--------------070306080301000802020900
Content-Type: text/plain;
name="ndomd.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ndomd.c.diff"
~$ diff -u original/ndoutils-1.4b8/src/ndomod.c corrected/ndoutils-1.4b8/src/ndomod.c
--- Downloads/tmp/ndoutils-1.4b8/src/ndomod.c 2009-07-17 03:25:10.000000000 +0200
+++ Downloads/ndoutils-1.4b8/src/ndomod.c 2009-10-20 22:05:30.024518352 +0200
@@ -1740,7 +1740,7 @@
,scdata->return_code
,NDO_DATA_OUTPUT
,(es[5]==NULL)?"":es[5]
- ,NDO_DATA_OUTPUT
+ ,NDO_DATA_LONGOUTPUT
,(es[6]==NULL)?"":es[6]
,NDO_DATA_PERFDATA
,(es[7]==NULL)?"":es[7]
@@ -1815,7 +1815,7 @@
,hcdata->return_code
,NDO_DATA_OUTPUT
,(es[4]==NULL)?"":es[4]
- ,NDO_DATA_OUTPUT
+ ,NDO_DATA_LONGOUTPUT
,(es[5]==NULL)?"":es[5]
,NDO_DATA_PERFDATA
,(es[6]==NULL)?"":es[6]
@@ -2757,14 +2757,12 @@
es[2]=ndo_escape_buffer(cnotdata->output);
/* Preparing long output for the future */
es[3]=ndo_escape_buffer(cnotdata->output);
- /* Preparing for long_output in the future */
- es[4]=ndo_escape_buffer(cnotdata->output);
- es[5]=ndo_escape_buffer(cnotdata->ack_author);
- es[6]=ndo_escape_buffer(cnotdata->ack_data);
- es[7]=ndo_escape_buffer(cnotdata->contact_name);
+ es[4]=ndo_escape_buffer(cnotdata->ack_author);
+ es[5]=ndo_escape_buffer(cnotdata->ack_data);
+ es[6]=ndo_escape_buffer(cnotdata->contact_name);
snprintf(temp_buffer,sizeof(temp_buffer)-1
- ,"\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
+ ,"\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
,NDO_API_CONTACTNOTIFICATIONDATA
,NDO_DATA_TYPE
,cnotdata->type
@@ -2788,7 +2786,7 @@
,NDO_DATA_SERVICE
,(es[1]==NULL)?"":es[1]
,NDO_DATA_CONTACTNAME
- ,(es[5]==NULL)?"":es[5]
+ ,(es[6]==NULL)?"":es[6]
,NDO_DATA_NOTIFICATIONREASON
,cnotdata->reason_type
,NDO_DATA_STATE
@@ -2797,12 +2795,10 @@
,(es[2]==NULL)?"":es[2]
,NDO_DATA_LONGOUTPUT
,(es[3]==NULL)?"":es[3]
- ,NDO_DATA_OUTPUT
- ,(es[4]==NULL)?"":es[4]
,NDO_DATA_ACKAUTHOR
- ,(es[5]==NULL)?"":es[5]
+ ,(es[4]==NULL)?"":es[4]
,NDO_DATA_ACKDATA
- ,(es[6]==NULL)?"":es[6]
+ ,(es[5]==NULL)?"":es[5]
,NDO_API_ENDDATA
);
--------------070306080301000802020900--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
--------------070306080301000802020900
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Oops,
Seems i forgot to modify the asprintf string format as well.
Here the complete diff.
Greetings
--------------070306080301000802020900
Content-Type: text/plain;
name="ndomd.c.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ndomd.c.diff"
~$ diff -u original/ndoutils-1.4b8/src/ndomod.c corrected/ndoutils-1.4b8/src/ndomod.c
--- Downloads/tmp/ndoutils-1.4b8/src/ndomod.c 2009-07-17 03:25:10.000000000 +0200
+++ Downloads/ndoutils-1.4b8/src/ndomod.c 2009-10-20 22:05:30.024518352 +0200
@@ -1740,7 +1740,7 @@
,scdata->return_code
,NDO_DATA_OUTPUT
,(es[5]==NULL)?"":es[5]
- ,NDO_DATA_OUTPUT
+ ,NDO_DATA_LONGOUTPUT
,(es[6]==NULL)?"":es[6]
,NDO_DATA_PERFDATA
,(es[7]==NULL)?"":es[7]
@@ -1815,7 +1815,7 @@
,hcdata->return_code
,NDO_DATA_OUTPUT
,(es[4]==NULL)?"":es[4]
- ,NDO_DATA_OUTPUT
+ ,NDO_DATA_LONGOUTPUT
,(es[5]==NULL)?"":es[5]
,NDO_DATA_PERFDATA
,(es[6]==NULL)?"":es[6]
@@ -2757,14 +2757,12 @@
es[2]=ndo_escape_buffer(cnotdata->output);
/* Preparing long output for the future */
es[3]=ndo_escape_buffer(cnotdata->output);
- /* Preparing for long_output in the future */
- es[4]=ndo_escape_buffer(cnotdata->output);
- es[5]=ndo_escape_buffer(cnotdata->ack_author);
- es[6]=ndo_escape_buffer(cnotdata->ack_data);
- es[7]=ndo_escape_buffer(cnotdata->contact_name);
+ es[4]=ndo_escape_buffer(cnotdata->ack_author);
+ es[5]=ndo_escape_buffer(cnotdata->ack_data);
+ es[6]=ndo_escape_buffer(cnotdata->contact_name);
snprintf(temp_buffer,sizeof(temp_buffer)-1
- ,"\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
+ ,"\n%d:\n%d=%d\n%d=%d\n%d=%d\n%d=%ld.%ld\n%d=%d\n%d=%ld.%ld\n%d=%ld.%ld\n%d=%s\n%d=%s\n%d=%s\n%d=%d\n%d=%d\n%d=%s\n%d=%s\n%d=%s\n%d=%s\n%d\n\n"
,NDO_API_CONTACTNOTIFICATIONDATA
,NDO_DATA_TYPE
,cnotdata->type
@@ -2788,7 +2786,7 @@
,NDO_DATA_SERVICE
,(es[1]==NULL)?"":es[1]
,NDO_DATA_CONTACTNAME
- ,(es[5]==NULL)?"":es[5]
+ ,(es[6]==NULL)?"":es[6]
,NDO_DATA_NOTIFICATIONREASON
,cnotdata->reason_type
,NDO_DATA_STATE
@@ -2797,12 +2795,10 @@
,(es[2]==NULL)?"":es[2]
,NDO_DATA_LONGOUTPUT
,(es[3]==NULL)?"":es[3]
- ,NDO_DATA_OUTPUT
- ,(es[4]==NULL)?"":es[4]
,NDO_DATA_ACKAUTHOR
- ,(es[5]==NULL)?"":es[5]
+ ,(es[4]==NULL)?"":es[4]
,NDO_DATA_ACKDATA
- ,(es[6]==NULL)?"":es[6]
+ ,(es[5]==NULL)?"":es[5]
,NDO_API_ENDDATA
);
--------------070306080301000802020900--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]