Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

$r->filename, can I do this here ?

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


aw at ice-sa

Oct 17, 2008, 12:19 AM

Post #1 of 5 (620 views)
Permalink
$r->filename, can I do this here ?

Hi.

In a PerlFixupHandler, I want to use $r->filename to reset the target of
a PUT request, so as to "trick" the following Apache PUT content handler
into writing the PUT-ted file somewhere else than what the original URL
said.

What I am uncertain of, is whether I can (am allowed to ?) actually do
this in the PerlFixupHandler, considering all the steps Apache goes
through before to walk the original path etc..
Or if this opens any security or logical issues that I am unaware of etc..

I know that the path I am providing is correct and allowed, this is the
actual directory and filename where I want this file to land.
And I have done the AAA phases before, based on the original path and
that is OK also.

Thanks in advance,
André


torsten.foertsch at gmx

Oct 17, 2008, 12:53 AM

Post #2 of 5 (584 views)
Permalink
Re: $r->filename, can I do this here ? [In reply to]

On Fri 17 Oct 2008, André Warnier wrote:
> In a PerlFixupHandler, I want to use $r->filename to reset the target
> of a PUT request, so as to "trick" the following Apache PUT content
> handler into writing the PUT-ted file somewhere else than what the
> original URL said.

Yes you are allowed to do that. One thing you may have to consider is
the $r->finfo object (sort of stat() result). It is created in the core
maptostorage handler. So, if $r->filename is changed afterwards it is
out of sync. Don't know if your response handler uses it, probably not.

Torsten

--
Need professional mod_perl support?
Just hire me: torsten.foertsch [at] gmx


aw at ice-sa

Oct 17, 2008, 2:07 AM

Post #3 of 5 (585 views)
Permalink
Re: $r->filename, can I do this here ? [In reply to]

Sorry, hit the reply button too quickly and didn't send it to the list..

Torsten Foertsch wrote:
> On Fri 17 Oct 2008, André Warnier wrote:
>> In a PerlFixupHandler, I want to use $r->filename to reset the target
>> of a PUT request, so as to "trick" the following Apache PUT content
>> handler into writing the PUT-ted file somewhere else than what the
>> original URL said.
>
> Yes you are allowed to do that. One thing you may have to consider is
> the $r->finfo object (sort of stat() result). It is created in the core
> maptostorage handler. So, if $r->filename is changed afterwards it is
> out of sync. Don't know if your response handler uses it, probably not.
>
Thanks.
I don't use $r->finfo.
But mod_dav is the content handler, and it may use the underlying Apache
information. Any way I can kind of "force" Apache to update it's
information after I call $r->filename, or does it already do that anyway ?


torsten.foertsch at gmx

Oct 17, 2008, 2:50 AM

Post #4 of 5 (584 views)
Permalink
Re: $r->filename, can I do this here ? [In reply to]

On Fri 17 Oct 2008, André Warnier wrote:
> Any way I can kind of "force" Apache to update it's
> information after I call $r->filename, or does it already do that
> anyway ?

See the example in
http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_filename_

Torsten

--
Need professional mod_perl support?
Just hire me: torsten.foertsch [at] gmx


aw at ice-sa

Oct 17, 2008, 4:36 AM

Post #5 of 5 (578 views)
Permalink
Re: $r->filename, can I do this here ? [In reply to]

Torsten Foertsch wrote:
> On Fri 17 Oct 2008, André Warnier wrote:
>> Any way I can kind of "force" Apache to update it's
>> information after I call $r->filename, or does it already do that
>> anyway ?
>
> See the example in
> http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_filename_
>
Thanks again.
It is very clear in the doc, I just never thought of looking there..
Sorry.

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.