You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by hugh williams <hu...@soco.agilent.com> on 2009/03/26 17:23:32 UTC

[users@httpd] Re: Apache 2.2 mod_include mis-interpreting back-references

Hi;

I posted this 5 months ago, and got no response. So I'm going to act 
insanely (insanity: doing the same thing over and expecting different 
results) and repost in hopes that some different readers are here.

Why is Apache 2.2.x throwing these warnings? I have upgraded to 2.2.9 
since posting, and still get these warning messages all the time, even 
though the web pages display as expected. What changed in mod_include 
from the 1.3.x tree? Should I submit this as a bug somewhere?

Thanks!

hugh

hugh williams wrote:
> Hi;
>
> I have a collection of web pages that use SSI to parse pieces of 
> $DOCUMENT_NAME and present those bits in the HTML output. Here's the 
> code:
>
> <!--#exec cmd="echo $DOCUMENT_NAME | perl -e 'while (<>) 
> {s/(\w+)_(\w+)_[_abt]{3}\..*/sprintf \"<b>%s Option %s 
> Hyperlinks<\/b>\", uc $1,uc $2/e;print;}'" -->
>
> This takes a file name like "z1234_aba_abt.html" and spits back "Z1234 
> Option ABA Hyperlinks".
>
> This works fine in both Apache 1.3.33 and 2.2.3; however 2.2.3 also 
> send the following error warning into the error log:
>
> [Wed Oct 22 14:50:00 2008] [warn] [client xxx.xxx.xxx.xxx] regex 
> capture $1 refers to no regex in /users/hughw/public_html/spclhand/z
> 1234_aba_abt.html
> [Wed Oct 22 14:50:00 2008] [warn] [client xxx.xxx.xxx.xxx] regex 
> capture $2 refers to no regex in /users/hughw/public_html/spclhand/z
> 1234_aba_abt.html
>
> This message is found in mod_include.c, and is not present in the 
> Apache 1.3 tree.
>
> So, can someone explain to me why the error is triggered? The include 
> parses perfectly and the correct results are displayed, that is, Perl 
> handles things fine, but Apache apparently is trying to use the "$1" 
> and "$2" for its own needs as well as letting Perl have them.
>
> Thanks
>
> hugh
>

-- 
 Hugh Williams                  "More men are killed by overwork than the
 hugh_williams@agilent.com       importance of the world justifies."
 Agilent Technologies                           - Rudyard Kipling
 Santa Rosa 4US-R                             "The Phantom Rickshaw", 1888
 (707)-577-4941



---------------------------------------------------------------------
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


[users@httpd] Re: Apache 2.2 mod_include mis-interpreting back-references

Posted by Dan Poirier <po...@pobox.com>.
hugh williams <hu...@soco.agilent.com> writes:

> My question still remains - what changed in Apache that a construct it
> formerly parsed one way is now treated differently? Or not so much
> what changed, but why? Why does Apache now "care" what is inside an
> exec cmd' string?

Even in 1.3, mod_include interpreted $ in an exec cmd string as a
variable substitution, and the doc warned that to include a literal $,
it needed to be quoted with a backslash.  The implementation probably
changed in a way that made it less forgiving of having a $ not followed
by the name of an existing variable, but that was never actually legal.

Dan


---------------------------------------------------------------------
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


[users@httpd] Re: Apache 2.2 mod_include mis-interpreting back-references

Posted by hugh williams <hu...@soco.agilent.com>.
Hi Dan;

Yes, that silences the errors, thanks!

My question still remains - what changed in Apache that a construct it 
formerly parsed one way is now treated differently? Or not so much what 
changed, but why? Why does Apache now "care" what is inside an 'exec 
cmd' string?

Thanks again, now all I have to do is find all the darn docs to update 
them...

hugh

Dan Poirier wrote:
> hugh williams <hu...@soco.agilent.com> writes:
>
>   
>>> <!--#exec cmd="echo $DOCUMENT_NAME | perl -e 'while (<>)
>>> {s/(\w+)_(\w+)_[_abt]{3}\..*/sprintf \"<b>%s Option %s
>>> Hyperlinks<\/b>\", uc $1,uc $2/e;print;}'" -->
>>>
>>> This works fine in both Apache 1.3.33 and 2.2.3; however 2.2.3 also
>>> send the following error warning into the error log:
>>>
>>> [Wed Oct 22 14:50:00 2008] [warn] [client xxx.xxx.xxx.xxx] regex
>>> capture $1 refers to no regex in /users/hughw/public_html/spclhand/z
>>> 1234_aba_abt.html
>>> [Wed Oct 22 14:50:00 2008] [warn] [client xxx.xxx.xxx.xxx] regex
>>> capture $2 refers to no regex in /users/hughw/public_html/spclhand/z
>>> 1234_aba_abt.html
>>>
>>> This message is found in mod_include.c, and is not present in the
>>> Apache 1.3 tree.
>>>
>>> So, can someone explain to me why the error is triggered? The
>>> include parses perfectly and the correct results are displayed, that
>>> is, Perl handles things fine, but Apache apparently is trying to use
>>> the "$1" and "$2" for its own needs as well as letting Perl have
>>>       
>
> Have you tried escaping the $ with \?  Maybe something like
>
> <!--#exec cmd="echo $DOCUMENT_NAME | perl -e 'while (<>)
> {s/(\w+)_(\w+)_[_abt]{3}\..*/sprintf \"<b>%s Option %s
> Hyperlinks<\/b>\", uc \$1,uc \$2/e;print;}'" -->
>
>
>   

-- 
 Hugh Williams                  "More men are killed by overwork than the
 hugh_williams@agilent.com       importance of the world justifies."
 Agilent Technologies                           - Rudyard Kipling
 Santa Rosa 4US-R                             "The Phantom Rickshaw", 1888
 (707)-577-4941



---------------------------------------------------------------------
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


[users@httpd] Re: Apache 2.2 mod_include mis-interpreting back-references

Posted by Dan Poirier <po...@pobox.com>.
hugh williams <hu...@soco.agilent.com> writes:

>> <!--#exec cmd="echo $DOCUMENT_NAME | perl -e 'while (<>)
>> {s/(\w+)_(\w+)_[_abt]{3}\..*/sprintf \"<b>%s Option %s
>> Hyperlinks<\/b>\", uc $1,uc $2/e;print;}'" -->
>>
>> This works fine in both Apache 1.3.33 and 2.2.3; however 2.2.3 also
>> send the following error warning into the error log:
>>
>> [Wed Oct 22 14:50:00 2008] [warn] [client xxx.xxx.xxx.xxx] regex
>> capture $1 refers to no regex in /users/hughw/public_html/spclhand/z
>> 1234_aba_abt.html
>> [Wed Oct 22 14:50:00 2008] [warn] [client xxx.xxx.xxx.xxx] regex
>> capture $2 refers to no regex in /users/hughw/public_html/spclhand/z
>> 1234_aba_abt.html
>>
>> This message is found in mod_include.c, and is not present in the
>> Apache 1.3 tree.
>>
>> So, can someone explain to me why the error is triggered? The
>> include parses perfectly and the correct results are displayed, that
>> is, Perl handles things fine, but Apache apparently is trying to use
>> the "$1" and "$2" for its own needs as well as letting Perl have

Have you tried escaping the $ with \?  Maybe something like

<!--#exec cmd="echo $DOCUMENT_NAME | perl -e 'while (<>)
{s/(\w+)_(\w+)_[_abt]{3}\..*/sprintf \"<b>%s Option %s
Hyperlinks<\/b>\", uc \$1,uc \$2/e;print;}'" -->


-- 
Dan Poirier <po...@pobox.com>

---------------------------------------------------------------------
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