Solved

Reading a file outside of cgi-bin?

Posted on 2004-09-04
8
161 Views
Last Modified: 2013-12-25
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
Comment
Question by:Krule
8 Comments
 
LVL 16

Expert Comment

by:xDamox
Comment Utility
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
 
LVL 3

Author Comment

by:Krule
Comment Utility
Right, that was a typo, my mistake

Thats not the problem :(
0
 
LVL 4

Expert Comment

by:divt
Comment Utility
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
 
LVL 4

Expert Comment

by:divt
Comment Utility
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
 
LVL 48

Accepted Solution

by:
Tintin earned 125 total points
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now