(sorta)OT: Apache / CGI / fP / printing

Walter Vaughan wvaughan at steelerubber.com
Fri Jun 11 14:55:24 PDT 2004


Doug Luurs wrote:

> Has anyone every tried to run a filepro report with normal output to a unix
> printer
> Like from a command line via a HTML Page ?   (Trying to get a .NET Appl to
> run a report in fp)
> 
> i.e.:
> 	A webpage executes a CGI script ..
written in what language? Perl, Php, ruby, /bin/sh?
Can you execute any cgi-bin scripts in that directory?

>         The script then calls Filepro 
>            Filepro (dclerk) then checks & verifies the information passed to
> it

Great googly moogly. I've never had much luck with dclerk. Howie wrote 
fpweb IIRC with dclerk, but I've only had dependable luck running 
reports to import and export data from filePro.

>   	     (Mainly to get the range and IP of requester - This in turn
> sets the printer)
> 	     then runs dreport (via system) with output directed to a unix
> printer
>            that is set via -pn .
>  
> The process I have in place works fine when run at a command prompt, but
> then fails
> if called by Apache.

Apache does not supply a TERM variable. filePro [dr]report will not run 
without the TERM variable being set.

If you are using perl as the cgi-bin script you might have something 
like the following...

#/usr/bin/perl -T
$fpenv = "TERM=ansi; export TERM; ";
$fpreport = "/appl/fp/rreport File -f report -a -pn printer1";
$fpcommand = $fpenv . $fpreport;
$fpstatus = system $fpcommand;

Actually you can use any TERM variable that you know
filePro can deal with on your system.

$remote_ip = $ENV{'REMOTE_ADDR'}";
Would get you the IP address of the person who's running the script.
You could even pass that value to filepro via -r in the report
and use it to set printer destination or whatever you need it to do.

But I would recommend that you post your final script here for  people 
very experienced in catching security holes to glance at. I don't think 
that I've given you anything that is wide open, but  I'd feel better if 
Mark gave it a 5 second look-see.

--
Walter



More information about the Filepro-list mailing list