Its not so much a concern here in my development sandbox, but as I think about how my script will be deployed, perhaps in shared hosting environments, I shudder to think of the security consequences.

Part of what I need this script to do is:

  • accept user input,
  • process input,
  • create and post a pdf in a web accessible directory
  • hand pdf off to hylafax for distribution

    This started out as a working cli script, and on the road to being web-available as a cgi script, I'm having to jump over these privilege issues. Surely someone here has done this sort of thing before.

    How can I safely allow a script running as the apache user to write to a web-accessible directory, without exposing that directory to tampering in a shared-hosting environment, where others can also write into the webserver's document root or deploy scripts that can?

    -- Hugh


    In reply to Allowing Apache to Write to filesystem by hesco

    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.