permission mods
[feisty_meow.git] / scripts / cgi / cgi_cat.pl
1 #!/usr/bin/perl
2
3 ###############################################################################
4 #                                                                             #
5 #  Name   : cgi_cat                                                           #
6 #  Author : Chris Koeritz                                                     #
7 #  Rights : Copyright (C) 1996-$now by Author                                 #
8 #                                                                             #
9 #  Purpose:                                                                   #
10 #                                                                             #
11 #    Spews the given file out and assumes it is valid html that will work.    #
12 #                                                                             #
13 ###############################################################################
14 # This program is free software; you can redistribute it and/or modify it     #
15 # under the terms of the GNU General Public License as published by the Free  #
16 # Software Foundation; either version 2 of the License, or (at your option)   #
17 # any later version.  See: "http://www.gruntose.com/Info/GNU/GPL.html" for a  #
18 # version of the License.  Please send any updates to "chris@gruntose.com".   #
19 ###############################################################################
20
21 # send out the cgi header.
22 print "Content-type: text/html\n\n";
23
24 # isolate the file showing capability to our web sites.
25 local($file) = "/var/www/" . $ENV{'QUERY_STRING'};
26 open(TO_READ, "<" . $file) || die "Could not open $file for reading.";
27 foreach $line (<TO_READ>) { print $line; }
28
29 exit 1;
30