httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <tevans...@googlemail.com>
Subject Re: [users@httpd] unexpected EOF while looking for matching
Date Mon, 20 Feb 2012 10:36:13 GMT
On Sat, Feb 18, 2012 at 4:30 PM, Steve Swift <Swifty@swiftys.org.uk> wrote:
> I get entries like this in my error log. They are extremely sporadic, and
> because the access rate is low on our server, it is easy to find the CGI
> script that was being accessed. In all cases, it is one which hasn't changed
> in months, and has seen plenty of use in the intervening period, without
> problems.
>
> My assumption is that this is some temporary blockage in the file system
> that causes apache to think it has reached EOF before it has actually
> processed the entire script.

Unlikely, Apache doesn't think that at all, sh thinks that. sh is
invoked by your scripts, not by Apache. The error message from sh
means sh encountered the end of an input when it was trying to parse a
script:

> $ echo -e 'a="hello\n' | sh
sh: line 1: unexpected EOF while looking for matching `"'
sh: line 2: syntax error: unexpected end of file

BTW, I say 'sh', this is only 'sh' on linux boxes, the error message
is really from 'bash'. On boxes where 'sh' != 'bash', the error
message would be this:

> $ echo -e 'a="hello\n' | sh
Syntax error: Unterminated quoted string

>
> What puzzles me is: What is looking for quotes in the first place? The
> script in question is written in Open Object Rexx.
> The shebang is: #!/usr/bin/rexx --
> REXX is perfectly happy to execute the script (witness the prior successful
> usage, since it was last updated).
>
> Altogether, one of my life's great mysteries.
>

Again, unlikely. Computer programs, given the same inputs, will
generally produce the same outputs. Probably you are not invoking the
script with the same environment - if you are invoking as a CGI, that
includes all headers, cookies, user agent strings etc.

As you could see from my example, this is not an uncommon programming
error, it simply comes from non Apache components invoking the shell,
and not properly escaping the arguments that they pass to the shell.

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message