in reply to Re: CHMOD permissions for Perl Script
in thread CHMOD permissions for Perl Script

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.

  • Comment on Re^2: CHMOD permissions for Perl Script

Replies are listed 'Best First'.
Re^3: CHMOD permissions for Perl Script
by tcf03 (Deacon) on Dec 30, 2004 at 13:56 UTC
    perldoc IO::File is your friend