Ticket #429 (closed defect: wontfix)

Opened 2 years ago

Last modified 2 weeks ago

lighttpd-1.4.8 mod_cgi: no variables with GET?

Reported by: valliant@hawaii.edu Assigned to: jan
Priority: normal Milestone:
Component: mod_cgi Version: 1.4.19
Severity: normal Keywords:
Cc: Blocking:
Need Feedback: 1

Description

Problem: When I search my database with a POST call to mod_cgi

I get back a list of links that look like this:

<p>4 <a href="ifetch?2000+531120375329+F">!Japan: Government plans

law revision to prevent espionage</a><br>

Calling the shell script "ifetch" with 3 variables:

ifetch?2000+531120375329+F

Apache: http://localhost:8000/cgi-bin/ifetch?2000+531120375329+F

returns:

ifetch /var/www/db 2000 531120375329 F 3 args

lighttpd: http://localhost/cgi-bin/ifetch?2000+531120375329+F

returns:

/usr/lib/cgi-bin/ifetch /var/www/db 0 args

parrot.pl tells that that the browser is sending:

GET /cgi-bin/ifetch?2000+473418041343+F HTTP/1.1 Host: localhost:8080 : : (omitted)

In the script below, you will see that "ifetch" just calls another program and passes the variables.

The goal is to return the record with the key=531120375329 from the database.

Apache does it. lighttpd doesn't, because no variables are passed.

My machine:

Linux magadan 2.6.8-2-386 #1 Tue Aug 16 12:46:35 UTC 2005 i686 GNU/Linux

The web servers:

lighttpd-1.4.8 built from source (running on port 80) apache2_2.0.54-5_i386.deb (running on port 8000)

Inclusions:

  1. my cgi program "ifetch" (attached below)
  1. lighttpd.conf (attached below)

Configuration:

I don't think that this is a configuration problem, but I could be wrong.

Everything is just plain vanilla.

Any guidance greatly appreciated.

========================================================================= "ifetch"

#!/bin/sh
 
# From this script, run the isrch_fetch utility and pass 4 arguments:
# $1=dbname, $2=key, $3=field
# isrch_fetch <databases_path> $1 $2 $3
#

# ---- original ------- 
#exec /usr/local/bin/isrch_fetch /var/www/db $1 $2 $3

# ----- my testing ----------
echo "Content-type: text/plain"
echo ""
echo $0 /var/www/db $1 $2 $3
echo "$# args"

=========================================================================

lighttpd.conf (the bare essentials:

grep -v # /etc/lighttpd/lighttpd.conf)

server.modules = ( 
				"mod_setenv",
			        "mod_access", 
				"mod_alias",
				"mod_cgi",
				"mod_accesslog" )

server.document-root             = "/var/www/html"
server.errorlog            = "/var/log/lighttpd/error.log"
server.indexfiles          = ( "index.php", "index.html", 
                               "index.htm", "default.htm" )
mimetype.assign            = (  
  ".pdf"          =>      "application/pdf",
	:
	: (omitted)
	:
  ".sig"          =>      "application/pgp-signature",
  ".asx"          =>      "video/x-ms-asf",
  ".wmv"          =>      "video/x-ms-wmv"
 )
accesslog.filename          = "/var/log/lighttpd/access.log"
url.access-deny             = ( "~", ".inc" )
server.pid-file              = "/var/run/lighttpd.pid"
server.username            = "www-data"
server.groupname           = "www-data"
cgi.assign  = ( ".awk"     => "/usr/bin/awk",
				".py"      => "/usr/bin/python",
				".sh"      => "",
				"/isearch" => "",
				"/ifetch"  => "",
				"/ihtml"   => "",
				"/time"    => "" )
alias.url = ( "/cgi-bin/" => "/usr/lib/cgi-bin/",
			  "/images/"  => "/var/www/images/" )

Attachments

Change History

(in reply to: ↑ description ) 05/03/2008 05:47:56 PM changed by anonymous

  • version changed from 1.4.x-svn to 1.4.19.
  • blocking changed.
  • pending set to 1.

i'm having a very similar problem with a simpler test case

#!/bin/sh

echo "content-type: text/plain"
echo

echo $# $@

then http://localhost/cgi-bin/test?asdf

which outputs just 0

instead of 1 asdf

05/03/2008 09:25:57 PM changed by stbuehler

  • status changed from new to closed.
  • resolution set to wontfix.

If i read the spec correctly, we don't have to pass the query-string in the command line, we only should if it doesn't contain a unencoded '=', but we are allowed to not do that due to "internal limitations".

So i think you should just use the traditional way via $QUERY_STRING - it is easier for you (you have to accept it via $QUERY_STRING anyway if is too long) and easier for us.


Add/Change #429 (lighttpd-1.4.8 mod_cgi: no variables with GET?)




Change Properties
Action