[Nagios-devel] nagios with embedded perl 5.8.9 in FreeBSD

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
Guest

[Nagios-devel] nagios with embedded perl 5.8.9 in FreeBSD

Post by Guest »

Hi:

First subscribing to this list, just to submit a patch and to say nice work.
Nagios 3.0.6 with Perl 5.8.9 on FreeBSD throws a signal bus when starting.
gdbing the code I opened a pr on FreeBSD site:
http://www.freebsd.org/cgi/query-pr.cgi?pr=131993&cat=

But after that, reviewing the code, there is something wrong with a
local variable initialization. Jesus, take a look at embedding
"variable" on init_embedded_perl() funcion on utils.c!!
Here is my patch to correct the problem. Hope it helps.

Thanks
Sebastian Guarino


--

--- utils.c-old 2009-02-23 15:36:28.000000000 -0200
+++ utils.c 2009-02-23 16:00:51.000000000 -0200
@@ -3597,7 +3597,7 @@
/* initializes embedded perl interpreter */
int init_embedded_perl(char **env){
#ifdef EMBEDDEDPERL
- char *embedding[]={ "", "" };
+ void **embedding;
int exitstatus=0;
char *temp_buffer=NULL;
int argc=2;
@@ -3612,8 +3612,11 @@
}

else{
-
- embedding[1]=p1_file;
+ embedding = (void **)malloc(2*sizeof(char *));
+ if(embedding==NULL)
+ return ERROR;
+ *embedding=strdup("");
+ *(embedding+1)=strdup(p1_file);

use_embedded_perl=TRUE;







This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked