Solved

Permissions necessary for CGI to create files

Posted on 2001-07-17
5
180 Views
Last Modified: 2013-12-25
I would like to have a perl cgi script that will create a text file.  I found that my script can do this easily if the document root has full permissions (chmod 777) but I don't think that this is a good idea to leave full permission open, right? This is the basic structure of my web:

The absolute path is /home/sites/site1/users/~user1/

The web document root is /~user1/web/

location of cgi-bin is inside of /web like this
/~user1/web/cgi-bin/

My question is this, what should the permissions be for the document root and the cgi-bin to allow my cgi script to be able to create files and read files. I am using the HTTP_REFERRER env var to check and make sure the cgi-script can only be run from my site.

Thanks for your help
0
Comment
Question by:Sanju043097
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 10

Accepted Solution

by:
makerp earned 100 total points
ID: 6292848
cgi-bin needs read/execute rights

root needs write/read rights

never give write and execute writes to the same dir as if somebody uploads an exe/script they can execute it a trash the server. your cgi-bin dir should use another dir for writing files, in your case use your root
0
 

Author Comment

by:Sanju043097
ID: 6302810
Thanks makerp that did the trick
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6697093
Sanju,

Since you have found the solution you wanted in the answer posted by makerp, please go ahead & award the points to makerp.

Thanks,
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6697444
I am sorry to see that Asker has not returned to update and finalize this question.  I am, therefore, force accepting this question.  In the event the Asker returns with additional needs related to this question, please respond and continue the collaboration process.
Thank you,
Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:kodiakbear
ID: 6697450
Accepting makerp's comment as answer due to inactivity
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question