Couple questions about the default setting of permissions on files 
written with "open"....

Background:
I have a long time running cgi script that takes multipart uploads of 
files and stores them to the local server. Below is *almost* the exact 
code I have written (post input checking, permission checking, etc.):

# write the file
open(WRITEFILE,">$filename");
print WRITEFILE $CGI{'scriptfile'}->{'Contents'};
close(WRITEFILE);

Recently (in the last week or so) my hosting provider has made some 
change so that scripts written by the web server through this script are 
now stored as 640 instead of the previously 644:

Example:
-rw-r-----   1 scripts  scriptsg     137k Jul 10 11:31 11109-0.scw
-rw-r--r--   1 scripts  scriptsg     155k Jul  2 20:57 7694-0.scw

Which prevents the re-download of the files from the client (permission 
error).

Questions:
1) How can I set the default permissions on the file that is written to 
what I *need* (less secure I realize, but necessary), aka the original 
default of 644?  (I realize I could then use a system call and chmod the 
file but I would really rather not.)

2) How has my ISP set this new restriction to the default for writes on 
a script that they haven't edited (at least they better not have)?

If necessary:
Linux .com 2.4.15-pre8 #1 Wed Nov 21 13:16:53 CST 2001 i686 unknown
This is perl, v5.6.0 built for i686-linux

Thanks....

Anyone hiring?
http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to