Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 1304 invoked by uid 6000); 22 Jun 1998 06:06:38 -0000 Received: (qmail 1297 invoked from network); 22 Jun 1998 06:06:37 -0000 Received: from mail-out2.apple.com (17.254.0.51) by taz.hyperreal.org with SMTP; 22 Jun 1998 06:06:37 -0000 Received: from mailgate.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out2.apple.com (8.8.5/8.8.5) with ESMTP id XAA20748 for ; Sun, 21 Jun 1998 23:01:12 -0700 Received: from scv4.apple.com (scv4.apple.com [17.128.100.142]) by mailgate.apple.com (mailgate.apple.com2.0.15) with ESMTP id for ; Sun, 21 Jun 1998 23:01:05 -0700 Received: from joliet-jake.apple.com (joliet-jake.apple.com [17.202.40.140]) by scv4.apple.com (8.8.5/8.8.5) with SMTP id XAA28344 for ; Sun, 21 Jun 1998 23:01:04 -0700 Message-Id: <199806220601.XAA28344@scv4.apple.com> To: new-httpd@apache.org Subject: [PATCH] unimportant cgi-bin tweakage Date: Sun, 21 Jun 98 23:01:04 -0700 From: Wilfredo Sanchez Received: by Apple.Mailer (2.87) Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org The following are patches to the cgi-bin directory in the Apache 1.3.0 source tree. There are two significant changes: - I added a first line #!/usr/bin/false to the cgi scripts which are installed, since they provide information about the system which a user may not want to disclose and the CGI-bin directory may be configured as enabled during install. A comment tells the user to delete the first line in order to enable the script. You don't want these enabled on a production server, or a personal machine unless you explicitly need them, - Fancier printenv script; displays environment in a simple table, in case you're interested in such things. -Fred Rhapsody Core Operating Systems Group wsanchez@apple.com, 408.974-5174 2 Infinite Loop 302-4K, Cupertino, CA 95014 Index: CoreOS/Services/apache/apache/cgi-bin/printenv diff -u CoreOS/Services/apache/apache/cgi-bin/printenv:1.1.1.1 CoreOS/Services/apache/apache/cgi-bin/printenv:1.2 --- CoreOS/Services/apache/apache/cgi-bin/printenv:1.1.1.1 Thu Aug 14 11:08:15 1997 +++ CoreOS/Services/apache/apache/cgi-bin/printenv Sun Jun 21 19:28:30 1998 @@ -1,7 +1,83 @@ -#!/usr/local/bin/perl +#!/usr/bin/false +#!/usr/bin/perl -T -print "Content-type: text/html\n\n"; -while (($key, $val) = each %ENV) { - print "$key = $val
\n"; -} +# Remove '#!/usr/bin/false ' from the above in order to enable +# this script. It will not work as installed. Do not enable on +# a production server; we make no claims that this is a secure +# script. +## +# Show CGI Process Environment +# Wilfredo Sanchez | wsanchez@apple.com +# Apple Computer, Inc. +# Wed Oct 15 13:55:32 PDT 1997 +## +# This perl program shows you how to access the process environment +# for CGI programs on your web server. +# It is also a useful debugging tool, as it shows you all of the +# available environment variables. +## + +# CGI programs must print their own HTTP response headers +print "Content-type: text/html\n"; +print "\n"; + +# Declare the SGML application as HTML 3.2 +print "\n"; + +# Begin HTML +print "\n"; + +# A minimal document must include a header region with a title +print "\n"; +print ""; # Author +print "CGI Test\n"; +print "\n"; +print "\n"; + +# Start document body +print "\n"; +print "\n"; + +# Put values in a table to readability +print "\n"; +print "\n"; + +# Caption the able +print " \n"; +print "\n"; + +# Include table headers +print " \n"; +print " \n"; +print " \n"; +print " \n"; + +# Print each key/value pair as two column in a row +foreach $key (keys %ENV) + { + print "\n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + } +print "\n"; + +# End table +print "
CGI Environment
\n"; +print " Variable\n"; +print " \n"; +print " Value\n"; +print "
\n"; + print " $key\n"; + print " \n"; + print " $ENV{$key}\n"; + print "
\n"; +print "\n"; + +# End document body +print "\n"; + +# End HTML +print "\n"; Index: CoreOS/Services/apache/apache/cgi-bin/test-cgi diff -u CoreOS/Services/apache/apache/cgi-bin/test-cgi:1.1.1.1 CoreOS/Services/apache/apache/cgi-bin/test-cgi:1.2 --- CoreOS/Services/apache/apache/cgi-bin/test-cgi:1.1.1.1 Thu Aug 14 11:08:15 1997 +++ CoreOS/Services/apache/apache/cgi-bin/test-cgi Sun Jun 21 22:27:48 1998 @@ -1,3 +1,4 @@ +#!/usr/bin/false #!/bin/sh # disable filename globbing