You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Michael J Schout <ms...@gkg.net> on 2001/02/19 18:56:20 UTC

bug in section processing.

I have isolated a problem in <Perl> section processing that I have been
encountering. Basically there are situations where one particular entry in
%Location or %LocationMatch causes the *NEXT* entry to fail to configure
properly.

I have a standard httpd configuration, and then the following mod_perl 
configuration (and no other mod_perl configuration items):

--- cut ---
PerlModule Apache::AuthTicket

<Perl>
  $LocationMatch{'^/gen06/prologinform$'} = {
    'PerlSetVar' => [
			['ProtectedPath', '/gen06/protected'],
      ['ProtectedTicketLoginHandler', '/gen06/prologin']
    ],
    'PerlHandler' => 'Apache::AuthTicket->login_screen Apache::SSI',
    'AuthType'    => 'Apache::AuthTicket',
    'AuthName'    => 'Protected',
    'SetEnv' => [
      ['LANG', 'en'],
      ['HTML_TEMPLATE_ROOT', '/something/gen06']
    ],
    'SetHandler' => 'perl-script'
  };

  $LocationMatch{'^/gen06/prologin$'} = {
    'PerlSetVar' => [
			['ProtectedPath', '/gen06/protected'],
      ['ProtectedLoginScript', '/gen06/prologinform']
    ],
    'PerlHandler' => 'Apache::AuthTicket->login',
    'AuthType' => 'Apache::AuthTicket',
    'AuthName' => 'Protected',
    'SetHandler' => 'perl-script'
  };
</Perl>
--- cut ---

If I start the web server with this config, then /gen01/prologinform URI works
as expected, but the /gen06/prologin URI returns NOT_FOUND.  Running under
strace, it appears that the request is falling through to the default handler,
and mod_perl is not matching it against the configured handler.  If I run with
MOD_PERL_TRACE enabled, I see it appears to configure both URIs:

perl_section: <Location ^/gen06/prologinform$>
handle_command (PerlSetVar ProtectedPath /gen06/protected): perl_cmd_var: 'ProtectedPath' = '/gen06/protected'
OK
handle_command (PerlSetVar "ProtectedTicketLoginHandler" "/gen06/prologin"): perl_cmd_var: 'ProtectedTicketLoginHandler' = '/gen06/prologin'
OK
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::AuthTicket->login_screen'
pushing `Apache::AuthTicket->login_screen' into `PerlHandler' handlers
perl_cmd_push_handlers: @PerlHandler, 'Apache::SSI'
pushing `Apache::SSI' into `PerlHandler' handlers
PerlHandler Apache::AuthTicket->login_screen Apache::SSI (OK) Limit=no
AuthType Apache::AuthTicket (OK) Limit=no
AuthName Protected (OK) Limit=no
SetHandler perl-script (OK) Limit=no
handle_command (SetEnv "LANG" "en"): OK
handle_command (SetEnv HTML_TEMPLATE_ROOT /something/gen06): OK
perl_section: <Location ^/gen06/prologin$>
handle_command (PerlSetVar ProtectedPath /gen06/protected): perl_cmd_var: 'ProtectedPath' = '/gen06/protected'
OK
handle_command (PerlSetVar "ProtectedLoginScript" "/gen06/prologinform"): perl_cmd_var: 'ProtectedLoginScript' = '/gen06/prologinform'
OK
init `PerlHandler' stack
perl_cmd_push_handlers: @PerlHandler, 'Apache::AuthTicket->login'
pushing `Apache::AuthTicket->login' into `PerlHandler' handlers
PerlHandler Apache::AuthTicket->login (OK) Limit=no
AuthType Apache::AuthTicket (OK) Limit=no
AuthName Protected (OK) Limit=no
SetHandler perl-script (OK) Limit=no
perl_section: </Location>

If I simply comment out the entry for $LocationMatch{'^/gen06/prologinform$'}, 
and change nothing else at all, then the /gen06/prologin URI works correctly.  So
something must be going wrong while configuring
$LocationMatch{'^/gen06/prologinform$'} that causes mod_perl not to configure
$LocationMatch{'^/gen06/prologin$'} correctly.

I'm running apache 1.3.17, mod_perl 1.25 on a redhat linux 6.2 machine (kernel
2.2.16).  Mod perl is compiled statically into the web server.  Perl version is
5.6.0.  Is this bug known, or has anyone else encountered something like this?

If you need any other information about my configuration or reproducing this,
please let me know and I will be happy to provide you with the information.

Mike