tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Mike Grau <m.grau () kcc ! state ! ks ! us>
To: tru64-unix-managers
Subject: SUMM: Zeros sent to CGI shell scripts
Date: Mon, 10 Mar 1997 21:52:19 +0000	[thread overview]
Message-ID: <96078609810266.tru64-unix-managers.marc@archive.invalid> (raw)

<HTML><BODY>
(Original question at end)
<BR>2 Responses: Both suggesting to use the internal support. However, since
NSCA says
<BR>(see below) the command line may be used in the case of an ISINDEX query,
and the
<BR>&quot;calendar&quot; script is such a query, and the query runs OK at the
NCSA site, that the &quot;zero&quot;
<BR>problem was perhaps a quirk of DU. I assume the scripts they run as examples
are also
<BR>the one's they distribute. At any rate:
<BR>
<BR>$CAL `echo $QUERY_STRING | sed -e &quot;s/+/ /&quot;`
<BR>or similiar works, while
<BR>$CAL $*
<BR>does not. Just seems like a shame.
<BR>
<BR>From: Lucio Chiappetti:
<BR>&nbsp; <I>Beware however that the CGI tutorial documentation seems to imply</I>
<BR><I>&nbsp; that argstring shall not be used, and env variable QUERY_STRING&nbsp;</I>
<BR><I>&nbsp; shall be used instead ...</I>
<BR><I></I>
<BR><I>&nbsp; See e.g. <A HREF="http://hoohoo.ncsa.uiuc.edu/cgi/primer.html">http://hoohoo.ncsa.uiuc.edu/cgi/primer.html</A></I>
<BR><I>&nbsp; <A HREF="http://hoohoo.ncsa.uiuc.edu/cgi/interface.html">http://hoohoo.ncsa.uiuc.edu/cgi/interface.html</A></I>
<BR><I></I>
<BR><I>&nbsp; I believe this changed some time ago.</I>
<BR><I>&nbsp; I note that the example scripts in the NCSA distribution use
QUERY_STRING</I>
<BR>
<BR>From Neil Schellenberger:
<BR><I>I had a similar problem with an imagemap/cgi pair which I originally</I>
<BR><I>wrote some time ago and only recently resurrected.&nbsp; I found that
the</I>
<BR><I>current verion of our server (also NCSA 1.5.?) was escaping certain</I>
<BR><I>characters (zero and capital A, for example).&nbsp; This hosed up the
(old)</I>
<BR><I>external imagemap CGI program.&nbsp; My workaround: use the internal
support,</I>
<BR><I>which handles the escapes properly.</I>
<BR>
<BR>*****************************************************************************************************************************
<BR>From NCSA:
<BR>&quot;The command line is only used in the case of an ISINDEX query. It
is not used in the
<BR>case of an HTML form or any as yet undefined query type. The server should
search
<BR>the query information (the QUERY_STRING environment variable) for a non-encoded
<BR>= character to determine if the command line is to be used, if it finds
one, the
<BR>command line is not to be used. This trusts the clients to encode the =
sign in
<BR>ISINDEX queries, a practice which was considered safe at the time of the
design
<BR>of this specification.&quot;
<BR>
<BR>&quot;For example, use the finger script and the ISINDEX interface to look
up &quot;httpd&quot;. You
<BR>will see that the script will call itself with /cgi-bin/finger?httpd and
will actually
<BR>execute &quot;finger httpd&quot; on the command line and output the results
to you.&quot;
<BR>*******************************************************************************************************
<BR>
<BR>Original question:
<BR>I'm running NSCA httpd on DU3.2c. Whenever a zero is sent in a query to
<BR>a cgi script, the variable $* (or $whatever) fails to get the zero and
<BR>everything after the zero. The command (like cal) fails with a bad
<BR>argument. For example, the test-cgi script (#!/bin/sh) run with
<BR>&quot;test-cgi?3+1998&quot; returns:
<BR>
<BR>&quot;argc is 2. argv is 3 1998&quot;&nbsp; -followed by the variables
SERVER_SOFTWARE,
<BR>QUERY_STRING, etc.
<BR>
<BR>while test-cgi?3+2001 returns:
<BR>
<BR>&quot;argc is 2. argv is 3 2&quot;&nbsp; -followed by nothing or just part
of the
<BR>return page.
<BR>The QUERY_STRING looks good in every case.
<BR>I've tried Netscape, Explorer, and Mosaic; and run browsers on MAC, PC,
<BR>and UNIX. The results are the same in every case. I've used both NCSA
<BR>1.5.1 and 1.5.2 with no difference. IDEAS?? What tree should I be
<BR>barking under -- DU or HTTPD. The cgi's work fine as long as I don't try
<BR>to send 'em a zero. TIA. Any suggestions welcome!&nbsp;

</BODY>
</HTML>

                 reply	other threads:[~1997-03-10 21:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox