Re: Help with CGI scripts and created file permissions ..

Roland Turner (raz@nospam.arrakis.com.au)
Thu, 11 Jul 1996 20:18:32 +1000

Geoff Eldridge wrote:

>I'm trying to figure out what happens when perl opens (i.e. creates) a new
>file when the Perl script is invoked through the CGI.
>
>The file permission I end up with is:
>
>-rw------- 1 geldridg 2812 Jul 11 19:31 2.html
>
>which is not much good if you if you want to access the file from a web
>browser (NB: the file is created in one of my public_html
>sub-directories).

When a file is created, the initial mode bits are derived from your umask.
(See the 'sh' and 'chmod' man pages).

If you have a umask of 066, files are created -rw-------. If you set your
umask to 022 prior to the creation of the file, the file will be created
-rw-r--r--. ALternatively, you can create the file and then chmod it.

>Also, can anyone point me to any documentation on CGI and how we have set
>up our Web Server. I've been trying to figure the CGI for too long ..

We are running a pretty standard Apache set up. Start with a CGI tutorial
(no doubt you'll find a pointer to one somewhere under http://www.w3.org/),
then if you need more info, look at the Apache documentation
(http://www.apache.org/ if nowhere else.)

- Raz