Hi,
I did not follow the list to closely lately so I hope this is not a duplicate...

After installing qmailadmin-1.2.8 on a debian stable with apache 1.3 I ended up having
Premature end of script headers: /usr/lib/cgi-bin/qmailadmin
in my apache error logfile. I could run qmailadmin from the shell just fine, so I spent hours looking for Apache config error before I started to add fprintf stderr to the source trying to locate the error. Finally I found the source within the first printf that writes the html header. For unknown reason charset was 0L and therefore *charset == '\0' crashed the cgi. Below you can find a patch of my workaround. Of course it does not answer the main question but maybe somebody of the qmailadmin wizards can bring light into this.

cheers
andrej

--- qmailadmin-1.2.8/qmailadmin.c 2005-01-23 18:35:12.000000000 +0100 +++ qmailadmin-1.2.8.fix/qmailadmin.c 2005-08-31 09:19:44.000000000 +0200
@@ -448,8 +448,10 @@
   umask(VPOPMAIL_UMASK);

   charset = html_text[0];
-  printf ("Content-Type: text/html; charset=%s\n",
-    *charset == '\0' ? "iso-8859-1" : charset);
+ if (charset == 0L) printf ("Content-Type: text/html; charset=iso-8859-1\n");
+  else {printf ("Content-Type: text/html; charset=%s\n",
+    *charset == '\0' ? "iso-8859-1" : charset);}
+
 #ifdef NO_CACHE
   printf ("Cache-Control: no-cache\n");
   printf ("Cache-Control: no-store\n");

Reply via email to