nagios with embedded perl 5.8.9 in FreeBSD

Sebastián Guarino sebastian.guarino at gmail.com
Mon Feb 23 19:20:14 CET 2009


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;



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H




More information about the Developers mailing list