Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Feb 1997 18:42:30 +0800 (HKT)
From:      william <william@spark.net.hk>
To:        hackers@freebsd.org
Subject:   2.2-BETA_A and popen
Message-ID:  <Pine.BSF.3.91.970203181909.23445C-100000@svr1.spark.net.hk>

next in thread | raw e-mail | index | archive | help

	I write a small cgi program which runs fine on 2.16 but it
fails to work on my 2.2-BETA_A. In the web server log - "malformed
header from script". If I comment out popen()..pclose(), then it works.
I am wondering if it's something wrong with the popen in 2.2-BETA or 
I'm doing it in a wrong way. I'm using apache web server. 

	The poppassd also fails to work on my 2.2-BETA too. 

----cgi program--
#include <stdlib.h>
#include <fcntl.h>
#include <stdio.h>

main (void )
{
    FILE *f;
    printf("Content-type: text/html%c%c",10,10);
    printf("<html><body><pre>\n");
    f = popen("/bin/ed test", "w");
    fprintf(f, "/%s\nd\nwq\n", "william");
    pclose(f);
    printf("</pre><br>End</body></html>");   
}
---end--


Best Regards,
william
--------------------------------------------------------




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.970203181909.23445C-100000>