On 4/18/05, Markus Wichitill <[EMAIL PROTECTED]> wrote:
> Owen Berry wrote:
> > I tried logging "$r->user()" to see if that was more reliable, but no
> > luck there either.
> 
> > Apache 2.0.46
> > mod_perl 1.99_09
> > Perl 5.8.0
> 
> I haven't had any problems with $r->user() lately. And AFAIR Apache::AuthDBI
> worked for me with various 1.99 RCs before RC5, without Apache::compat.
> 
> But there's little point in reporting problems with an ancient development
> release like mod_perl 1.99_09. You might want to try to update to RC4 (which
> also requires an Apache update), or RC5, although the latter breaks
> compatibility with pretty much everything due to the namespace change.
> 

Thanks for the reply. I think I have figured out a way around my problem.

The .htaccess file for the directory in question was only protecting
GET, not POST. No idea why this was setup this way ... I only
inherited the code a few weeks ago. Anyway, apparently when setup this
way the REMOTE_USER environment variable is not populated on posts.
The code in question was doing this:

$USER = remote_user || param('USER') || show_error("Null remote username.");

That will work fine for a post if the REMOTE_USER var is not set, but
it seems that it was not being reset between requests and therefore
the form variable USER was not fulfilling it's intent. Maybe this (env
variables not being reset) is a bug that has been fixed since. Since
we are running an older version and cannot upgrade at short notice, I
just changed the .htaccess file to protect POSTs as well. This seems
like better code to me, anyway.

Thanks to anyone who looked at my question. My answer now exists for
documentational purposes.

As for running an older version of mod_perl and Apache .... these are
the joys of having a commercially supported OS. :-)

Owen Berry

Reply via email to