Forum Moderators: phranque

Message Too Old, No Replies

CGI write to file problem

         

IamStang

1:20 am on Mar 17, 2005 (gmt 0)

10+ Year Member



I have a problem with a cgi script not being allowed to create/write to a txt file.

The Scenario:
A Linux/Apache server with SeLinux disabled (temporarily)
A cgi script that creates a new txt file containing info submitted by a visitor (ipaddy_data.txt)

When I load the cgi in my browser, I get an "Internal Server Error". Looking at my error log tells me "Permission denied at line 13". This is where the script is supposed to create the file. (my $logpath = "data/$remote-addr_data.txt"; ). If I "rem" out everything to do with creating that file, it works great. No errors.

What have I done to try to fix this?

I have chowned all folders to root:root (cgi wouldn't work at all any other way I tried). I have chmoded all existing files to 777. And I have disabled SeLinux.

Now, what in the world am I not seeing here?

Any help with this is greatly appreciated. Also, if any more info is required, please ask.

IamStang

2:21 am on Mar 17, 2005 (gmt 0)

10+ Year Member



Nevermind ...... figured it out. Had a D.A. attack. LOL

Delete this thread if ya want

sitz

5:47 am on Mar 17, 2005 (gmt 0)

10+ Year Member



For the record, take note that, suexec and the like notwithstanding, ANY CGI on your system now has the ability to write to that textfile; if you have users on your systems and they can run CGIs, they could write to that file (if they find it).