Quote:
Originally Posted by
Meow613
Definitely created. If I run the C program as a stand alone, the file is created and I can read it.
I know for a fact that an ordinary webserver cannot and
should not write files to /var/www/. That would be a security hole large enough to drop the moon through, with Jupiter and Sirius for change. It's blocked on purpose, to limit the damage a program bug -- or an outright hacking attempt -- can do. When it's blocked, an attacker can't drop malicious programs there even if they try.
It blocks it by running it as a different user. This is why you had to
chmod 666 the device file, too.
You have access to the device -- the webserver does not. This isn't related to the owner of the program at all, any more than
ls would run as root just because root owns it.
There are a few very specific and tightly controlled places your web server is allowed to write, /tmp/ is the main one. Not /temp/,
/tmp/. Please give it a try.