Nagios 4.0.8: lib/runcmd.c doesn't compile

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
jwoods
Posts: 1
Joined: Tue Aug 19, 2014 4:22 pm

Nagios 4.0.8: lib/runcmd.c doesn't compile

Post by jwoods »

In line 590 of lib/runcmd.c, the following statement is trying to assign -1:

Code: Select all

if (asprintf(&env_string, "%s=%s", name, value) = -1) return -1;
It really should read:

Code: Select all

if (asprintf(&env_string, "%s=%s", name, value) == -1) return -1;
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios 4.0.8: lib/runcmd.c doesn't compile

Post by tmcdonald »

Thanks, passed this on to the devs.
Former Nagios employee
emislivec
Posts: 52
Joined: Tue Feb 25, 2014 10:06 am

Re: Nagios 4.0.8: lib/runcmd.c doesn't compile

Post by emislivec »

Thanks for the report jwoods!
What OS / compiler are you working with? Can you post or PM your config.log?

Mea culpa on this one. I had undefined HAVE_SETENV to force that code path in earlier development, but obviously not when/after adding in the error checking. I'll fix this and look at forcing the tests to use the !defined(HAVE_SETENV) path as well.

Have you come across any other problems compiling/installing?
Locked