[cgiwrap-users] Skript with root privileges??
Brought to you by:
nneul
From: Elfriede H. <Elf...@ur...> - 2004-03-04 09:54:10
|
Hello, the configuration of our cgiwrap-3.9 installation is: ./configure --with-perl=3D/usr/bin/perl --with-httpd-user=3Dwww \ --with-cgi-dir=3Dpublic_html/cgi-bin --with-wall \ --with-install-dir=3D/usr/local/apache/cgi-bin \ --with-check-shell --with-minimum-uid=3D20 \ --without-redirect-stderr --without-logging-file \ --with-rlimit-core=3D0 --with-rlimit-cpu=3D30 Calling following user=B4s HTML-Page, which contains PHP-lines: <html> <head> <title>owner.php</title> </head> <body> <?php $text =3D "Hello"; $datei =3D "owner.txt"; @unlink($datei); $fp =3D fopen ($textfile, "w"); fwrite($fp,$text); fclose($fp); $fileowneruid =3D fileowner($textfile); $fileownerarray =3D posix_getpwuid($fileowneruid); $fileowner =3D $fileownerarray['name']; echo "owner is $fileowner"; ?> </body> </html> the output is:owner is root and the file owner.txt doesn=B4t exist. If a file owner.txt existed before, even with ownership root, it had been deleted. I have to mention, that the owner of the HTML-Document isn=B4t root. It=B4s a user's document. However, the owner of the program cgiwrap is root. Changing the line $datei =3D "owner.txt" to $datei =3D "./owner.txt" the skript works correct. What=B4s wrong? Yours, Elfriede Heilmeier |