[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] [bug?] Crash of hobbitsvc.cgi on trends column display
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] [bug?] Crash of hobbitsvc.cgi on trends column display
- From: Gildas Le Nadan <gn1 (at) sanger.ac.uk>
- Date: Tue, 28 Nov 2006 15:16:54 +0000
- References: <20061128144714.GG3475@cgoyard1.exp75.cvf>
- User-agent: Debian Thunderbird 1.0.2 (X11/20060724)
[oh, I found another small bug, not severe at all: when running
hobbitsvc.cgi from the command line, it segfaults if SCRIPT_NAME is not
set. Maybe it should set SCRIPT_NAME to a sensible default or at least
exit grcefully]
Yes, the cgis are not all checking that their environment.
I was about to provide patches so they at least call envcheck() as some
of the cgis are using it.
Something like this will do the trick for hobbigraph.c for instance
--- hobbit-4.2.0-allinone/web/hobbitgraph.c 2006-11-08
14:08:15.000000000 +0000
+++ hobbit-4.2.0-sanity/web/hobbitgraph.c 2006-11-28
15:16:10.492252944 +0000
@@ -490,6 +490,13 @@
char *okuri, *p;
int urilen;
+ /* first of all, sanity checks */
+ char *reqenv[] = {
+ "BBHOME", "BBRRDS", "SCRIPT_NAME", "RRDHEIGHT",
+ "RRDWIDTH", "HTMLCONTENTTYPE", NULL
+ };
+ envcheck(reqenv);
+
graphwidth = atoi(xgetenv("RRDWIDTH"));
graphheight = atoi(xgetenv("RRDHEIGHT"));
Cheers,
Gildas