Mailing List Archive

Re: arguments to cgi scripts in server side includes?
I remember this being a "known bug" but never having the time to
either fix it or find out what was causing it. Anyone know if this got
fixed in Shambhala? Sean - try grabbing the most recent shambhala off of
ftp.ai.mit.edu/pub/users/rst.

Brian

On Mon, 10 Jul 1995, Sean Welch wrote:
> I'm trying to figure out how to pass arguments to scripts that
> are called as server side includes. I can't get:
>
> <!--#exec cgi="foo.cgi"-->
>
> to work at all, no matter where I've tried the arguments, but I
> can get:
>
> <!--#exec cmd="/hot/www/Staff/welch/foo.cgi foo bar baz"-->
>
> to do just what I want, but I have to yank out the part that
> prints content-type at the top. Is there a way to pass arguments
> to an exec'd cgi?
>
> Sean
>

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com brian@hyperreal.com http://www.[hyperreal,organic].com/
Re: arguments to cgi scripts in server side includes? [ In reply to ]
Date: Mon, 10 Jul 1995 12:17:30 -0700 (PDT)
From: Brian Behlendorf <brian@organic.com>

I remember this being a "known bug" but never having the time to
either fix it or find out what was causing it. Anyone know if this got
fixed in Shambhala? Sean - try grabbing the most recent shambhala off of
ftp.ai.mit.edu/pub/users/rst.

More like "known behavior" --- scripts executed from SSI are given the
QUERY_ARGS and PATH_INFO of the parent request, and so the URLs in the
exec directives aren't allowed to have PATH_INFO or QUERY_ARGS of
their own.

One thing to try, in Shambhala, might be inclusion of CGI scripts
(<!--#include virtual="/cgi-bin/foo"--> instead of <!--#exec-->).
This probably doesn't work terribly well (and shouldn't work at all if
IncludesNoExec is on), but it is at least possible that it can be made
to do the job (giving the arguments as QUERY_ARGS ---

<!--#include virtual="/cgi-bin/foo?args+go+here"-->

NB, this is exploring some dark corners of the code which have seen
very little serious testing yet, so tread with caution.

rst

On Mon, 10 Jul 1995, Sean Welch wrote:
> I'm trying to figure out how to pass arguments to scripts that
> are called as server side includes. I can't get:
>
> <!--#exec cgi="foo.cgi"-->
>
> to work at all, no matter where I've tried the arguments, but I
> can get:
>
> <!--#exec cmd="/hot/www/Staff/welch/foo.cgi foo bar baz"-->
>
> to do just what I want, but I have to yank out the part that
> prints content-type at the top. Is there a way to pass arguments
> to an exec'd cgi?
>
> Sean
>

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com brian@hyperreal.com http://www.[hyperreal,organic].com/
Re: arguments to cgi scripts in server side includes? [ In reply to ]
On Jul 10, 5:59pm, Robert S. Thau wrote:
> Subject: Re: arguments to cgi scripts in server side includes?
[...]
> More like "known behavior" --- scripts executed from SSI are given the
> QUERY_ARGS and PATH_INFO of the parent request, and so the URLs in the
> exec directives aren't allowed to have PATH_INFO or QUERY_ARGS of
> their own.
>
> One thing to try, in Shambhala, might be inclusion of CGI scripts
> (<!--#include virtual="/cgi-bin/foo"--> instead of <!--#exec-->).
> This probably doesn't work terribly well (and shouldn't work at all if
> IncludesNoExec is on), but it is at least possible that it can be made
> to do the job (giving the arguments as QUERY_ARGS ---
>
> <!--#include virtual="/cgi-bin/foo?args+go+here"-->

This works as advertised, and so I'll be using it for now. It's
tempting to go with <--#exec cmd="..." --> because then I don't
have to change my argument parsing code, but that would mean a
shell is forked/exec'd which then exec's my program instead of
just having my program forked/exec'd, right?

> NB, this is exploring some dark corners of the code which have seen
> very little serious testing yet, so tread with caution.

Will do. I'll be sure to report any weirdness I find.

Sean Welch
Re: arguments to cgi scripts in server side includes? [ In reply to ]
From: "Sean Welch" <welch@wired.com>
Date: Mon, 10 Jul 1995 22:13:36 -0700
Precedence: bulk
Reply-To: new-httpd@hyperreal.com

This works as advertised, and so I'll be using it for now. It's
tempting to go with <--#exec cmd="..." --> because then I don't
have to change my argument parsing code, but that would mean a
shell is forked/exec'd which then exec's my program instead of
just having my program forked/exec'd, right?

That's correct.

rst