Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

permission problem 1

Status
Not open for further replies.

megabyte214

Programmer
Nov 7, 2001
40
US
I have a simple html form that when the user hits "Submit" goes to a cgi file. The cgi file makes a new text document and write the info from the form. When I run it from the command line it works fine, when I run it from the web I get an error that there is a configuration problem. My permissions are all set to 755.

Code:
use CGI;
my $r = new CGI; 	          

my $name = $r->param('name');                   
my $entry = $r->param('entry'); 

my ($username);
$username = "$name.txt";                   

addLog($username);

sub addLog{

	open(DATA,">$username") || die ("You have got an error..!");
	print DATA "$entry\n";
	close (DATA);

}
 
Remember, when a CGI runs, it runs as the web daemon, not as you. Your system admin should have setup the web daemon with limit abilities (for security reasons).

Make sure that the web daemon has permissions write into the directory. You can try temporarily openning the permissions on that directory all the way (777). Run the script. If it works, you know the web daemon had insufficient priviledges to write to the directory with the original constraints.

I would not leave the dir at 777. Ideally, you will have a user created for the web daemon with it's own group and you would set the dir permissions appropriately. 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top