I will be getting a string from a textarea tag that was posted to the script.

That posted string will contain the entire HTML of the file I want to create.

So I am writing that information to a file in a temporary directory. Then I use Net::FTP to copy the file from the temporary directory to the main directory which has very restrictive permissions but permits FTP transfers. After that I delete the temporary file.

What I want to do is give the TEMP directory sufficient permission so that the script can write the file, and then eventualy delete it. But not enough permission that a random person could upload a script and run it.

At present I seem to have to give "Other" or world permission to write & execute for the script to be able to write the file without error even through the script that is creating the file is in the regular CGI-BIN directory. I would have thought that execute permission would not be neccessary for a file write if the executing file was in a different directory (my CGI-BIN) but this does not seem to be the case.


In reply to Re^2: CHMOD permissions for Perl Script by comfixit
in thread CHMOD permissions for Perl Script by comfixit

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.