Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

You're mixing <Directory> and <Location> directives, and according to the docs, your <Location /borg> configuration prevents access to any URL-path that begins in /borg

Also, It is important to never use <Location> when trying to restrict access to objects in the filesystem. This is because many different webspace locations (URLs) could map to the same filesystem location, allowing your restrictions to be circumvented.

However, you can use mod_perl handlers in <Directory> configurations. If you look at the docs for PerlAccessHandler, you will see that it specifies a configuration scope of DIR which means that it can be used in <Location><Directory> and <File> directives.

That said, i can't think of a way to call both Perl and Python CGIs from within the the same <Directory> config section, if you intend using SetHandler perl-script, because you require two SetHandler directives in the same space...

So what can you do? Hmmm... good question. All you want to do is:

  • check a cookie using Perl and either:
    • redirect the user to login, or
    • run a python script

So why don't have you have one call the other. Either have the python script execute the Perl script, or have the Perl script call the python script, but you'll have to be very careful about what scripts you allow it to call. For instance, if you're careless, and you just allow the user to pass in their own path without checking what it contains, then a path like /borg/../../../rm%20-Rf could be disastrous...

Good luck!

Good luck. I almost exclusively use mod_perl handlers, so I may be missing a trick.

Clint


In reply to Re^5: Mod_perl Handler by clinton
in thread Mod_perl Handler by iavian

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others lurking in the Monastery: (3)
    As of 2024-09-14 01:47 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      The PerlMonks site front end has:





      Results (21 votes). Check out past polls.

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.