I'm currently developing a CGI script that will allow clients to browse a directory tree of files and stuff that will be posted on a webserver. Users will be able to see the contents of the current directory and will be able to browse to other directories within the tree (with some bonus features like custom file descriptions). Of course I would like to prevent users from "accidentally" browsing into directories that they shouldn't have access to (like the directory trees of other clients). I think the server currently does user authentication by directory using .htaccess files. Not every directory has one of these files, subdirectories inherit the properties of the parent. I want to avoid creating more than one script per client, thus I think I need the script to handle user authentication for each request to browse a particular directory. Any suggestions for how to check that the user isn't wandering around my entire filesystem? (sorry no code yet, still in design phase) Thanks.

In reply to Dir Browsing User Authentication by mgdude

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, details, 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, summary, 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.