Page 1 of 1

bug in option-deprecation code

Posted: Thu Mar 09, 2017 11:09 pm
by eponymousalias
The following applies to Nagios 4.3.1.

In xdata/xodtemplate.c, in these two places in the code:

Code: Select all

   2400                         else if(!strcmp(variable, "retry_interval") || !strcmp(variable, "retry_check_interval")) {
   2401                                 if(!strcmp(variable, "normal_retry_interval"))
   2402                                         logit(NSLOG_CONFIG_WARNING, TRUE, "WARNING: The normal_retry_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.\n");

   2859                         else if(!strcmp(variable, "retry_interval") || !strcmp(variable, "retry_check_interval")) {
   2860                                 if(!strcmp(variable, "normal_retry_interval"))
   2861                                         logit(NSLOG_CONFIG_WARNING, TRUE, "WARNING: The normal_retry_interval attribute is deprecated and will be removed in future versions. Please use retry_interval instead.\n");
Notice that the initial conditional is testing for "retry_check_interval"
but the nested conditional is testing for "normal_retry_interval" instead,
which can never be matched at that point because of the first conditional.
There is clearly a mismatch of expectations here. I'm not sure exactly
what option names were intended, so I can't tell which lines of code
need correction.

Re: bug in option-deprecation code

Posted: Fri Mar 10, 2017 9:53 am
by dwhitfield
Thank you for reporting!

I have filed this bug at https://github.com/NagiosEnterprises/na ... issues/345.

Please put any additional info related to this bug on github. I am closing this thread.