bug in option-deprecation code

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
eponymousalias
Posts: 17
Joined: Mon Mar 07, 2016 5:38 am

bug in option-deprecation code

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: bug in option-deprecation code

Post 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.
Locked