954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

My c++ cgi-bin program wont allow access to files

I'm running Apache 3.0, and have a c++ cgi-bin program working fine with Apache... except the cgi-bin program wont create or even read from files it uses as a database? Anybody know the answer to this one?

Thanks kindly,
jon

Joncamp
Light Poster
34 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 
I'm running Apache 3.0, and have a c++ cgi-bin program working fine with Apache...

Then your program is NOT "running fine with Apache" :cheesy: Did you check the read/write permissions on the directory in which the program is attempting to write?

Ancient Dragon
Retired & Loving It
Team Colleague
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

I checked the read/write/execute permissions on the directory, they are all set ok. All including user, group, and other.

Joncamp
Light Poster
34 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

http://www.faqs.org/docs/securing/chap29sec254.html
Are you entirely sure that apache is seeing the same directory structure that you're seeing?
Which real / effective user ID's is apache running with, and do these have appropriate permissions to access the files?

Create a simple C++ program which allows you to log all this information, and send it back out as a response.
Use API calls like perror() to tell you why a file could not be accessed - like could it be found, or is it permissions?

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

I checked directory information in c++, the program had no directory information at all, no current working directory, nothing.

Joncamp
Light Poster
34 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You