• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Reading a file outside of cgi-bin?

I'm attempting to create a log parser for an online game of mine.

The game produces logs to ~/dystopia/accounts/METALOG

Our websetup is such that ~/public_html/ points to /var/www/html/bd and is setup to execute cgi.

We wrote a cgi program in C++ to read the files in /home/bd/dystopia/accounts/METALOG/... but it fails, saying that it cannot open the files...

I don't think it's a permission problem, because we're very loose with the permissions (775)

Can anyone help please?
0
Krule
Asked:
Krule
1 Solution
 
xDamoxCommented:
The permission is wrong.

the permission is:

owner = Read, write and execute
group = Read, Write and execute
other = execute

you need to set the permission to: 774

hope this helps
0
 
KruleAuthor Commented:
Right, that was a typo, my mistake

Thats not the problem :(
0
 
divtCommented:
Let me try to summarize:

The game produces logs to ~/dystopia/accounts/METALOG
Websetup is such that ~/public_html/ points to /var/www/html/bd and is setup to execute cgi.
You read the files in /home/bd/dystopia/accounts/METALOG/...

Shouldn't you read the files here?
/home/dystopia/accounts/METALOG/...

0
 
divtCommented:
Also, try outputing these server environments for easier debugging:

DOCUMENT_ROOT  The file system path to the script being executed
SCRIPT_FILENAME  The full path and filename of the script being executed.

Good luck!
0
 
TintinCommented:
xDamox.

Nothing wrong with permissions of 775, although better they are 755 or 555.

BTW, 774 is not the permissions you mention, you meant to say 771.

However, it depends on whether we are talking about the directory or the file.

Krule.

What permissions do you have on the directory *and* the files?  If they are all 775 or even 755, then there is no permission problem.

What is the exact error message you get when you try to open the files?
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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now